fix(ci): refresh the apt index before uvr installs system dependencies #161

Merged
pat-s merged 1 commit from t3code/fix-ubuntu-glpk-dependency into main 2026-08-10 06:30:25 +00:00

View file

@ -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