fix(install): stop a CLI install from building the desktop's node-pty - #88442
Open
xxxigm wants to merge 2 commits into
Open
fix(install): stop a CLI install from building the desktop's node-pty#88442xxxigm wants to merge 2 commits into
xxxigm wants to merge 2 commits into
Conversation
xxxigm
force-pushed
the
fix/install-scope-npm-workspaces
branch
from
August 17, 2026 13:49
32729e0 to
f13cfa9
Compare
The browser-tools step ran a bare `npm install` at the repo root, which resolves the root package.json's `apps/*` workspace glob. That materializes apps/desktop and with it node-pty, which ships no Linux prebuild and falls back to `node-gyp rebuild` — so the installer needs make/gcc on a machine that will never launch Electron or a PTY addon. Since NousResearch#85297 made a failed npm install fatal, a host without a C toolchain (a stock CentOS/RHEL box, for instance) cannot complete a CLI-only install at all; it just reports "npm install failed or timed out". Name the workspaces the install actually needs instead. ui-tui and web are selected when present, with --include-workspace-root so the root's shared ESLint devDependencies are not pruned by the scoped install — the same closure `hermes update` already installs. A checkout with neither workspace falls back to a root-only install, since npm fails hard on a workspace it cannot find. Desktop dependencies keep coming from install_desktop(), which is only reachable via --include-desktop. Against a pristine tree the unscoped install reifies 1362 packages including node-pty 1.1.0; the scoped one reifies 582 with no native desktop addon. A fork force-push can 404 the compare API used by detect-changes, which fail-opens with ci_review=true and blocks the PR on a ci-reviewed label the install change does not need. Recover the file list from the pull request files endpoint before that fail-open.
Runs the installer's real node_deps_workspace_args against fabricated checkout layouts by sourcing install.sh in --manifest mode, which defines its functions without performing an install. The load-bearing assertion is the invariant that no checkout shape lets apps/desktop resolve, including the empty-argument case that would silently hand npm the whole workspace glob back. Also cover classify_changes recovering the PR file list when compare returns nothing, so fail-open does not demand ci-reviewed for a CLI-only install change.
xxxigm
force-pushed
the
fix/install-scope-npm-workspaces
branch
from
August 18, 2026 16:37
f13cfa9 to
b3a1578
Compare
Contributor
Two well-motivated fixes in one PR, each solving a documented failure chain:
No blocking issues found. |
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.
Summary
A fresh
install.shrun fails on any Linux host without a C toolchain, even for a CLI-only install:The underlying npm error is
node-ptyfalling back to a native build:The browser-tools step runs a bare
npm installat the repo root, so npm resolves the rootpackage.json'sapps/*workspace glob. That materializesapps/desktop, which declaresnode-pty@1.1.0. node-pty ships no Linux prebuild, so its install script falls back tonode-gyp rebuildand the host suddenly needsmake/gcc — on a machine that will never launch Electron or a PTY addon. Since #85297 made a failed npm install fatal, this aborts the entire install rather than degrading.This fix names the workspaces the install actually needs.
ui-tuiandwebare selected when present, with--include-workspace-rootso the root's shared ESLint devDependencies are not pruned by the scoped install — the same closurehermes updatealready installs (_update_node_dependencies). A checkout with neither workspace falls back to a root-only install, since npm fails hard on a workspace it cannot find. Desktop dependencies keep coming frominstall_desktop(), reachable only via--include-desktop.Why this isn't already covered
#38311 reported this same
node-pty/ missing-makefailure and was closed as fixed on main, but that fix landed inhermes_cli/main.py— it limitshermes updateto root/ui-tui/web. #38772 / #40543 similarly scoped thehermes_clianddoctorcall sites.scripts/install.shwas the last unscoped caller, so a first install still reproduces on a host without build tools whilehermes updateno longer does.The comment in
install_desktop()even asserts the old assumption that the browser-tools install "does not pullapps/*deps" — the dry-run below shows it does.Verification
Reified package counts against a pristine tree (same lockfile, no
node_modules):npm install(before)add node-pty 1.1.0, plus electron + electron-buildernpm install --workspace ui-tui --workspace web --include-workspace-root(after)Test plan
scripts/run_tests.sh tests/test_install_sh_node_deps_workspaces.py -q— 7 passedscripts/run_tests.sh tests/test_install_sh_browser_install.py tests/test_install_lockfile_churn.py tests/test_install_no_initial_commit.py tests/hermes_cli/test_web_ui_build.py -q— passedbash -n scripts/install.shnpm install --dry-runcomparison above (npm 10.9.8, Node 22.22.3)The new test executes the real
node_deps_workspace_args(sourcinginstall.shin--manifestmode defines its functions without running an install) and asserts the invariant that no checkout shape letsapps/desktopresolve — including the empty-argument case that would hand npm the whole workspace glob back.Reported on Discord: CentOS 10 Stream, Node 26.7.0, npm 11.19.0, current
main.