feat: patch registry + wiring for per-package patching #103
1 changed files with 22 additions and 0 deletions
docs(patches): document the package patching workflow
commit
a826a27246
22
README.md
22
README.md
|
|
@ -53,6 +53,28 @@ For every package+tag combination:
|
|||
1. Archive old package versions and keep the latest one in the root
|
||||
1. Delete local binaries after successful upload
|
||||
|
||||
## Patching packages
|
||||
|
||||
Some CRAN packages fail to compile on specific platforms due to compiler- or OS-specific issues unrelated to the package itself.
|
||||
The canonical example is `RcppParallel`, whose bundled TBB sources fail on musl (Alpine) and newer compiler/OS combinations.
|
||||
Because such packages are often transitive dependencies of many others, a single failure cascades: all dependents fail even though nothing is wrong with the dependent itself.
|
||||
|
||||
To address this, frequently-failing packages can be "patched" before they are installed — whether as a direct build target or a transitive dependency pulled in by `pak`.
|
||||
|
||||
The patch registry lives in `local/patches/registry.json`.
|
||||
Each entry specifies a package and the platforms/versions it applies to, along with either lightweight build-time overrides (environment variables, configure arguments, Makevars) or a source diff (for deeper fixes).
|
||||
See `local/patches/README.md` for the complete schema.
|
||||
|
||||
Patching uses a two-tier approach:
|
||||
|
||||
1. **Lightweight overrides:** environment variables, configure arguments, or Makevars settings applied during build — typically version-independent and fast.
|
||||
2. **Source diffs:** unified diff patches applied to the unpacked source before building — more powerful but version-pinned.
|
||||
|
||||
The system is implemented in `bincraft`: when a package needs patching, `bincraft` pre-builds it with the patch and serves the patched binary to `pak`, ensuring transitive dependents receive the fixed package.
|
||||
This way, the fix cascades to all packages that depend on it.
|
||||
|
||||
For the design rationale and architecture, see `specs/2026-06-30-package-patching-design.md`.
|
||||
|
||||
## Build Environment
|
||||
|
||||
Binaries are built on a mixed-architecture Kubernetes cluster using CI.
|
||||
|
|
|
|||
Loading…
Reference in a new issue