Skip to content

fix(install): stop when the Homebrew bootstrap fails instead of reporting success - #187688

Merged
steipete merged 1 commit into
mainfrom
upd/upd-l1971
Oct 29, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/upd-l1971

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #187678: macOS installs that need Homebrew report “Homebrew installed” and attempt Node provisioning after the Homebrew bootstrap fails. Regression introduced by #187635. Thanks @McgAtom for the report and isolated reproduction.

User Impact

Failed Homebrew bootstraps now stop immediately with their original exit status and diagnostic in both quiet and verbose modes, before any dependent Node install or misleading success message. Successful bootstraps still proceed normally. The selected-checkout Node engine behavior from #187635 is preserved.

Why This Change Was Made

The extracted ensure_node runs in an || list, which disables Bash's implicit errexit in nested calls. Explicitly propagate the bootstrap failure from install_homebrew, retain it through both npm and git entry paths, and let run_quiet_step return the command's original status instead of reducing ordinary failures to 1.

Audited the sibling Node paths touched by #187635: Homebrew Node installation explicitly stops on failure; nvm has explicit failure checks; Linux required provisioning steps explicitly terminate. PowerShell package-manager callbacks check native exit codes and validate the resulting runtime; Ensure-Node propagates failure. No additional fall-through repair was needed there.

The change removes quiet-mode status normalization and adds no new configuration or compatibility paths. Production: +5/-11 lines (net -6); regression tests: +86 lines; docs: +2 lines. The tests cover the failure at installer main and successful-bootstrap controls through refusing package adapters.

Evidence

  • Native macOS /bin/bash 3.2.57, assembled standalone installer sourced with OPENCLAW_INSTALL_SH_NO_RUN=1, real main, ensure_node, install_homebrew, run_quiet_step, and install_node. Isolated HOME/state/temp directories; network/bootstrap and package effects refused by adapters. This proves installer-main control flow, not a complete package installation or the bottom-level argument dispatcher.
  • Red on untouched base 82777f305ef8cf01d462998707291dd777f2f8a3: all four npm/git × quiet/verbose bootstrap-failure cases exit 1, print Homebrew success, and attempt the refused Node install. Four successful-bootstrap controls pass. Green with the fix: all eight cases pass; bootstrap exit 17 retains its diagnostic, prints no success, and never invokes brew. Successful-bootstrap controls reach refused brew install node, stop before linking, and print no Node success.
  • node scripts/run-vitest.mjs test/scripts/install-sh.provisioning.test.ts --maxWorkers=1: 8 passed; 0.922 s Vitest duration, 2.01 s wrapper wall time. CI seconds pending.
  • Installer owner/assembly/history/previous-version tests: 250 passed in the initial five-file run (50.12 s), with the inherited failures below. The eight previous-version setup failures were traced to extensionless CommonJS fixtures inheriting the repository's ESM package scope because the isolated temp root is inside the checkout. Giving that task-local temp root a CommonJS package marker resolves the setup issue: all 8 previous-version tests pass (5.04 s, 6.24 s wrapper wall time), with no tracked fixture changes.
  • Additional consumers: native script/re-exec checks, Bun installer, git-ref installer checks, version resolution, and PowerShell source checks pass: 194 tests across three planned shards, 27.31 s wrapper wall time. 57 PowerShell runtime cases skip because pwsh is unavailable; PowerShell audit is source evidence only.
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.root.scripts.json --incremental, targeted oxlint, oxfmt, /bin/bash -n scripts/install.sh, git diff --check, and madge pass (0 cycles).
  • Both ratchets pass against the base: max-lines 404 grandfathered suppressions; test lines 6,267,411 / ceiling 6,325,142 (57,731 slack). Changed-file line-cap ratchet also passes. No baselines or allocations changed.
  • Full check:changed SQLite inventory omitted under the campaign's local gate budget; PR CI provides broad proof.
  • Local ClawSweeper unavailable: shared runner checkout has unrelated edits. Codex autoreview attempted against the complete local candidate/base at P0–P2 but failed authentication; no clean review is claimed. Lead review remains required; marking ready requests the repository's automatic hosted review.

Inherited failures reproduced with the untouched base: install-sh.test.ts → “gives a working PATH remedy after a writable npm prefix with quoted prefix” and “prints a literal-safe direct PATH remedy for zsh”. Both reject the generated command with unmatched single-quote syntax errors. Their PATH-remedy code is unchanged by this PR. They remain recorded failures, not passing proof.

…ting success

Preserve the bootstrap exit status through quiet execution and the npm/git Node preparation paths. Explicitly return before Homebrew success when Bash errexit is suppressed by conditional ensure_node calls.

Fixes #187678. Regression from #187635. Thanks @McgAtom for the report and reproduction.
@clawsweeper

clawsweeper Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: S labels Oct 29, 2026
@steipete
steipete marked this pull request as ready for review October 29, 2026 13:35
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T13:37:42.504241Z 2c5593d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete merged commit 9ca022e into main Oct 29, 2026
180 of 185 checks passed
@steipete
steipete deleted the upd/upd-l1971 branch October 29, 2026 13:55
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 30, 2026
…ting success (openclaw#187688)

After openclaw#187635 moved runtime admission, ensure_node is called from a conditional, which disables bash's implicit failure handling inside install_homebrew. A failed Homebrew bootstrap therefore printed 'Homebrew installed' and went on to brew install node. The installer now propagates the bootstrap status explicitly through quiet and verbose modes and both installer entry paths, so it stops with the original exit status before any success output or Node provisioning.

Fixes openclaw#187678. Thanks @McgAtom for the report.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation scripts Repository scripts size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installer reports Homebrew success and continues after its bootstrap fails

1 participant