fix(install): user-native, no-sudo toolchain install (gh#205)#281
Merged
Conversation
vsbuffalo
force-pushed
the
worktree-installer
branch
from
June 22, 2026 17:13
6c1789d to
cf1ba36
Compare
The install script used the system package manager (apt/dnf/yum/pacman/ zypper, Homebrew on macOS) and sudo to install opam and base tools. That breaks on no-sudo machines — HPC login nodes, locked-down boxes, older distros — which is exactly camdl's target environment. The official no-sudo opam path was already in the script but unreachable: a package manager is always detected on a real distro, so the upstream-installer fallback never fired. Gut the package-manager path; install everything user-native: - opam: official prebuilt binary via the upstream installer's --download-only, placed in $PREFIX/bin. No sudo. Everything downstream (opam init, the OCaml switch compile) is already user-native under ~/.opam. - CMake: nlopt's C build needs >= 3.13; when the system cmake is missing or too old (Ubuntu 18.04 ships 3.10) fetch a portable Kitware build into $PREFIX. Closes the one true blocker from the gh#205 report. - base tools (make/git/curl/tar): check only, never install — print the one-time command and stop rather than escalating. Dropped python3: it is used only by bench/dev Makefile targets, never build/install. - rustup unchanged (already user-native). - final notes print the PATH + cargo-env + opam-env rc lines so a non-interactive `ssh host 'camdl ...'` finds everything. Tests (the installer had zero CI coverage — that is how the sudo path shipped): - tests/install_sh_test.sh: offline unit tests for version_ge, the cmake>=3.13 gate, cmake_plat, and the no-sudo contract (a sudo shim aborts if any ensure_* reaches for root). 12/12 green; wired into `make test` via a new test-install target and a fast ci.yml job (shellcheck + unit tests). - tests/install/Dockerfile.ubuntu1804 + install-e2e.yml: end-to-end no-sudo build on gh#205's exact box (glibc 2.27, cmake 3.10), as a non-root user with no sudo in the image. Nightly + workflow_dispatch. Pinned the opam --download-only asset naming against the live release (opam-2.5.1-arm64-macos) before relying on the glob. Reported-by: Daniel Klein (@daniel-klein)
vsbuffalo
force-pushed
the
worktree-installer
branch
from
June 22, 2026 17:38
cf1ba36 to
4a133f1
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.
Problem
install.shused the system package manager (apt/dnf/yum/pacman/zypper, Homebrew on macOS) andsudoto install opam and base tools. That breaks on no-sudo machines — HPC login nodes, locked-down boxes, older distros — which is exactly camdl's target environment (gh#205). The official no-sudo opam path was already in the script but unreachable: a package manager is always detected on a real distro, so the upstream-installer fallback never fired.Change
Gut the package-manager path; install everything user-native, never calling
sudo:--download-only, placed in$PREFIX/bin. Everything downstream (opam init, the OCaml switch compile) is already user-native under~/.opam.nloptC build needs ≥ 3.13; when the system cmake is missing or too old (Ubuntu 18.04 ships 3.10) fetch a portable Kitware build into$PREFIX. Closes the one true blocker from the gh#205 report.make/git/curl/tar) — check only, never install; print the one-time command and stop rather than escalating. Droppedpython3(used only by bench/dev Makefile targets, neverbuild/install).PATH+ cargo-env + opam-env rc lines so a non-interactivessh host 'camdl ...'finds everything.Tests
The installer had zero CI coverage — that's how the sudo path shipped.
tests/install_sh_test.sh— offline unit tests forversion_ge, the cmake≥3.13 gate,cmake_plat, and the no-sudo contract (asudoshim aborts if anyensure_*reaches for root). 12/12 green. Wired intomake testvia a newtest-installtarget and a dedicatedinstall-scriptworkflow (shellcheck + unit tests, path-filtered to installer files).tests/install/Dockerfile.ubuntu1804+install-e2e.yml— end-to-end no-sudo build on gh#205's exact box (glibc 2.27, cmake 3.10), as a non-root user with no sudo in the image. Nightly +workflow_dispatch.Pinned the opam
--download-onlyasset naming against the live release (opam-2.5.1-arm64-macos) before relying on the glob.Addresses gh#205 (reported by @daniel-klein).
https://claude.ai/code/session_01Ln6Gn3Su5rePNfvAwLQHxU