Skip to content

Conversation

@p-linnane
Copy link
Member

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

Follow up to #21117. This matches how Apple derives the Metal toolchain version, since there is no literal build identifier on disk.

Copilot AI review requested due to automatic review settings December 23, 2025 04:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the Metal Toolchain detection to display version information instead of just reporting "present". The change extracts version details from the Metal toolchain path and formats them in a user-friendly way.

  • Changed from running metal -v to using xcrun --find metal to get the toolchain path
  • Added regex parsing to extract version components from the MetalToolchain path format
  • Implemented version formatting with character arithmetic to convert numeric letter representations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Bo98
Copy link
Member

Bo98 commented Dec 23, 2025

Is this accurate on x86_64? The paths are totally different so parsing the path isn't necessarily stable.

@Bo98
Copy link
Member

Bo98 commented Dec 23, 2025

xcodebuild -showComponent MetalToolchain is probably the "proper" way to do it, though is quite slow (~0.65s).

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks looks good so far!

Signed-off-by: Patrick Linnane <patrick@linnane.io>
@p-linnane p-linnane force-pushed the show-metal-toolchain-version branch from bbd2e4a to c94a2b3 Compare December 23, 2025 17:11
@p-linnane
Copy link
Member Author

Reworked this a bit and should be much easier to read.

@Bo98 I opted to just return early on Intel given support is winding down.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Dec 24, 2025
Merged via the queue into main with commit 6d752b7 Dec 24, 2025
37 checks passed
@MikeMcQuaid MikeMcQuaid deleted the show-metal-toolchain-version branch December 24, 2025 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants