fix(install): check for unzip and a C compiler up front (gh#755) - #756
Open
vsbuffalo wants to merge 1 commit into
Open
fix(install): check for unzip and a C compiler up front (gh#755)#756vsbuffalo wants to merge 1 commit into
vsbuffalo wants to merge 1 commit into
Conversation
`install-e2e` has failed on every run since it was added — 65 runs, 0 successes, back to 2026-06-23 — each in ~45s, far too fast for the from-source build it claims to exercise. The cause is a preflight gap, not the sandbox. `ensure_base_tools` checked only make/git/curl/tar. opam REFUSES to init without `unzip`, and the OCaml switch is compiled from source so it needs a C compiler; neither was checked, and neither is in the test image. opam's own "Missing dependencies -- unzip" then fell into install.sh's catch-all `opam init` failure branch, which prints a bubblewrap / user-namespace hint. So the job — and any real user on a minimal box — was told to go fix an unprivileged-namespace problem that did not exist. Check both in `ensure_base_tools`, so the failure is named where it happens, and add them to the image as the "an admin provisioned the box" prerequisites they are. Also move the install out of the image build into `docker run`. That is a genuine second wall, just not the one that was being hit: `opam init` sandboxes with bubblewrap, which needs an unprivileged user namespace, and `docker build` cannot grant one (buildkit gates it behind an `insecure` entitlement needing a custom builder). Verified directly — bwrap fails in a RUN layer, fails under `docker run` with Docker's defaults, and succeeds under `docker run --security-opt seccomp=unconfined --security-opt apparmor=unconfined`. That relaxes the CONTAINER's confinement, not the install's: no sudo in the image, still a non-root `builder` user, so the claim the job makes — install.sh needs zero privilege — is unchanged and still enforced. Deliberately not `NO_SANDBOX=1`: that would go green by deleting exactly what the job verifies. Because the job has never passed, nothing downstream of `opam init` has ever run — the portable-CMake fetch, the opam prebuilt-binary path and the glibc-2.27 build remain unverified until it is green.
vsbuffalo
force-pushed
the
fix/install-e2e-bwrap-userns
branch
from
August 26, 2026 18:25
c269d73 to
cae5666
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #755.
install-e2ehad never passed — 65 runs, 0 successes, since it was added on 2026-06-23. This branch is the first green run: https://github.com/vsbuffalo/camdl/actions/runs/32994432454Cause: a preflight gap, reported as the wrong problem
ensure_base_toolschecked onlymake git curl tar. But opam refuses to init withoutunzip, and the OCaml switch is compiled from source so it needs a C compiler. Neither was checked, and neither was in the test image:install.sh funnels any
opam initfailure into a catch-all that prints "bubblewrap isn't installed, or your kernel doesn't allow unprivileged user namespaces". bubblewrap was installed and namespaces were not the problem — so the job, and any real user on a minimal box, was sent to debug a nonexistent problem. That misdirection is the substantive half of the bug; it cost me a wrong diagnosis on first read of these logs.Second, real wall behind it
Once
unzipis present,opam initreaches its sandbox check, and that genuinely cannot work in adocker buildRUN layer. Verified directly with a minimal image:docker buildRUN layerNo permissions to create new namespacedocker run, Docker defaultsNo permissions to create new namespacedocker run --security-opt seccomp=unconfined --security-opt apparmor=unconfinedSo the install moves out of the image build into
docker run(tests/install/run.sh, also the local repro).That relaxes the container's confinement, not the install's: the image still has no sudo and still runs as the non-root
builderuser, so the claim the job makes — install.sh needs zero privilege — is unchanged and still enforced. What it buys is that opam's sandbox is genuinely active, which is what real users get.Deliberately not
NO_SANDBOX=1: that would turn the job green by deleting exactly what it verifies.Worth knowing
Because this job had never passed, nothing downstream of
opam inithad ever run. This green run is the first time the portable-CMake fetch, the opam prebuilt-binary path, and the glibc-2.27 from-source build have actually been exercised.