From 44d2c3775b2903ffb253acf7ad4af12497722c65 Mon Sep 17 00:00:00 2001 From: Val Alexander <68980965+BunsDev@users.noreply.github.com> Date: Wed, 27 May 2026 04:54:20 -0500 Subject: [PATCH] ci: fix macOS prepare_environment on stock GitHub runners Two cascading bugs were keeping every macOS job red since the runner-pool migration in #155: 1. **`script/macos/install_build_deps` ran `xcodebuild -downloadComponent MetalToolchain` against whatever Xcode the runner image shipped with.** Stock `macos-latest` defaults to an Xcode older than 15.3, which doesn't know `-downloadComponent` and exits with code 64. The prepare_environment action installs build deps *before* its `setup-xcode@v1.7.0` step selects Xcode 26, so the script always hit the older Xcode in CI. Make the script resilient: try the command, and if Xcode rejects the option, log a note and continue. The action's later `Install selected Xcode Metal toolchain` step runs the same command after `setup-xcode` and is where the toolchain actually gets pulled in for stock CI. Self-hosted runners keep this script path with their own pre-selected Xcode. 2. **`prepare_environment`'s macOS branch never called `install_cargo_test_deps`.** Even when callers passed `install_test_deps: true`, the macOS branch only chose between `install_cargo_release_deps` and `install_cargo_build_deps`, neither of which installs cargo-nextest. The linux branch already had the test-deps switch; mirror it for macOS so `Run MacOS tests` no longer fails with "no such command: nextest". No behavioural changes for Linux / Windows / wasm. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/actions/prepare_environment/action.yml | 9 ++++++++- script/macos/install_build_deps | 18 +++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/actions/prepare_environment/action.yml b/.github/actions/prepare_environment/action.yml index 358070bd6..3aea93224 100644 --- a/.github/actions/prepare_environment/action.yml +++ b/.github/actions/prepare_environment/action.yml @@ -96,7 +96,14 @@ runs: # Try to install warp-channel-config but don't complain if it cannot # be installed. ./script/install_channel_config || true - if ${{ inputs.install_release_deps == 'true' }}; then + if ${{ inputs.install_test_deps == 'true' }}; then + # Test deps include cargo-nextest (the test harness CI uses). + # The linux branch below already handles this; macOS used + # to fall through to install_cargo_build_deps, which doesn't + # install nextest -- so `cargo nextest run` blew up later + # with "no such command: nextest". + ./script/install_cargo_test_deps + elif ${{ inputs.install_release_deps == 'true' }}; then ./script/install_cargo_release_deps else ./script/install_cargo_build_deps diff --git a/script/macos/install_build_deps b/script/macos/install_build_deps index 1a264643d..b06668c95 100755 --- a/script/macos/install_build_deps +++ b/script/macos/install_build_deps @@ -2,4 +2,20 @@ # # Installs macOS-specific build dependencies required to build Warp. -xcodebuild -downloadComponent MetalToolchain +# `xcodebuild -downloadComponent` was added in Xcode 15.3. On stock +# GitHub `macos-latest` runners, this script executes *before* +# `prepare_environment` runs `setup-xcode` to select Xcode 26, so the +# active Xcode is still whatever ships with the runner image, which +# may not support the option. CI's `prepare_environment` action has a +# dedicated `Install selected Xcode Metal toolchain` step that retries +# this exact command after `setup-xcode`, so silently skipping here is +# safe for stock CI. Self-hosted runners hit this script with their +# own Xcode pre-selected and the call should succeed there. +if out=$(xcodebuild -downloadComponent MetalToolchain 2>&1); then + printf '%s\n' "$out" +elif printf '%s' "$out" | grep -q "invalid option '-downloadComponent'"; then + echo "xcodebuild -downloadComponent unsupported by current Xcode; skipping (CI retries after setup-xcode)." +else + printf '%s\n' "$out" >&2 + exit 1 +fi