Skip to content

./script/bootstrap does not install Xcode Metal Toolchain on macOS, leading to confusing cargo build failure in crates/warpui/build.rs #9996

@sovattha

Description

@sovattha

Summary

On a fresh macOS dev setup, ./script/bootstrap completes successfully but a subsequent ./script/run (or cargo build) fails inside crates/warpui/build.rs when it tries to compile Metal shaders. The Xcode Metal Toolchain component is not installed by default with Xcode, and bootstrap does not check for or install it.

This is the macOS counterpart to #9544 (Node.js/yarn check missing on Linux/Windows).

Repro

Fresh checkout, macOS (Apple Silicon), Xcode 16.x installed via App Store, no prior metal command available.

./script/bootstrap              # succeeds
./script/install_cargo_bundle   # also needed (separate gap, see "Other gaps" below)
./script/run                    # fails

Actual

   Compiling warpui v0.1.0 (/.../crates/warpui)
error: failed to run custom build command for `warpui v0.1.0`

Caused by:
  process didn't exit successfully: `.../warpui-XXX/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at crates/warpui/build.rs:92:5:
  error compiling metal shaders to .air; error: error: cannot execute tool 'metal' due to missing Metal Toolchain;
  use: xcodebuild -downloadComponent MetalToolchain

Expected

./script/bootstrap either:

  1. Detects that the Metal Toolchain is missing and runs xcodebuild -downloadComponent MetalToolchain (with user acknowledgement, per ./scripts/bootstrap invokes sudo and installs system-wide dependencies without user acknowledgement #9421), or
  2. Fails fast with a clear message pointing the user to that command before any cargo invocation, similar to what Bootstrap scripts don't check for Node.js/yarn, leading to confusing cargo build failures #9544 proposes for Node.js/yarn.

Suggested fix

Add a check to script/macos/bootstrap (or the platform-agnostic script/bootstrap) along the lines of:

if ! xcrun --find metal &>/dev/null; then
    echo "Metal Toolchain not installed. Running: xcodebuild -downloadComponent MetalToolchain"
    xcodebuild -downloadComponent MetalToolchain
fi

The check should ideally be paired with a guard that verifies the component is actually downloaded before continuing (the xcodebuild invocation can be slow and silently fail).

Other gaps observed in the same setup flow

While not the focus of this issue, the same first-time setup also surfaced:

  • cargo bundle not installed → error: no such command: bundle (workaround: ./script/install_cargo_bundle, but bootstrap doesn't call it)

Happy to file a separate issue for the cargo-bundle gap if useful.

Environment

  • macOS (Apple Silicon)
  • Xcode 16.x (clang 21 toolchain visible in build output)
  • Rust toolchain as pinned by rust-toolchain.toml
  • Branch: master at HEAD

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:launch-configsLaunch configurations, workflows, tab configs, and automation entry points.bugSomething isn't working.os:macmacOS-specific behavior, regressions, or requests.repro:highThe report includes enough evidence that the issue appears highly reproducible.triagedIssue has received an initial automated triage pass.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions