Description
Swift/iOS builds fail after github/codeql-action/init with Xcode 26 on macOS 26 GitHub-hosted runners when the build needs the Metal toolchain.
The failing build error is:
error: error: cannot execute tool 'metal' due to missing Metal Toolchain; use: xcodebuild -downloadComponent MetalToolchain
Command CompileMetalFile failed with a nonzero exit code
This was originally discussed in actions/runner-images:
Reproduction outline
jobs:
codeql-metal-repro:
runs-on: macos-26
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@v4
- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Check Metal before CodeQL init
run: |
xcodebuild -version
xcrun --find metal
xcrun metal -v
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: swift
build-mode: manual
- name: Check Metal after CodeQL init
run: |
xcrun --find metal
xcrun metal -v
- name: Build
run: |
# Run the normal xcodebuild command for an iOS app target that compiles Metal files.
xcodebuild ...
Expected: xcrun metal -v and the xcodebuild invocation continue to find the selected Xcode’s Metal toolchain after CodeQL initialization.
Actual: after codeql-action/init, xcrun metal -v / CompileMetalFile can fail with “missing Metal Toolchain”, even though the runner image appears to have the toolchain available before CodeQL initialization.
Note: Xcode 26 changed Metal Toolchain distribution/visibility, and MacPorts documented extra steps sometimes needed to make the toolchain visible to all users:
https://trac.macports.org/wiki/TahoeProblems#MetaltoolchainisnolongerbundledinXcode
Description
Swift/iOS builds fail after
github/codeql-action/initwith Xcode 26 on macOS 26 GitHub-hosted runners when the build needs the Metal toolchain.The failing build error is:
This was originally discussed in
actions/runner-images:xcrun metal -vworks after Xcode selection, then fails aftercodeql-action/init: Metal Toolchain on macOS 26 Runners with Xcode 26 actions/runner-images#13014 (comment)Reproduction outline
Expected:
xcrun metal -vand thexcodebuildinvocation continue to find the selected Xcode’s Metal toolchain after CodeQL initialization.Actual: after
codeql-action/init,xcrun metal -v/CompileMetalFilecan fail with “missing Metal Toolchain”, even though the runner image appears to have the toolchain available before CodeQL initialization.Note: Xcode 26 changed Metal Toolchain distribution/visibility, and MacPorts documented extra steps sometimes needed to make the toolchain visible to all users:
https://trac.macports.org/wiki/TahoeProblems#MetaltoolchainisnolongerbundledinXcode