[MLX] Probe the usable Metal compiler in Apple CMake presets
@metascroy is already working on this.
Since Sep 10, 2026.
- Dominant language
- Python
- Stars
- 5k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 581
Description
Problem
The Apple and pybind presets use xcrun -sdk macosx --find metal. On current Xcode releases this can locate a launcher even when the separately installed Metal Toolchain component is unavailable, so configuration enables MLX and fails later during compilation.
The documentation correction is part of #22620. The preset behavior change is intentionally excluded from that documentation-only PR.
Proposed change
Probe xcrun -sdk macosx metal --version in both presets and update the fallback message to point to xcodebuild -downloadComponent MetalToolchain.
Test plan
- Configure on Apple silicon with Xcode and the Metal Toolchain installed; verify MLX remains enabled.
- Configure with Xcode but without the Metal Toolchain; verify MLX is disabled cleanly.
- Run Apple pybind and MLX build CI.
cc @larryliu0820 @GregoryComer @metascroy
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.