tests: resolve Alpine fixture versions from the live APKINDEX#113
Merged
Conversation
The fixture builder pinned an exact version for every Alpine package and
for the minirootfs tarball. Alpine's mirror keeps only the latest build
of each package, so a pinned version 404s as soon as a newer build lands
upstream -- forcing a manual version bump on every refresh just to keep
the test fixtures fetchable (linux-virt alone churned 6.12.85 -> .91 ->
.94 across recent weeks).
Resolve versions dynamically instead, staying within the bash 3.2 subset
the harness now targets (no associative arrays):
- PKGS becomes a plain "repo:name" list. resolve_versions() downloads
each repo's APKINDEX, flattens it to a cached "name version" table,
and fills PKG_RESOLVED with "repo:name:version" tuples -- the same
shape the staging loops and pkg_version already consume.
- resolve_minirootfs() picks the newest point release the releases
listing advertises and writes it back to ALPINE_PATCH so the x86_64
path reuses the same patch. ALPINE_PATCH still pins one when set.
- A versions.lock manifest records the resolved set; when it changes the
staged rootfs/kernel/initramfs (and x86_64 tree) are rebuilt so a
mirror bump actually takes effect instead of reusing stale apks.
- Both resolvers fall back to the cache when the mirror is unreachable,
preserving warm offline re-runs, and error cleanly when neither the
mirror nor a cache is available.
Verified on stock /bin/bash 3.2.57: cold build, warm idempotent re-run,
INCLUDE_X86_64=1, offline warm fallback, lockfile-driven rebuild, and the
offline+empty-cache error path.
bd1cd02 to
34bf78e
Compare
Contributor
|
Thank @Max042004 for contributing! |
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.
The fixture builder pinned an exact version for every Alpine package and for the minirootfs tarball. Alpine's mirror keeps only the latest build of each package, so a pinned version 404s as soon as a newer build lands upstream — forcing a manual version bump on every refresh just to keep the test fixtures fetchable.
Resolve versions dynamically instead:
Summary by cubic
Resolve Alpine test fixture versions from the live APKINDEX to prevent 404s from stale pins and remove manual bumps. Auto-pick the newest minirootfs and rebuild the staged tree when versions change, with offline cache fallback.
PKGSnow "repo:name";resolve_versionsreads live APKINDEX, caches "name version", and fillsPKG_RESOLVEDas "repo:name:version".resolve_minirootfsselects the newest release and writes it toALPINE_PATCH(still honors an explicit pin).versions.lockrecords packages + minirootfs; any diff setsREBUILD=1to rebuild the whole staged tree (including x86_64).Written for commit 34bf78e. Summary will update on new commits.