From c3004db22af7ea4c561c2c4121804773adcd613b Mon Sep 17 00:00:00 2001 From: pat-s Date: Mon, 10 Aug 2026 06:26:23 +0000 Subject: [PATCH] fix(ci): refresh the apt index before uvr installs system dependencies uvr v0.4.5 runs `apt-get install` for every resolved system dependency without refreshing the package index first, and the ubuntu build images end their apt layers with `rm -rf /var/lib/apt/lists/*`. With no index apt cannot resolve a package that exists and is enabled, so `igraph needs: libglpk-dev` fails with `E: Unable to locate package libglpk-dev` on ubuntu 26.04, taking every package depending on igraph with it. Refresh in `uvr-install.sh` rather than per pipeline: every build pipeline reaches it, directly or through `install-bincraft.R`, and the index it populates persists for the bincraft-driven syncs later in the same step. Guard on apt-get and keep it non-fatal. `apk add` fetches its index implicitly and dnf refreshes expired metadata on its own, so alpine and redhat need nothing here. Stopgap: build-env-images#23 fixes this in the image, but only reaches CI once an image rebuild is triggered. --- local/uvr-install.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/local/uvr-install.sh b/local/uvr-install.sh index 14b7f78..c5d37d3 100755 --- a/local/uvr-install.sh +++ b/local/uvr-install.sh @@ -87,4 +87,23 @@ cd "$project_dir" # --no-install: resolve and lock only. The install happens in the sync below, # which is the only command that honours --library. "$uvr_bin" add --no-install "$@" + +# TEMPORARY (drop once the images ship a uvr above v0.4.5): the sync below runs +# `apt-get install` for every resolved system dependency without refreshing the +# index first, and the ubuntu build images end their apt layers with +# `rm -rf /var/lib/apt/lists/*`. With no index apt cannot resolve a package that +# exists and is enabled, so `igraph needs: libglpk-dev` fails the whole build +# with `E: Unable to locate package libglpk-dev` on ubuntu 26.04. +# +# Fixed upstream in `e491b2e`, tagged one day after v0.4.5 (nbafrank/uvr#250), +# and the images pick it up via build-env-images#23 — but only after an image +# rebuild is triggered, which is why this runs here too. +# +# apt only: `apk add` fetches its index implicitly and dnf refreshes expired +# metadata on its own. Non-fatal, since a refresh failure still leaves whatever +# index is already there, and the install's own error is the more actionable one. +if command -v apt-get >/dev/null 2>&1; then + apt-get update -qq || echo "warning: apt-get update failed; continuing" >&2 +fi + "$uvr_bin" sync --library "$target_lib" --install-system-deps -- 2.54.0