build-cran-binaries/.superpowers/handoff/task-A0-report.md

2 KiB

Task A0 Report — Proof of mechanism

Status: DONE_WITH_CONCERNS

What was done

Created tools/verify-patch-mechanism.R verbatim from the brief and committed it to feat/package-patching (SHA aaf0f81).

The air formatter reformatted the file (argument alignment, multi-line function calls) before the commit was accepted by pre-commit hooks. The logic is identical to the brief — only whitespace changed.

Local macOS run result

FAIL (exit status 1) — macOS-specific issue unrelated to the pak repo-priority mechanism.

Root cause: pkgbuild::build(binary = TRUE) on macOS produces a .tgz file (e.g. glue_1.8.1.tgz), not a .tar.gz. The script searches for ^glue_.*\.tar\.gz$, finds nothing, built[1L] is NA, the file.rename() is a no-op, and cranlike::add_PACKAGES("glue_1.8.1.tar.gz", repo) errors because the file does not exist at that path.

Error in check_existing_files(full_files) :
  File does not exist: .../glue_1.8.1.tar.gz

This is a macOS binary-package naming difference, not a failure of the file:// repo-prepend mechanism. The script is written for Linux (as stated in the brief header comment), where pkgbuild::build(binary = TRUE) produces .tar.gz.

What the user needs to do

Run the container proof (brief Step 2) on any Linux build-env image:

docker run --rm -v "$PWD":/work -w /work reg.devxy.io/rpkgs/build-env-ubuntu:2604 \
  Rscript tools/verify-patch-mechanism.R

Expected: PROOF PASSED: pak installed the patched local binary. and exit 0.

A4 contingency

Cannot determine from the macOS run whether the contingency is needed — the failure is in the binary-build step, not in the pak repo-priority step. Contingency decision must await the Linux container run. If that run PASSES, proceed to A1 unchanged. If it FAILS (pak recompiles or picks CRAN), switch build_patched_binary() in A4 to pkgbuild::build(binary = FALSE) and rely on pkgcache build-caching.

Commit

aaf0f81test(patches): prove pak installs a patched binary from a local file:// repo