Skip to content

Check for Node.js and yarn at bootstrap time#9546

Closed
landkirk wants to merge 1 commit intowarpdotdev:masterfrom
landkirk:landkirk/fix-bootstrap-not-checking-for-node
Closed

Check for Node.js and yarn at bootstrap time#9546
landkirk wants to merge 1 commit intowarpdotdev:masterfrom
landkirk:landkirk/fix-bootstrap-not-checking-for-node

Conversation

@landkirk
Copy link
Copy Markdown
Contributor

@landkirk landkirk commented Apr 30, 2026

Description

Fixes #9544.

The command-signatures-v2 crate compiles a TypeScript helper at cargo build time using yarn, but none of the bootstrap scripts verified that Node or yarn were on PATH. Fresh checkouts succeeded at bootstrap and then failed deep inside a build.rs panic with inline setup instructions that were easy to miss.

What changed:

  • Fail fast in script/linux/install_build_deps, script/macos/bootstrap, and script/windows/bootstrap.ps1 if node or yarn is missing.
  • Add a "Node.js setup" section to WARP.md covering version managers, system packages, the yarn --version / corepack enable flow, and the sudo / Volta caveats.
  • Trim the command-signatures-v2/build.rs panic to point at that section instead of duplicating instructions inline.

What this PR deliberately does not do:

  • Auto-install Node. How you install Node is opinionated — nvm, fnm, volta, asdf, mise, system package, NodeSource, brew, winget, etc. — and these don't compose well. We point at the options in WARP.md and let the developer pick.
  • Auto-run corepack enable. Whether this works depends on how Node was installed: system-installed Node needs sudo / an admin shell, and Volta manages yarn itself so corepack would conflict. Running it unconditionally would silently break those setups.

Testing

Manually verified on Linux:

  • With node and yarn on PATH, ./script/linux/install_build_deps proceeds normally.
  • With node removed from PATH, the script exits with the new error message before invoking cargo.
  • With node present but yarn missing, the script exits pointing at the WARP.md setup section.

No automated test coverage — these are bootstrap shell/PowerShell scripts that aren't exercised in CI.

The `command-signatures-v2` crate compiles a TypeScript helper at `cargo
build` time using `yarn`, but none of the bootstrap scripts verified that
Node or yarn were on PATH. Fresh checkouts succeeded at bootstrap and then
failed deep inside a build-script panic with inline setup instructions
that were easy to miss.

- Fail fast in `script/linux/install_build_deps`, `script/macos/bootstrap`,
  and `script/windows/bootstrap.ps1` if `node` or `yarn` is missing. Don't
  auto-run `corepack enable`: it can need sudo / an admin shell for
  system-installed Node, and Volta manages yarn itself.
- Add a "Node.js setup" section to WARP.md covering version managers, system
  packages, the `yarn --version` / `corepack enable` flow, and the
  sudo/Volta caveats.
- Trim the `command-signatures-v2/build.rs` panic to point at that section.

Fixes warpdotdev#9544.
@cla-bot cla-bot Bot added the cla-signed label Apr 30, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 30, 2026

@landkirk

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 30, 2026

@landkirk

I'm checking this implementation PR for association with an explicitly linked issue.

The PR that you've opened seems to contain implementation changes and is associated with issue #9544, but none of those associated issue are marked as ready-to-implement. This PR will be automatically closed. Please see our contribution docs for guidance on when changes are accepted for issues.

Powered by Oz

@oz-for-oss oz-for-oss Bot closed this Apr 30, 2026
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds bootstrap-time checks for Node.js and yarn on Linux, macOS, and Windows, updates the command-signatures build panic to point at WARP.md, and documents Node.js setup.

Concerns

  • The new checks only verify that node and yarn commands exist. They still allow the documented stale-Node failure mode and the known incompatible/shadowing Yarn shim failure mode to pass bootstrap and fail later in build.rs.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

"$PWD"/script/install_rust

# Node + yarn are required to build the command-signatures-v2 crate.
if ! command -v node >/dev/null 2>&1; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] This only checks that some node exists, not the documented >=18.14.1 requirement, so older system Node installations still pass bootstrap and fail later in build.rs; validate node --version before continuing on all three bootstrap scripts.

echo -e "${red}Build requires Node.js. See the 'Node.js setup' section in WARP.md.${reset}"
exit 1
fi
if ! command -v yarn >/dev/null 2>&1; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] command -v yarn accepts incompatible shims like a brew/global Yarn 1 install, which this PR documents as a known build failure; run yarn --version in the command-signatures-v2/js package and reject incompatible majors or command failures in each platform bootstrap.

@captainsafia captainsafia added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Apr 30, 2026 — with Warp Dev Github Integration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bootstrap scripts don't check for Node.js/yarn, leading to confusing cargo build failures

2 participants