fix(index): add a slot repair for a broken Built stamp and retire alpine 3.21 #150

Merged
pat-s merged 1 commit from fix/repair-built-stamp-slot into main 2026-08-07 09:15:05 +00:00
Owner

Problem

arm64/alpine321 and arm64/alpine322 advertise a broken stamp:

arm64/alpine321 :: 22930  Built: R 4.4.0; NA; 2026-07-31 13:35:52 UTC; unix
arm64/alpine322 :: 24696  Built: R 4.5.0; NA; 2026-07-31 13:51:54 UTC; unix

The per-minor sub-slots (contrib/4.4, 4.5, 4.6) are affected too.
All 18 other slots are correct.

uvr matches the stamp's platform triple plus R minor to pick binary over source, so nothing matches NA and both slots silently serve as source-only, which is exactly the regression bincraft#85 added the stamp to prevent.
install.packages() is unaffected, since it reads Built: from each tarball's own DESCRIPTION.
The tarballs are fine (arm64/alpine322/.../dress.graph_0.8.3.tar.gz carries aarch64-unknown-linux-musl), and so is the R that built them (r-4.5.0_1_aarch64.apk ships R_PLATFORM='aarch64-unknown-linux-musl').
Only the index is wrong.

bincraft#96 stops a stamp like this being written again, but it cannot repair what is already there.

Why not just re-run the index update

upload_package_index() reuses the slot's remote PACKAGES.db, and cranlike's update_db() only reparses files whose md5 changed, so entries already in the database keep the stamp they were written with.

Dropping PACKAGES.db to force a full reparse does work, and it is what bincraft#85's rollout note suggested, but for an S3 repo cranlike reads each package's metadata from the CRAN source mirror on GitHub.
A 25k-entry slot is then 25k requests to raw.githubusercontent.com, with a real risk of being rate-limited part-way through and leaving the slot half-written.

Only the Built column is wrong, so this corrects it in place instead: patch the column in PACKAGES.db, put the database back, and let upload_package_index() re-emit PACKAGES* from it.
update_db() always rewrites the index files even when nothing was reparsed, so no tarball is re-read and nothing is fetched from GitHub.

Change

  • local/repair-built-stamp.R — repairs the generic slot plus every per-minor sub-slot. Dry-run by default; --apply writes. The replacement comes from bincraft::built_stamp() under the R running the script, so it is exactly what a healthy run would have written, and bincraft#96's guard makes a broken build image fail rather than write a second bad stamp.
  • .crow/repair-built-stamp.yaml — manual pipeline, routed by target_arch to the matching agent group and platform image, with dry_run defaulting to true.
  • .crow/archive-missed-packages.yaml — drop the two alpine321 matrix entries. Alpine 3.21 is EOL: the website advertises only 3.23/3.24 and process-updates.yaml already dropped it, so that slot is retired rather than repaired.

Verification

crow lint .crow/ passes on all nine pipelines.
air format and jarl check are clean; the script parses, and the /opt/R minor-version derivation was checked against 4.4.3 / 4.5.3 / 4.6.0 / current4.4 4.5 4.6.
The repair itself is unrun by design — it needs B2 credentials and an arm64 agent.

Rollout

  1. Cut a bincraft release so local/install-bincraft.R picks up #96 (it resolves the latest vX.Y.Z tag, and #96 is only on main).
  2. Run this pipeline with target_arch=arm64, OS=alpine, OS_VERSION=3.22, R_VERSION=4.5.3, dry_run=true and check the reported counts.
  3. Re-run with dry_run=false.
  4. Confirm: curl -sS https://cran.devxy.io/arm64/alpine322/latest/src/contrib/PACKAGES | grep '^Built:' | sort | uniq -c

arm64/alpine321 is deliberately left alone.

## Problem `arm64/alpine321` and `arm64/alpine322` advertise a broken stamp: ``` arm64/alpine321 :: 22930 Built: R 4.4.0; NA; 2026-07-31 13:35:52 UTC; unix arm64/alpine322 :: 24696 Built: R 4.5.0; NA; 2026-07-31 13:51:54 UTC; unix ``` The per-minor sub-slots (`contrib/4.4`, `4.5`, `4.6`) are affected too. All 18 other slots are correct. uvr matches the stamp's platform triple plus R minor to pick binary over source, so nothing matches `NA` and both slots silently serve as source-only, which is exactly the regression bincraft#85 added the stamp to prevent. `install.packages()` is unaffected, since it reads `Built:` from each tarball's own `DESCRIPTION`. The tarballs are fine (`arm64/alpine322/.../dress.graph_0.8.3.tar.gz` carries `aarch64-unknown-linux-musl`), and so is the R that built them (`r-4.5.0_1_aarch64.apk` ships `R_PLATFORM='aarch64-unknown-linux-musl'`). Only the index is wrong. bincraft#96 stops a stamp like this being written again, but it cannot repair what is already there. ## Why not just re-run the index update `upload_package_index()` reuses the slot's remote `PACKAGES.db`, and cranlike's `update_db()` only reparses files whose md5 changed, so entries already in the database keep the stamp they were written with. Dropping `PACKAGES.db` to force a full reparse does work, and it is what bincraft#85's rollout note suggested, but for an S3 repo cranlike reads each package's metadata from the CRAN *source* mirror on GitHub. A 25k-entry slot is then 25k requests to raw.githubusercontent.com, with a real risk of being rate-limited part-way through and leaving the slot half-written. Only the `Built` column is wrong, so this corrects it in place instead: patch the column in `PACKAGES.db`, put the database back, and let `upload_package_index()` re-emit `PACKAGES*` from it. `update_db()` always rewrites the index files even when nothing was reparsed, so no tarball is re-read and nothing is fetched from GitHub. ## Change - `local/repair-built-stamp.R` — repairs the generic slot plus every per-minor sub-slot. Dry-run by default; `--apply` writes. The replacement comes from `bincraft::built_stamp()` under the R running the script, so it is exactly what a healthy run would have written, and bincraft#96's guard makes a broken build image fail rather than write a second bad stamp. - `.crow/repair-built-stamp.yaml` — manual pipeline, routed by `target_arch` to the matching agent group and platform image, with `dry_run` defaulting to `true`. - `.crow/archive-missed-packages.yaml` — drop the two `alpine321` matrix entries. Alpine 3.21 is EOL: the website advertises only 3.23/3.24 and `process-updates.yaml` already dropped it, so that slot is retired rather than repaired. ## Verification `crow lint .crow/` passes on all nine pipelines. `air format` and `jarl check` are clean; the script parses, and the `/opt/R` minor-version derivation was checked against `4.4.3 / 4.5.3 / 4.6.0 / current` → `4.4 4.5 4.6`. The repair itself is unrun by design — it needs B2 credentials and an arm64 agent. ## Rollout 1. Cut a bincraft release so `local/install-bincraft.R` picks up #96 (it resolves the latest `vX.Y.Z` tag, and #96 is only on `main`). 2. Run this pipeline with `target_arch=arm64`, `OS=alpine`, `OS_VERSION=3.22`, `R_VERSION=4.5.3`, `dry_run=true` and check the reported counts. 3. Re-run with `dry_run=false`. 4. Confirm: `curl -sS https://cran.devxy.io/arm64/alpine322/latest/src/contrib/PACKAGES | grep '^Built:' | sort | uniq -c` `arm64/alpine321` is deliberately left alone.
`arm64/alpine321` (22,930 entries) and `arm64/alpine322` (24,696 entries)
advertise `Built: R <ver>; NA; ...`. uvr matches the stamp's platform triple
plus R minor to pick binary over source, so no client matches those slots and
both silently serve as source-only, which is the regression the stamp was added
to prevent. The tarballs themselves carry the correct triple; only the index is
wrong.

Re-running the normal index update does not fix it: `upload_package_index()`
reuses the slot's remote `PACKAGES.db` and cranlike's `update_db()` only
reparses files whose md5 changed. Dropping `PACKAGES.db` to force a full reparse
does work, but for an S3 repo cranlike reads each package's metadata from the
CRAN source mirror on GitHub, so a 25k-entry slot means 25k requests to
raw.githubusercontent.com and a real risk of being rate-limited part-way.

Only the `Built` column is wrong, so correct it in place: patch the column in
`PACKAGES.db`, put it back, and let `upload_package_index()` re-emit `PACKAGES*`
from it. `update_db()` always rewrites the index files even when nothing was
reparsed, so no tarball is re-read and nothing is fetched from GitHub.

Alpine 3.21 is EOL: the website advertises only 3.23/3.24 and
`process-updates.yaml` dropped it, so remove its two leftover matrix entries
from the archive pipeline rather than repairing that slot.
pat-s merged commit 0da29ab3f6 into main 2026-08-07 09:15:05 +00:00
pat-s deleted branch fix/repair-built-stamp-slot 2026-08-07 09:15:06 +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!150
No description provided.