build-tools icon indicating copy to clipboard operation
build-tools copied to clipboard

Initial build on fresh macOS stops at missing Metal toolchain

Open clavin opened this issue 3 months ago • 0 comments

On a fresh macOS machine, the first e build will stop with a build error:

build step: __third_party_angle_src_libANGLE_renderer_metal_angle_metal_internal_shaders_to_air___build_toolchain_mac_clang_arm64__rule "./gen/angle/mtl_internal_shaders_autogen.air"
stderr:
error: error: cannot execute tool 'metal' due to missing Metal Toolchain; use: xcodebuild -downloadComponent MetalToolchain

Luckily the error is straightforward. Running xcodebuild -downloadComponent MetalToolchain will dump a bunch of errors and tell you to run xcodebuild -runFirstLaunch. So, the user will have to run:

  1. xcodebuild -runFirstLaunch and system auth
  2. xcodebuild -downloadComponent MetalToolchain

This is a very rare situation, and it's easily resolved by reading the output. It would be nice if build-tools preempted it.

clavin avatar Nov 20 '25 18:11 clavin