Repository navigation
Decode SRI checksums in Starlark so apk_import is reproducible - #423
Open
alexander-scott wants to merge 1 commit into
Open
alexander-scott wants to merge 1 commit into
alexander-scott wants to merge 1 commit into
Conversation
apk_import names the cached control and data segments after their checksums, which normalize_sri converted from SRI with `base64 -d | xxd -p | tr -d '\n'`. On a host without xxd that pipeline prints nothing and still exits 0, because its status is tr's, so the segments were written as `.ctl.tar.gz` and `.dat.tar.gz` instead of `<sha1>.ctl.tar.gz` and `<sha256>.dat.tar.gz`. The repository is marked reproducible, so whichever host populated the repo contents cache decided the names everyone else got, and every machine ended up with its own mix. The apko_image cache staging action and `apko build` take those files as inputs, so their action keys differed between machines building the same lockfile and rarely hit the remote cache. apko also only finds the expanded segments in its offline cache under the hashed names; with empty names it falls back to the concatenated .apk. Decode the base64 in Starlark instead, and bump RULES_APKO_CACHE_KEY so cached repositories with the empty names are refetched.
alexander-scott
marked this pull request as ready for review
November 9, 2026 04:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
apk_import names the cached control and data segments after their checksums, which normalize_sri converted from SRI with
base64 -d | xxd -p | tr -d '\n'. On a host without xxd that pipeline prints nothing and still exits 0, because its status is tr's, so the segments were written as.ctl.tar.gzand.dat.tar.gzinstead of<sha1>.ctl.tar.gzand<sha256>.dat.tar.gz.The repository is marked reproducible, so whichever host populated the repo contents cache decided the names everyone else got, and every machine ended up with its own mix. The apko_image cache staging action and
apko buildtake those files as inputs, so their action keys differed between machines building the same lockfile and rarely hit the remote cache. apko also only finds the expanded segments in its offline cache under the hashed names; with empty names it falls back to the concatenated .apk.Decode the base64 in Starlark instead, and bump RULES_APKO_CACHE_KEY so cached repositories with the empty names are refetched.