Repository navigation
build-packages: drop a stale cached package after a same-version rebuild - #875
Conversation
A forced rebuild can replace a package's bytes without changing its file name. The pacman cache that tools/build-packages and tools/build-rootfs share ($ALARM_CACHE/pkg, mounted as /var/cache/pacman/pkg) still holds the old file under that name, so the next pacstrap takes the cached copy, whose checksum no longer matches the rebuilt repository's database. add_to_repo now removes a cached file of the same name, and its detached signature, when its bytes differ from the package just added; identical cache entries and other packages are left alone. tests/build-packages-cache runs the real add_to_repo with synthetic package files: a differing cache entry and its signature are removed, an identical one is kept with its signature, an unrelated package is kept, and a local import keeps the signature it came with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you, @kdegeek. The bug is real: the cache on my laptop holds our own packages with their signatures under exactly these names, so a Two small things in the tests before I merge:
I'll approve the CI run now; with those two in and the run green this goes in. |
derekross
left a comment
There was a problem hiding this comment.
CI ran on this head and both jobs pass, your new suite among them (and shellcheck, which I didn't have locally).
The two test changes from this morning are still open, and both are small, so I'll push them to your branch myself rather than hold this: the suite's line moves to the one-per-line block at the end of tests/all (your branch now conflicts there with #900 as well), and tests/pinned-packages and tests/local-builds get export ALARM_CACHE=$t/cache. I ran all three suites with those changes on your branch merged with today's main and they pass. I'll merge when CI is green on that push. If you'd rather make them yourself, say so and I'll wait.
…oper's package cache tests/build-packages-cache moves to the one-suite-per-line block at the end of tests/all, and tests/local-builds and tests/pinned-packages set ALARM_CACHE to their scratch folder, since add_to_repo now removes from the cache. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
What and why
A forced rebuild can replace a package's bytes and keep its file name.
tools/build-packagesandtools/build-rootfsshare one pacman cache ($ALARM_CACHE/pkg, mounted as/var/cache/pacman/pkg). That cache still holds the old file under the same name, so the next pacstrap takes the cached copy, and its checksum no longer matches the rebuilt repository's database.add_to_reponow removes a cached file of the same name, with its detached signature, when its bytes differ from the package just added. Identical cache entries and other packages are left alone.Device and build
Checks (no phone needed)
tools/pr-check upstream/mainpassestests/build-packages-cache(new, added totests/all): passes, and it fails (an assertion) against main'stools/build-packages. It runs the realadd_to_repoon synthetic package files. A differing cache entry and its signature are removed, an identical one is kept with its signature, an unrelated package is kept, and a local import keeps the signature it came with.bash -nandshellcheck -S warningon the touched scripts: no new warnings against maintests/all: not run, only the new test and the touched scripts' checks aboveOn the phone
Nothing here runs on a phone.
🤖 Generated with Claude Code