Draft
Add macOS support to unified/swift-syntax-rs (Bazel + cargo paths)#22187
Conversation
Copilot
AI
changed the title
[WIP] Update swift-syntax to version 603.0.2 and bump Swift compiler to 6.3.3
Add macOS support to unified/swift-syntax-rs (Bazel + cargo paths)
Jul 14, 2026
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.
unified/swift-syntax-rswas Linux-only: the Bazel build hardcoded@swift_toolchain_ubuntu24.04//:filesandbuild.rsalways linked against thelinuxSwift runtime subdir. This adds full macOS support (Apple Silicon and Intel) for both the Bazel and localcargopaths.Changes
MODULE.bazel— Addsapple_supportdep; registersxcode_configureandapple_cc_configureextensions so thexcode_transitioncan materialise@local_config_xcodeand@local_config_apple_cc_toolchains.unified/swift-syntax-rs/xcode_transition.bzl(new) — Starlark incoming-edge transition applied to theswift_librarytarget only. On macOS it injects--xcode_version_config=@local_config_xcode//:host_xcodesand prepends@local_config_apple_cc_toolchains//:allto--extra_toolchains(needed becauserules_swift'sxcode_swift_toolchainreadscc_toolchain.target_gnu_system_name, which is"local"under Bazel's defaultlocal_config_cc). Is a no-op on Linux, so downstream Rust targets and the rest of the repo are unaffected.unified/swift-syntax-rs/BUILD.bazel— Replacesswift_librarywithxcode_transition_swift_library. Replaces the hardcodeddata = ["@swift_toolchain_ubuntu24.04//:files"]onrust_binaryandrust_testwith:All targets gain
target_compatible_withso Windows (and other unsupported platforms) are skipped cleanly bybazel build //....unified/swift-syntax-rs/build.rs—swift_runtime_dir()now selectsmacosxvslinuxat compile time viacfg!(target_os = "macos").unified/swift-syntax-rs/swift/Package.swift— Adds explicitplatforms: [.macOS(.v10_15)](swift-syntax 602 requires it; without it SPM defaults to 10.13 which the package rejects).