build-tools
build-tools copied to clipboard
Initial build on fresh macOS stops at missing Metal toolchain
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:
-
xcodebuild -runFirstLaunchand system auth -
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.