fix(install): fail fast on missing binutils at preflight (#4415)#4491
fix(install): fail fast on missing binutils at preflight (#4415)#4491latenighthackathon wants to merge 1 commit into
Conversation
scripts/install-openshell.sh uses `strings` (from binutils) to verify the OpenShell CLI binary carries the credential-rewrite endpoints. That check only ran during OpenShell install/verification, late in the installer, so on a host without binutils the installer ran for ~5 minutes (Node.js install, repo clone, npm install, tsc build, OpenShell download + checksum) before aborting at the final verification step. Reported on a clean Ubuntu 24.04 host in NVIDIA#4415. Add an ensure_openshell_build_deps preflight in main(), right after ensure_docker and before any clone/build/download work, that fails fast with an actionable message (Debian/Ubuntu: sudo apt-get install -y binutils) when `strings` is absent. The check is skipped when NEMOCLAW_DEFER_OPENSHELL_INSTALL=1, since that flag postpones all OpenShell work to a later phase where install-openshell.sh runs the same check itself, leaving the pre-upgrade backup flow unaffected. Tests: two cases in test/install-preflight.test.ts assert the installer fails fast with the binutils guidance and never reaches the OpenShell install/clone when `strings` is missing, and that the preflight stays silent under NEMOCLAW_DEFER_OPENSHELL_INSTALL=1. Full install-preflight suite passes (101/101) in the nemoclaw-test container. Signed-off-by: latenighthackathon <latenighthackathon@users.noreply.github.com>
📝 WalkthroughWalkthroughThe PR adds an early-stage preflight check that detects missing ChangesBuild dependency preflight enforcement
Sequence DiagramsequenceDiagram
participant Installer as Installer main()
participant Preflight as ensure_openshell_build_deps()
participant Shell as Shell (which strings)
Installer->>Preflight: Call after third-party preflight
Preflight->>Shell: Check strings availability
alt strings found
Shell-->>Preflight: success
Preflight-->>Installer: continue to other setup
else strings not found
Shell-->>Preflight: not found
Preflight-->>Installer: exit 1 with apt-get hint
end
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested Labels
Suggested Reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
✨ Thanks for submitting this detailed PR about adding an early preflight check for missing binutils. This proposes a code change to fail fast with an actionable message when binutils is missing, instead of running for several minutes and then aborting at the final OpenShell verification step. Related open issues: |
Summary
Adds an early preflight check so the installer fails fast with an actionable message when
binutils(thestringsbinary) is missing, instead of running for several minutes and then aborting at the final OpenShell verification step.Problem
scripts/install-openshell.shusesstrings(from binutils) inopenshell_has_required_messaging_featuresto confirm the OpenShell CLI binary carries the credential-rewrite endpoints. That check only runs during OpenShell install/verification, which happens late in the installer. On a clean host without binutils the installer therefore ran for around five minutes (Node.js install, repo clone, npm install, tsc build, OpenShell download and checksum) before aborting with'strings' is required to verify OpenShell messaging credential rewrite support. All of that work was discarded, and the installer could only complete after binutils was installed and the run repeated. Reported on a clean Ubuntu 24.04 host in #4415.Changes
ensure_openshell_build_depsand call it inmain()immediately afterensure_docker, before any clone, build, or download work.stringsis absent the check exits with a single actionable line pointing atsudo apt-get install -y binutils.NEMOCLAW_DEFER_OPENSHELL_INSTALL=1, because that flag postpones all OpenShell work to a later phase whereinstall-openshell.shruns the samestringscheck itself, so the pre-upgrade backup flow is unaffected.ensure_dockerandensure_supported_runtimedetect-and-fail-fast preflight pattern rather than auto-installing a system package.Related Issue
Closes #4415
Type of Change
Verification
npx prek run --all-filespassesnpm testpassesnpm run docsbuilds without warnings (doc changes only)Ran: full
test/install-preflight.test.tssuite passes (101/101), including two new cases - the installer fails fast with the binutils guidance and never reaches the OpenShell install or clone whenstringsis missing, and the preflight stays silent underNEMOCLAW_DEFER_OPENSHELL_INSTALL=1;bash -n scripts/install.shclean;shellcheckpasses via the pre-push hook.Signed-off-by: latenighthackathon latenighthackathon@users.noreply.github.com
Summary by CodeRabbit
Release Notes