Draft
Add macOS support to unified/swift-syntax-rs build#22181
Conversation
Copilot
AI
changed the title
[WIP] Add macOS support to unified/swift-syntax-rs crate
Add macOS support to unified/swift-syntax-rs build
Jul 13, 2026
…cit linux/macos selects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
unified/swift-syntax-rscrate's Bazel build and localcargopath were Linux-only. This adds macOS (xcode) support to both while keeping Ubuntu working.Changes
MODULE.bazel— Registers thexcodetoolchain alongsideubuntu24.04:Comment updated to note the macOS
.pkgcan only be fetched/extracted on a macOS host.unified/swift-syntax-rs/BUILD.bazel— Replaces hardcoded@swift_toolchain_ubuntu24.04//:fileson bothrust_binaryandrust_testwith a platformselect():The
:filestarget is confirmed valid for thexcoderepo — rules_swift 4.0.0-rc4 uses the sameBUILD.bazel.tplfor all platforms.unified/swift-syntax-rs/build.rs—swift_runtime_dir()now selects the OS-appropriate subdirectory (macosxon macOS,linuxotherwise) instead of always usinglinux.unified/swift-syntax-rs/README.md— Updates "Building with Bazel (CI)" to reflect both registered platforms and the macOS.pkghost constraint.