ci: install gcc on the openSUSE runner so cargo can link #396
Loading…
Reference in a new issue
No description provided.
Delete branch "ci/fix-cc-linker-gcc"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The Check job fails at
error: linker cc not foundwhile compiling the first build script, before it ever reaches clippy/build/tests. The sharedRUNS_ON_OPENSUSE_BASE_LATESTrunner image stopped shipping a C compiler, and rustc drives linking throughcc. This is the same runner-image regression that broke mokosh-apps CI (fixed there in #446).Fix
Add an "Ensure C toolchain" step before the cargo steps that runs
sudo zypper --non-interactive install --no-recommends gcc. Thegccpackage provides/usr/bin/cc. The runner user is unprivileged, so a barezypper installfails withRoot privileges are required to run this command(exit 5); sudo is required and is passwordless on the runner.Scope
Only
check.ymlcompiles on the host.build-api.yml/build-web.ymlcompile insidedocker buildx(their own toolchain), ande2e.yml/create-release.ymldo not run host cargo builds, so none of them need this. The durable fix is restoring the toolchain in the base runner image itself (niceguyit infra); this unblocks CI in the meantime.Verification
The identical change was verified green on mokosh-apps: the bare-zypper attempt failed with the root-privileges error, and the sudo version passed the toolchain step and let fmt/clippy/tests run.
The e2e job's bundled Chromium aborts at launch with `libgobject-2.0.so.0: cannot open shared object file`: the RUNS_ON_OPENSUSE_BASE_LATEST image was trimmed of the X / GTK / NSS / glib shared libraries it links. This is the exact case the "Install Playwright browser" step's comment anticipated ("if a future image trims them, add a zypper install step for the missing sonames"). Add a step that installs the openSUSE resolution of Chromium's soname dependency set (nss/nspr, glib, atk/at-spi, cups, dbus, drm, gbm, xcb/xkbcommon, the X11 libs, pango/cairo, alsa, gtk3) via sudo zypper. Package names were resolved against openSUSE by soname, not guessed. Same trimmed-base-image root cause as the gcc/openssl additions to check.yml; the durable fix is restoring these in the base image. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CEnKozf9UzwgoT1RUELYpbUpdate: the runner-image trim turned out to be broader than just
cc, so this PR grew to restore three sets of dropped native libraries. Both CI workflows are now green on the latest commit (b41a5a6):gcc(linkercc) +libopenssl-devel(openssl-sysvia reqwest/native-tls couldn't findopenssl.pc).libgobject-2.0.so.0; added the openSUSE resolution of Chromium's soname dependency set (nss/nspr, glib, atk/at-spi, cups, dbus, drm, gbm, xcb/xkbcommon, the X11 libs, pango/cairo, alsa, gtk3). Package names were resolved by soname against openSUSE, not guessed.All three are the same root cause: the
RUNS_ON_OPENSUSE_BASE_LATESTimage was rebuilt without libraries the jobs relied on being preinstalled. These per-reposudo zypper installsteps are a stopgap; the durable fix is restoring the libraries in the base runner image itself.