fix(patches): cover every RcppParallel 6.x release with the bundled-TBB patch #228

Merged
pat-s merged 1 commit from fix/rcppparallel-patch-older-6x into main 2026-10-04 07:35:02 +00:00
Owner

Motivation

eeebef8 pinned the RcppParallel patch to 6.2.1, so 6.0.0 through 6.2.0 have been built unpatched since then.
All of those releases still pass the TBB library dir as -Wl,-L, and every build image ships a distro libtbb, so their binaries link the system TBB and can't load without it.
The old patch file didn't apply to 6.0.0, 6.1.0 or 6.1.1, because the TBB read sites move between releases.

Changes

  • local/patches/RcppParallel/force-bundled-tbb-6.0.0.patch: new, generated against 6.0.0.
  • local/patches/RcppParallel/force-bundled-tbb-6.1.x.patch: new, generated against 6.1.1, applies identically to 6.1.0.
  • local/patches/RcppParallel/force-bundled-tbb-6.2.x.patch: renamed from force-bundled-tbb.patch, regenerated against 6.2.1 (the R/tbb.R hunks keep 1 line of context so it also applies to 6.2.0), with comments no longer claiming the images export TBB_*.
  • local/patches/registry.json: one exact-version entry per release from 6.0.0 to 6.2.1. bincraft takes a single version constraint and aborts a target build on a non-applying patch, so a range would hit 5.x or unverified future releases. The reason now leads with the link-order bug and treats ignoring TBB_ROOT/TBB_LIB/TBB_INC as a safeguard (the images stopped exporting them in build-env-images c51ed09).

Verification

  • Patch matrix with git apply --check: each 6.x release applies exactly one patch; none applies to 5.1.11.
  • bincraft select_target_patch_entry() against the new registry: 6.0.0 to 6.2.1 pick their patch; 5.1.11 and 6.2.2 get none.
  • Built all five releases from CRAN source plus patch on build-env-ubuntu:jammy, build-env-redhat:8 and build-env-alpine:3.22, with TBB_LIB/TBB_INC set to simulate a stale image: every binary records NEEDED libtbb.so with an $ORIGIN/../lib runpath and loads with every system libtbb moved away.
  • Unpatched controls: jammy (6.0.0, 6.2.1) and alpine (6.2.1) record NEEDED libtbb.so.12 and fail to load without it. Redhat 8 records libtbb.so.2 but still loads, because RcppParallel's bundled copy happens to use that name.

Behaviour change

  • RcppParallel 6.0.0 to 6.2.0 are patched again. Their published binaries stay broken until build-all-versions is rerun for RcppParallel; weekly-rebuild-missing won't pick them up.
  • The 6.2.x patch content changed, so bincraft's patched-binary cache rebuilds RcppParallel 6.2.1 once per platform.
  • prepare_patched_repo logs one expected "patch skipped" warning for each entry that doesn't match the latest CRAN version (four per dependency install).
## Motivation eeebef8 pinned the RcppParallel patch to `6.2.1`, so 6.0.0 through 6.2.0 have been built unpatched since then. All of those releases still pass the TBB library dir as `-Wl,-L`, and every build image ships a distro libtbb, so their binaries link the system TBB and can't load without it. The old patch file didn't apply to 6.0.0, 6.1.0 or 6.1.1, because the TBB read sites move between releases. ## Changes - `local/patches/RcppParallel/force-bundled-tbb-6.0.0.patch`: new, generated against 6.0.0. - `local/patches/RcppParallel/force-bundled-tbb-6.1.x.patch`: new, generated against 6.1.1, applies identically to 6.1.0. - `local/patches/RcppParallel/force-bundled-tbb-6.2.x.patch`: renamed from `force-bundled-tbb.patch`, regenerated against 6.2.1 (the `R/tbb.R` hunks keep 1 line of context so it also applies to 6.2.0), with comments no longer claiming the images export `TBB_*`. - `local/patches/registry.json`: one exact-version entry per release from 6.0.0 to 6.2.1. bincraft takes a single version constraint and aborts a target build on a non-applying patch, so a range would hit 5.x or unverified future releases. The reason now leads with the link-order bug and treats ignoring `TBB_ROOT`/`TBB_LIB`/`TBB_INC` as a safeguard (the images stopped exporting them in build-env-images c51ed09). ## Verification - Patch matrix with `git apply --check`: each 6.x release applies exactly one patch; none applies to 5.1.11. - bincraft `select_target_patch_entry()` against the new registry: 6.0.0 to 6.2.1 pick their patch; 5.1.11 and 6.2.2 get none. - Built all five releases from CRAN source plus patch on `build-env-ubuntu:jammy`, `build-env-redhat:8` and `build-env-alpine:3.22`, with `TBB_LIB`/`TBB_INC` set to simulate a stale image: every binary records NEEDED `libtbb.so` with an `$ORIGIN/../lib` runpath and loads with every system libtbb moved away. - Unpatched controls: jammy (6.0.0, 6.2.1) and alpine (6.2.1) record NEEDED `libtbb.so.12` and fail to load without it. Redhat 8 records `libtbb.so.2` but still loads, because RcppParallel's bundled copy happens to use that name. ## Behaviour change - RcppParallel 6.0.0 to 6.2.0 are patched again. Their published binaries stay broken until `build-all-versions` is rerun for RcppParallel; `weekly-rebuild-missing` won't pick them up. - The 6.2.x patch content changed, so bincraft's patched-binary cache rebuilds RcppParallel 6.2.1 once per platform. - `prepare_patched_repo` logs one expected "patch skipped" warning for each entry that doesn't match the latest CRAN version (four per dependency install).
This change will:

- Split the patch into per-family files generated against each CRAN release (6.0.0, 6.1.x, 6.2.x), since the TBB read sites move between releases and the old patch did not apply before 6.2.0.
- Pin one exact-version registry entry per release from 6.0.0 to 6.2.1, so 6.0.0-6.2.0 are patched again without matching 5.x or unverified future releases.
- Rewrite the registry reason to lead with the link-order bug and treat the ambient TBB_* handling as a safeguard, now that the build images no longer export those variables.
- Update the in-patch comments that claimed the images still export TBB_ROOT/TBB_LIB/TBB_INC.
pat-s merged commit 40a0a6e02d into main 2026-10-04 07:35:02 +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!228
No description provided.