Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

ci: select the installed Metal toolchain (#6568)

Ezra Ellette9e798e557323
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index 6c42e0750..5288c1ab5 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -1289,6 +1289,12 @@ jobs:
# 10.13 to the Metal compiler. This breaks both MSL 3.0+ and std::filesystem.
# Fix: wrap cc/c++/xcrun to replace all -mmacosx-version-min flags with 14.0.
if [[ "${{ matrix.target }}" == "aarch64-apple-darwin" ]]; then
+ TOOLCHAINS=$(xcodebuild -showComponent MetalToolchain | sed -n 's/^Toolchain Identifier: //p')
+ if [[ -z "$TOOLCHAINS" ]]; then
+ echo "Metal Toolchain is installed but its identifier could not be resolved" >&2
+ exit 1
+ fi
+ export TOOLCHAINS
xcrun metal --version
WRAPPER_DIR="$(pwd)/.compiler-wrapper"
mkdir -p "$WRAPPER_DIR"
diff --git a/.github/workflows/release-enterprise.yml b/.github/workflows/release-enterprise.yml
index 769b8d3ed..b98a4fb94 100644
--- a/.github/workflows/release-enterprise.yml
+++ b/.github/workflows/release-enterprise.yml
@@ -839,6 +839,12 @@ jobs:
# Compiler wrapper is only needed for ARM64 MLX Metal kernels.
if [[ "$TARGET" == "aarch64-apple-darwin" ]]; then
+ TOOLCHAINS=$(xcodebuild -showComponent MetalToolchain | sed -n 's/^Toolchain Identifier: //p')
+ if [[ -z "$TOOLCHAINS" ]]; then
+ echo "Metal Toolchain is installed but its identifier could not be resolved" >&2
+ exit 1
+ fi
+ export TOOLCHAINS
xcrun metal --version
WRAPPER_DIR="$(pwd)/.compiler-wrapper"
mkdir -p "$WRAPPER_DIR"