Skip to content

fix(install): user-native, no-sudo toolchain install (gh#205)#281

Merged
vsbuffalo merged 1 commit into
mainfrom
worktree-installer
Jun 22, 2026
Merged

fix(install): user-native, no-sudo toolchain install (gh#205)#281
vsbuffalo merged 1 commit into
mainfrom
worktree-installer

Conversation

@vsbuffalo

Copy link
Copy Markdown
Owner

Problem

install.sh 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 (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:

  • opam — official prebuilt binary via the upstream installer's --download-only, placed in $PREFIX/bin. Everything downstream (opam init, the OCaml switch compile) is already user-native under ~/.opam.
  • CMake — the vendored nlopt 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 (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's 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 dedicated install-script workflow (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-only asset 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

@vsbuffalo
vsbuffalo force-pushed the worktree-installer branch from 6c1789d to cf1ba36 Compare June 22, 2026 17:13
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
vsbuffalo force-pushed the worktree-installer branch from cf1ba36 to 4a133f1 Compare June 22, 2026 17:38
@vsbuffalo
vsbuffalo merged commit 082ae55 into main Jun 22, 2026
2 checks passed
@vsbuffalo
vsbuffalo deleted the worktree-installer branch June 27, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant