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
Owner

Unblocks the ubuntu 26.04 builds without waiting for an image rebuild.

What broke

i Installing R package dependencies
! Error in installing dependencies for package huge with tag 2.0.1:
  uvr sync --install-system-deps --library /mnt/cache/R-pkgs-4.4 failed (exit 1)

 ! WARN  Missing system dependencies for 1 package(s)
  igraph needs: libglpk-dev
> Running: apt-get install -y libglpk-dev
E: Unable to locate package libglpk-dev

Neither the package name nor the sysreq mapping is wrong. libglpk-dev is 5.0-2build1 in universe, which ubuntu:resolute enables by default. What is missing is the apt index: uvr v0.4.5 runs apt-get install with no apt-get update before it, and every ubuntu build image ends its apt layers with rm -rf /var/lib/apt/lists/*, so the shipped image has no index at all.

Not specific to 26.04 — jammy and noble fail identically for any sysreq the image's preinstall line doesn't already cover. 26.04 surfaced it first, through igraph and everything depending on it (huge was the first to fail).

Fix

apt-get update before the sync in local/uvr-install.sh.

That one site covers every pipeline: build-all-versions, build-all-versions-install-deps, weekly-rebuild-missing, weekly-audit-missing, trial-build-registry, auto-apply-patches and weekly-patch-proposals all reach it, either directly or through install-bincraft.R. The index it populates persists for the rest of the step, so the bincraft-driven uvr sync calls that follow are covered too.

Guarded on apt-get and non-fatal: apk add fetches its index implicitly and dnf refreshes expired metadata on its own, so alpine and redhat are unaffected and skip it.

Why here as well as in the image

The real fix is upstream e491b2e, which refreshes the index before the auto-install. It landed one day after v0.4.5 was tagged, so no release carries it (nbafrank/uvr#250); build-env-images#23 pins the ubuntu image to a commit that has it.

That only reaches CI after an image rebuild is triggered. This change takes effect on the next pipeline run. It also stays useful afterwards: a baked index goes stale within weeks, and a stale index turns the same install into a 404 on the .deb.

Verified

In ubuntu:resolute, with the image state reproduced exactly (R installed, then rm -rf /var/lib/apt/lists/* to empty the index again):

Check Result
apt-get install -y libglpk-dev, empty index E: Unable to locate package libglpk-dev — the reported failure, reproduced
Same container after apt-get update Candidate: 5.0-2build1, Components: main universe restricted multiverse
igraph + UVR_INSTALL_SYSREQS=1 uvr sync, empty index, uvr with the refresh Setting up libglpk-dev:amd64 (5.0-2build1), System dependencies installed., Installed 11 package(s)
sh -n and shellcheck local/uvr-install.sh pass

Reverting

Delete the guarded block. It is marked TEMPORARY with the upstream reference, and can go once the images ship a uvr above v0.4.5.

Unblocks the ubuntu 26.04 builds without waiting for an image rebuild. ## What broke ``` i Installing R package dependencies ! Error in installing dependencies for package huge with tag 2.0.1: uvr sync --install-system-deps --library /mnt/cache/R-pkgs-4.4 failed (exit 1) ! WARN Missing system dependencies for 1 package(s) igraph needs: libglpk-dev > Running: apt-get install -y libglpk-dev E: Unable to locate package libglpk-dev ``` Neither the package name nor the sysreq mapping is wrong. `libglpk-dev` is `5.0-2build1` in `universe`, which `ubuntu:resolute` enables by default. What is missing is the apt index: uvr v0.4.5 runs `apt-get install` with no `apt-get update` before it, and every ubuntu build image ends its apt layers with `rm -rf /var/lib/apt/lists/*`, so the shipped image has no index at all. Not specific to 26.04 — jammy and noble fail identically for any sysreq the image's preinstall line doesn't already cover. 26.04 surfaced it first, through `igraph` and everything depending on it (`huge` was the first to fail). ## Fix `apt-get update` before the sync in `local/uvr-install.sh`. That one site covers every pipeline: `build-all-versions`, `build-all-versions-install-deps`, `weekly-rebuild-missing`, `weekly-audit-missing`, `trial-build-registry`, `auto-apply-patches` and `weekly-patch-proposals` all reach it, either directly or through `install-bincraft.R`. The index it populates persists for the rest of the step, so the bincraft-driven `uvr sync` calls that follow are covered too. Guarded on `apt-get` and non-fatal: `apk add` fetches its index implicitly and dnf refreshes expired metadata on its own, so alpine and redhat are unaffected and skip it. ## Why here as well as in the image The real fix is upstream `e491b2e`, which refreshes the index before the auto-install. It landed one day after v0.4.5 was tagged, so no release carries it ([nbafrank/uvr#250](https://github.com/nbafrank/uvr/issues/250)); [build-env-images#23](https://codefloe.com/rpkgs/build-env-images/pulls/23) pins the ubuntu image to a commit that has it. That only reaches CI after an image rebuild is triggered. This change takes effect on the next pipeline run. It also stays useful afterwards: a baked index goes stale within weeks, and a stale index turns the same install into a 404 on the `.deb`. ## Verified In `ubuntu:resolute`, with the image state reproduced exactly (R installed, then `rm -rf /var/lib/apt/lists/*` to empty the index again): | Check | Result | |---|---| | `apt-get install -y libglpk-dev`, empty index | `E: Unable to locate package libglpk-dev` — the reported failure, reproduced | | Same container after `apt-get update` | `Candidate: 5.0-2build1`, `Components: main universe restricted multiverse` | | `igraph` + `UVR_INSTALL_SYSREQS=1 uvr sync`, empty index, uvr with the refresh | `Setting up libglpk-dev:amd64 (5.0-2build1)`, `System dependencies installed.`, `Installed 11 package(s)` | | `sh -n` and `shellcheck local/uvr-install.sh` | pass | ## Reverting Delete the guarded block. It is marked TEMPORARY with the upstream reference, and can go once the images ship a uvr above v0.4.5.
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.
pat-s merged commit 6372f0f928 into main 2026-08-10 06:30:25 +00:00
pat-s deleted branch t3code/fix-ubuntu-glpk-dependency 2026-08-10 06:30:26 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
devxy/build-cran-binaries!161
No description provided.