Skip to content

ci: guard the Linux .deb archive copy against an empty apt cache - #3939

Merged
thymikee merged 1 commit into
mainfrom
ci/linux-deps-cache-guard
Oct 24, 2026
Merged

thymikee merged 1 commit into
mainfrom
ci/linux-deps-cache-guard

Conversation

@thymikee

@thymikee thymikee commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to the non-blocking review notes on #3919. One file: .github/workflows/linux.yml. No linked issue: #3918 was auto-linked there but is an unrelated iPad fix, and the timeout reports were never filed.

The final cp /var/cache/apt/archives/*.deb ~/apt-archives/ runs under set -euo pipefail. An unmatched glob stays literal, so the cp fails the step when the archives dir holds no .deb — as it would when a future runner image already ships every package. compgen -G now skips the copy there; a real cp failure still fails the step.

Cache question: kept. Would --no-install-recommends plus the bound alone be simpler? The first push of #3919 was exactly that, and it failed after 3 bounded attempts while the mirror was slow: an 11 MB package could not download inside the deadline. The cache is why most runs never ask the mirror (13–14 s on a hit). A single actions/cache would save a partial archive after a failed install, so the restore/save pair stays unchanged.

Validation

Base a9fc9a1, tested SHA e40b6da.

  • pnpm check:affected --run --head e40b6da09c: exit 0, exactCommit: true.
  • Guard exercised under bash -eo pipefail in a scratch dir: unguarded cp *.deb on an empty dir exits 1; the guarded form skips and still copies when files exist.
  • CI: Linux Smoke Tests at this head, install step green on a cache miss and on a rerun cache hit.

Risk: none beyond #3919; the guard only removes a failure mode.

🤖 Generated with Claude Code

An unmatched glob stays literal, so cp fails under set -e when
/var/cache/apt/archives holds no .deb. That happens when the runner
image already ships every package and nothing is downloaded. Guard the
copy with compgen so the step skips it instead of failing.
@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.58 MB 5.58 MB 0 B
Package (unpacked) 5.58 MB 5.58 MB 0 B
Package (download) 1.69 MB 1.69 MB -1 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 41.3 ms 40.7 ms -0.6 ms
CLI --help 81.5 ms 82.8 ms +1.3 ms

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at e40b6da. All 16 checks pass, and the Linux smoke job exercises the changed install step. There are no conflicts. I did not rerun the scratch-dir bash test, and I did not confirm from CI logs that the empty-glob path was reached, because it is a defensive branch that cannot fire on current runner images. Not blocking, and you can take or leave these: the comment at .github/workflows/linux.yml#L132 would be clearer as "An unmatched glob stays literal and fails cp under set -e when the runner image already has every package.", and when the guard skips, the save step may store an empty cache entry at .github/workflows/linux.yml#L138, which is harmless because apt downloads the packages again.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 24, 2026
@thymikee
thymikee merged commit 610c27a into main Oct 24, 2026
17 checks passed
@thymikee
thymikee deleted the ci/linux-deps-cache-guard branch October 24, 2026 17:41
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-24 17:41 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant