feat: patch registry + wiring for per-package patching #103

Merged
pat-s merged 12 commits from t3code/patch-packages-before-build into main 2026-06-30 08:50:20 +00:00
Owner

Summary

Adds the curated patch registry and wiring that drives bincraft's new package-patching mechanism (see bincraft PR feat/package-patching).
Lets specific packages be patched (env/configure/Makevars overrides or source diffs) before pak installs them — including as transitive dependencies — so compiler-/OS-specific failures like RcppParallel's bundled TBB stop cascading.

What's included

  • local/patches/registry.json — initial entry: RcppParallel with RCPP_PARALLEL_USE_TBB=0 for alpine / ubuntu-2604, plus local/patches/README.md schema docs.
  • local/validate-patches.R — validates schema, referenced patch files, and ambiguous overlaps; clean failure + exit 1 (no stacktrace).
  • .pre-commit-config.yaml — a validate-patches hook (re-runs when the registry or the validator changes).
  • local/build-one.R / local/build-all.R — pass patches = "local/patches" to bincraft::build_binary_package().
  • specs/2026-06-30-package-patching-design.md and plans/2026-06-30-package-patching-implementation.md.

⚠️ Merge ordering (blocker)

This PR adds a patches = ... argument to build_binary_package() calls.
The .crow/*.yaml workflows currently pin bincraft v4.2.3, which does not accept that argument — CI will error with unused argument (patches=...) until:

  1. bincraft v4.3.0 is released (PR feat/package-patching), and
  2. the pin is bumped in .crow/build-all-versions-install-deps.yaml, .crow/build-all-versions.yaml, and .crow/process-updates.yaml.

The .crow pin bump will be added to this PR once bincraft v4.3.0 is tagged. Do not merge before then.

## Summary Adds the curated **patch registry** and wiring that drives bincraft's new package-patching mechanism (see bincraft PR `feat/package-patching`). Lets specific packages be patched (env/configure/Makevars overrides or source diffs) before pak installs them — including as transitive dependencies — so compiler-/OS-specific failures like RcppParallel's bundled TBB stop cascading. ## What's included - `local/patches/registry.json` — initial entry: RcppParallel with `RCPP_PARALLEL_USE_TBB=0` for alpine / ubuntu-2604, plus `local/patches/README.md` schema docs. - `local/validate-patches.R` — validates schema, referenced patch files, and ambiguous overlaps; clean failure + exit 1 (no stacktrace). - `.pre-commit-config.yaml` — a `validate-patches` hook (re-runs when the registry or the validator changes). - `local/build-one.R` / `local/build-all.R` — pass `patches = "local/patches"` to `bincraft::build_binary_package()`. - `specs/2026-06-30-package-patching-design.md` and `plans/2026-06-30-package-patching-implementation.md`. ## ⚠️ Merge ordering (blocker) This PR adds a `patches = ...` argument to `build_binary_package()` calls. The `.crow/*.yaml` workflows currently pin bincraft **v4.2.3**, which does not accept that argument — CI will error with `unused argument (patches=...)` until: 1. bincraft **v4.3.0** is released (PR `feat/package-patching`), and 2. the pin is bumped in `.crow/build-all-versions-install-deps.yaml`, `.crow/build-all-versions.yaml`, and `.crow/process-updates.yaml`. The `.crow` pin bump will be added to this PR once bincraft v4.3.0 is tagged. Do not merge before then.
Adds a brainstormed design for patching packages (env/configure overrides
and source diffs) before they are installed by pak, including transitive
dependencies like RcppParallel.
The mechanism lives in bincraft (pre-built patched binaries served from a
prepended local repo); the curated patch registry lives in this repo.
Two-phase, TDD plan.
Phase A (bincraft): patch registry loading/matching, isolated patched-binary
builds, local-repo caching, and wiring into the pak install path, gated by a
proof-of-mechanism task.
Phase B (this repo): the RcppParallel registry entry, a validator + pre-commit
hook, and passing patches through the build entry points.
Remove the accidentally-committed .superpowers/ scratch (briefs/reports) and
gitignore it.
Exclude specs/ and plans/ design docs from markdownlint (like the existing
docs/superpowers/** exclusion).
Pad the registry README table separator so it satisfies MD060.
v4.3.0 adds the `patches` argument that build-one.R/build-all.R now pass.
Updates the install pin (and version guard) across all .crow workflows so CI
installs a bincraft that accepts the argument.
Pass patches = 'local/patches' to the daily process_cran_updates() calls
(requires bincraft v4.3.1) and the weekly-rebuild build_binary_package() call,
so every CI build path applies the patch registry like build-all/build-one
already do.
Bump the bincraft pin v4.3.0 -> v4.3.1 across all .crow workflows.
pat-s merged commit 55a18fd87d into main 2026-06-30 08:50:20 +00:00
pat-s deleted branch t3code/patch-packages-before-build 2026-06-30 08:50:20 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
devxy/build-cran-binaries!103
No description provided.