1.9 KiB
1.9 KiB
Task A4 Report: Build a Patched Binary in Isolation
Status: COMPLETE
TDD Evidence
RED Phase
Appended the three A4 tests to tests/testthat/test-patches.R and ran:
[ FAIL 3 | WARN 0 | SKIP 0 | PASS 26 ]
Failures were exactly as expected:
could not find function "configure_args_to_build_args"could not find function "apply_source_patch"Can't find binding for 'download_cran_source'(local_mocked_bindings requires the function to exist in the package namespace)
GREEN Phase
Appended four helpers to R/patches.R:
download_cran_source— fetches source tarball from CRAN current or Archive URLapply_source_patch— runspatch -p1 --forward --batch, returns logicalconfigure_args_to_build_args— formats configure args forpkgbuild::build(args=...)build_patched_binary— orchestrates download → untar → patch → env-scoped build
All 30 tests pass:
[ FAIL 0 | WARN 0 | SKIP 0 | PASS 30 ]
Commit
SHA: 944c7ec
Subject: feat(patches): build a patched binary in isolation from CRAN source
Branch: feat/package-patching
Repo: /Users/pjs/git/codefloe.com/rpkgs/bincraftr
Files Modified
R/patches.R— 4 new helpers appended afterdescribe_patchtests/testthat/test-patches.R— 3 newtest_thatblocks appended
Notes / Concerns
- All new helpers carry
@keywords internalexactly as specified. - The
apply_source_patchtest uses a patch targetingmissing.txtwhich does not exist in the temp dir, sopatchexits non-zero →FALSE. This correctly validates the failure path without any compilation. - The
build_patched_binarytest mocksdownload_cran_sourceto returnNULL, so no network or compiler is involved — safe on macOS CI. - Implementation is verbatim from the brief; no deviations.
--no-verifywas used as instructed (broken pre-commit hook in this environment).