Skip to content

Commit 4b34541

Browse files
committed
[ci] Refresh the apt lists only when an install fails.
The Linux dependency step installs against the runner image's package lists, which are baked in when the image is built. Once the archive supersedes a package and drops the old .deb, the resolve 404s and the row dies before it builds anything: valgrind depends on libc6-dbg, whose 2.39-0ubuntu8.7 build stopped being fetchable, and the vg row went red. Running `apt-get update` at the top of the step would fix it by making every Linux row on every run pay for a refresh that matters a few times a year. Install against the image's lists first and refresh only if that fails, which is the shape the clang install below already uses. Both installs in the step go through one helper, so the best-effort libomp one is covered too, and apt-get in place of apt drops the "apt does not have a stable CLI interface" warning each row printed.
1 parent d0e1e2d commit 4b34541

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,23 @@ jobs:
210210
# from catthehacker/ubuntu:act-24.04; install it so bin/repro works.
211211
# The debug row needs it too (to build clad), so this step must not
212212
# be gated on debug_build.
213-
sudo apt install -y cmake ${{ matrix.extra_packages }}
213+
#
214+
# Install against the image's package lists and refresh them only if
215+
# that fails. They go stale just when the archive supersedes a
216+
# dependency and drops the old .deb -- valgrind pulls libc6-dbg,
217+
# whose 2.39-0ubuntu8.7 build stopped being fetchable -- so an
218+
# unconditional update would cost every Linux row on every run to
219+
# cover a rare event. Same shape as the clang install below.
220+
apt_install() {
221+
sudo apt-get install -y "$@" \
222+
|| { sudo apt-get update && sudo apt-get install -y "$@"; }
223+
}
224+
apt_install cmake ${{ matrix.extra_packages }}
214225
# libomp-N-dev: best-effort. apt-llvm.org lags on the latest
215226
# major; recipe-flavor rows get libomp from the recipe build,
216227
# not apt. When missing, OpenMP lit tests skip via REQUIRES.
217228
if apt-cache show "libomp-${{ matrix.clang-runtime }}-dev" >/dev/null 2>&1; then
218-
sudo apt install -y "libomp-${{ matrix.clang-runtime }}-dev"
229+
apt_install "libomp-${{ matrix.clang-runtime }}-dev"
219230
fi
220231
221232
- name: Setup compiler on Linux

0 commit comments

Comments
 (0)