fix(repair-built-stamp): patch the published PACKAGES.rds once bincraft drops cranlike #236

Merged
pat-s merged 2 commits from fix/repair-built-stamp-without-cranlike into main 2026-10-18 11:55:21 +00:00
Owner

Follow-up to https://codefloe.com/rpkgs/bincraft/pulls/228 (bincraft#33), which drops the cranlike and desc forks.

Why

After that change, upload_package_index() no longer keeps a PACKAGES.db.
It reuses the records of the slot's published PACKAGES.rds, as long as each tarball is still listed with the same ETag.
local/repair-built-stamp.R patched PACKAGES.db, so it would stop having any effect.

Changes

  • local/repair-built-stamp.R now patches Built in each slot's PACKAGES.rds and then re-emits the index.
    • Only the slot's own rows are patched: the generic slot's rows without a Path, or a per-minor slot's rows whose Path is its minor.
    • A missing stamp is not counted as broken, since bincraft clears it on purpose for source fallbacks.
    • With a bincraft release that still loads cranlike, the script patches PACKAGES.db as before, so merge order does not matter.
    • bincraft::built_stamp() was never exported, so the script failed at that line before this change; it now calls bincraft:::built_stamp().
  • The GITHUB_PAT comments in reindex, weekly-rebuild-reindex and backfill-flat-safety now give the current reason: bincraft reads DESCRIPTIONs from raw.githubusercontent.com.
  • The README section on index files describes upload_package_index() instead of the forks.

Testing

Tested against a moto S3 bucket, with bincraft installed from the bincraft#228 branch:

  • A slot was indexed, then 3 of its 5 Built stamps were set to R 4.5.0; NA; ....
  • The dry run reported 5 entries, 3 broken.
  • --apply rewrote the 3 stamps, and the re-emit logged Index records: 5 reused, 0 read, 0 unreadable.
  • The published PACKAGES then had a valid stamp on all 5 records.
  • With the released bincraft, which still loads cranlike, the script chose PACKAGES.db.

The stale PACKAGES.db objects in the slots can be deleted once a bincraft release with #228 is in use.

Follow-up to https://codefloe.com/rpkgs/bincraft/pulls/228 (bincraft#33), which drops the cranlike and desc forks. ## Why After that change, `upload_package_index()` no longer keeps a `PACKAGES.db`. It reuses the records of the slot's published `PACKAGES.rds`, as long as each tarball is still listed with the same ETag. `local/repair-built-stamp.R` patched `PACKAGES.db`, so it would stop having any effect. ## Changes - `local/repair-built-stamp.R` now patches `Built` in each slot's `PACKAGES.rds` and then re-emits the index. - Only the slot's own rows are patched: the generic slot's rows without a `Path`, or a per-minor slot's rows whose `Path` is its minor. - A missing stamp is not counted as broken, since bincraft clears it on purpose for source fallbacks. - With a bincraft release that still loads cranlike, the script patches `PACKAGES.db` as before, so merge order does not matter. - `bincraft::built_stamp()` was never exported, so the script failed at that line before this change; it now calls `bincraft:::built_stamp()`. - The `GITHUB_PAT` comments in `reindex`, `weekly-rebuild-reindex` and `backfill-flat-safety` now give the current reason: bincraft reads DESCRIPTIONs from raw.githubusercontent.com. - The README section on index files describes `upload_package_index()` instead of the forks. ## Testing Tested against a moto S3 bucket, with bincraft installed from the bincraft#228 branch: - A slot was indexed, then 3 of its 5 `Built` stamps were set to `R 4.5.0; NA; ...`. - The dry run reported 5 entries, 3 broken. - `--apply` rewrote the 3 stamps, and the re-emit logged `Index records: 5 reused, 0 read, 0 unreadable.` - The published `PACKAGES` then had a valid stamp on all 5 records. - With the released bincraft, which still loads cranlike, the script chose `PACKAGES.db`. The stale `PACKAGES.db` objects in the slots can be deleted once a bincraft release with #228 is in use.
bincraft#33 replaces the cranlike fork: upload_package_index() no longer
keeps a PACKAGES.db and reuses the records of the published PACKAGES.rds
instead, so patching the database stops having any effect.

- patch Built in each slot's PACKAGES.rds, limited to the slot's own rows,
  when the installed bincraft no longer loads cranlike
- keep patching PACKAGES.db for releases that still do
- call the internal built_stamp() with `:::`, it was never exported
- explain GITHUB_PAT by bincraft's DESCRIPTION reads from the CRAN mirror
- describe how upload_package_index() builds the index in the README
pat-s merged commit c61d951875 into main 2026-10-18 11:55:21 +00:00
pat-s deleted branch fix/repair-built-stamp-without-cranlike 2026-10-18 11:55:22 +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!236
No description provided.