CI: resolve the ghcr .deb bundle against its own apt index - #11408
Open
julek-wolfssl wants to merge 2 commits into
Open
CI: resolve the ghcr .deb bundle against its own apt index#11408julek-wolfssl wants to merge 2 commits into
julek-wolfssl wants to merge 2 commits into
Conversation
The bundle was resolved on master right after apt-get update, against the live archive; consumers resolved against the apt lists frozen into the runner image days earlier. Any version published in between made --no-download ask for a .deb the bundle did not carry, and the all-or-nothing install sent the whole set to the mirror. 25% of PR jobs took that path, and in 16 of 20 sampled cases the mirror then supplied zero bytes - the bundle was complete, only the index disagreed. ci-deps-image now ships a dpkg-scanpackages index in each bundle and install-apt-deps resolves against only that, as a local file:// repository with its own lists dir. Producer and consumer agree by construction, so only a package genuinely absent from the bundle falls back. Also: - rebuild the static bundles daily and on a merged package-list change, instead of weekly - pq-all gets its own -cross bundle; crossbuild-essential-* were in no 24.04 list, so it fetched 118 MB from the mirror on every run - ccache-setup installs from the repository install-apt-deps exported, rather than from debs staged in /var/cache/apt/archives - check-ci-deps.py fails a PR whose install-apt-deps call names a package its bundle does not carry, a tag that does not exist, or a tag for the wrong Ubuntu release; wired into check-source-text - ci-deps-canary asserts the same contract dynamically after every rebuild, with require-bundle turning a fallback into an error - whitebox-smoke used a bare apt-get; it now uses the bundle
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
check-ci-deps.py --matrix currently exits successfully even after emitting ::error findings, which can let ci-deps-canary proceed/appear successful despite static contract violations.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR hardens the CI “apt .deb bundle” mechanism by making dependency resolution deterministic: workflows now resolve against the bundle’s own apt Packages index (served as a local file: repo with isolated lists), avoiding version drift between producer and consumer and reducing fallback to flaky mirrors.
Changes:
- Build and publish bundle-local apt indexes (
Packages/Packages.gz), rebuild static bundles daily and on merged package-list changes, and add a dedicatedubuntu-24.04-crossbundle for pq-all. - Update
install-apt-depsto resolve against only the bundle index (with arequire-bundleoption) and haveccache-setupinstall from the exported local bundle repo. - Add
check-ci-deps.py(static contract checker) andci-deps-canary.yml(dynamic contract checker), and wire the static check intocheck-source-text.
File summaries
| File | Description |
|---|---|
| .github/workflows/whitebox-smoke.yml | Switch build deps installation to install-apt-deps using the 24.04 bundle. |
| .github/workflows/pq-all.yml | Point pq-all at the new ubuntu-24.04-cross bundle and update related comments. |
| .github/workflows/ci-deps-image.yml | Add bundle indexing, rebuild triggers (daily + on package-list changes), and add the ubuntu-24.04-cross build to the matrix. |
| .github/workflows/ci-deps-canary.yml | New workflow to assert bundle/workflow contract dynamically after rebuilds and daily. |
| .github/workflows/check-source-text.yml | Run the new bundle contract checker in CI for every PR. |
| .github/scripts/check-ci-deps.py | New static validator ensuring workflow requests match bundle tags, Ubuntu series, and package lists. |
| .github/ci-deps/packages-ubuntu-24.04-cross.txt | New package list defining the cross-toolchain bundle contents. |
| .github/actions/install-apt-deps/action.yml | Resolve installs against the bundle’s own apt index via a local file: repo; add require-bundle to hard-fail on fallback. |
| .github/actions/ccache-setup/action.yml | Install ccache from the local bundle repo exported by install-apt-deps when available. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+364
to
+366
| if matrix: | ||
| emit_matrix(checker) | ||
| return 0 |
|
Static contract violations printed ::error but exited 0, so ci-deps-canary could not fail on them. Those modes also hand stdout to their caller as data, so findings went to stderr and would have corrupted it. Route findings to stderr in the two data modes, return non-zero when any were found, and read --sets output from a file in the canary so the exit status is not swallowed by process substitution.
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 .deb bundle was previously resolved against the live apt archive at
publish time, while consumers resolved against apt lists frozen into the
runner image days earlier. Version drift in between made
--no-downloadask for packages the bundle didn't carry, triggering an all-or-nothing
fallback to the mirror — hit by ~25% of PR jobs, and in 16/20 sampled
cases the mirror served zero bytes even though the bundle was complete.
ci-deps-image now ships a
dpkg-scanpackagesindex with each bundle, andinstall-apt-deps resolves against only that index as a local
file://repository with its own lists dir, so producer and consumer agree by
construction and only genuinely missing packages fall back to the mirror.
Also:
-crossbundle, sincecrossbuild-essential-*wasn't in any 24.04 list and was fetching 118 MB from the mirror on every run/var/cache/apt/archives