Skip to content

ci: install valgrind from a package cache or the runner's mirror - #346

Closed
kvlonge wants to merge 2 commits into
mainfrom
ci/valgrind-install-fallback
Closed

kvlonge wants to merge 2 commits into
mainfrom
ci/valgrind-install-fallback

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Why

The checks job installs valgrind for the instruction-count guard. The step rewrote the runner's apt sources to archive.ubuntu.com and used nothing else. During an outage on the runners' path to that archive, every pull request failed at this step before any check ran, and re-running did not help.

Changes

  • The packages valgrind needs are kept in an Actions cache, keyed on the runner image (ImageOS, ImageVersion) and the valgrind version. Noble publishes one version, 1:3.22.0-0ubuntu3, which is now pinned. The image is part of the key because libc6-dbg must match the image's libc6.
  • The install order is now: a valgrind the image already has; the cached packages, which need no network; then the runner's default mirror, left as configured; then archive.ubuntu.com. Each network source downloads the packages to the cache directory and installs them with dpkg -i, the same command a cache hit uses.
  • The step logs valgrind source: ... with the source it used. When nothing works, it fails with infrastructure: could not install valgrind .... The instruction-count guard still always runs and still fails when valgrind is missing.
  • A run that missed the cache saves the packages. The nightly run on main saves them for pull requests to restore.

Verification

  • actionlint 1.7.7, with shellcheck, reports nothing.
  • The step's script, run on a Debian machine against Debian's valgrind:
    • Cold cache: installs from the default mirror and leaves the .deb files to cache.
    • Warm cache with apt's network blocked by an unreachable proxy: installs in 0.75 s.
    • No cache and no network: exits 1 with the infrastructure error.
  • This pull request's own CI run: the step log shows which source it used.

The valgrind step sent apt only to archive.ubuntu.com, so an outage on the
runners' path to it failed every pull request before any check ran. The step
now installs from cached packages, keyed on the runner image and the valgrind
version, then from the runner's default mirror, then from archive.ubuntu.com,
and fails with an infrastructure error naming all three when none works.
A download cut short by an outage leaves apt's root-owned partial directory,
so the next source now clears it with sudo. A valgrind the runner image already
has is used as is. The pinned version is set once, for the whole job.

kvlonge commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #345, which fixes the same valgrind install failure.

@kvlonge kvlonge closed this Nov 30, 2026
@kvlonge
kvlonge deleted the ci/valgrind-install-fallback branch November 30, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant