fix(build): give the existence cache a per-minor view of the slot #191
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/s3-cache-per-minor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
A restarted run recompiled everything it had already built.
amd64/resolutehad uploaded roughly 3000 binaries before being restarted, and rebuilt all of them.Cause
This is a regression from #189, which I introduced.
s3_cache.rdsis derived from the samefile_namesthat #189 filtered:Removing per-minor objects from
file_nameswas right for the candidate list and wrong for the existence cache.build_binary_package()was handed a cache containing no per-minor object at all, so its "not present in the remote bucket" check answered not-present for every one of them.The two consumers need opposite views of one listing:
Conflating them was wrong in both directions: before #189 a per-minor pass believed the flat slot's binaries were its own and built nothing; after #189 it believed it had nothing and rebuilt the lot.
Change
The cache keeps paths relative to the slot, and
build-all.Rselects the part matching the pass it is running.build_binary_package()compares basenames and cannot distinguish4.4/curl_1.0.tar.gzfromcurl_1.0.tar.gz, so the choice has to be made where the running R minor is known.Verified:
curl_1.0,jsonlite_2.0,Archive/curl_0.9,PACKAGES.gz--sensitive-onlyunder 4.4curl_1.0,rlang_1.3.0(from4.4/only)--sensitive-onlyunder 4.6rlang_1.3.0(from4.6/only)Archive/counts as present for the primary pass: those are versions built and later superseded.Backwards compatibility
A cache written before this change holds bare basenames. Filtering those by path would select nothing and trigger the very rebuild this prevents, so they are detected and used unfiltered; #190's staleness check replaces them on the next pipeline.
Note on the running builds
The five pipelines currently running are recompiling packages they already have. Their output is still correct — the binaries carry the right
Builtstamp for their slot — but the work is wasted. They should be restarted once this is merged.