`codeql-action/init` Makes Metal Toolchain Unavailable on macOS 26 Runners

Open
#3,978 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
github-actions, macos, typescript
Domain
ci-cd, devops, tooling

Research direction

Start with the reproduction workflow in the issue and compare xcrun metal -v before and after github/codeql-action/init@v4 on a macOS 26 runner. Read the init action entry point and inspect how initialization affects Xcode selection or Metal toolchain visibility. Done means the selected Xcode's Metal toolchain remains available and the shown checks and Metal-compiling build succeed.

Written by the indexing model from the issue text.

Description

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

Dominant language
TypeScript
Stars
1.6k
Forks
493
Avg merge
1d 13h
Merged PRs (30d)
44

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/codeql-action

All issues in github/codeql-action

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.