Skip to content

Add macOS support to unified/swift-syntax-rs build#22181

Draft
jketema with Copilot wants to merge 22 commits into
tausbn/swift-syntax-rsfrom
copilot/add-macos-support
Draft

Add macOS support to unified/swift-syntax-rs build#22181
jketema with Copilot wants to merge 22 commits into
tausbn/swift-syntax-rsfrom
copilot/add-macos-support

Conversation

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

The unified/swift-syntax-rs crate's Bazel build and local cargo path were Linux-only. This adds macOS (xcode) support to both while keeping Ubuntu working.

Changes

  • MODULE.bazel — Registers the xcode toolchain alongside ubuntu24.04:

    use_repo(swift, "swift_toolchain", "swift_toolchain_ubuntu24.04", "swift_toolchain_xcode")
    register_toolchains(
        "@swift_toolchain//:swift_toolchain_exec_ubuntu24.04",
        "@swift_toolchain//:swift_toolchain_exec_xcode",
    )

    Comment updated to note the macOS .pkg can only be fetched/extracted on a macOS host.

  • unified/swift-syntax-rs/BUILD.bazel — Replaces hardcoded @swift_toolchain_ubuntu24.04//:files on both rust_binary and rust_test with a platform select():

    data = select({
        "@platforms//os:macos": ["@swift_toolchain_xcode//:files"],
        "//conditions:default": ["@swift_toolchain_ubuntu24.04//:files"],
    }),

    The :files target is confirmed valid for the xcode repo — rules_swift 4.0.0-rc4 uses the same BUILD.bazel.tpl for all platforms.

  • unified/swift-syntax-rs/build.rsswift_runtime_dir() now selects the OS-appropriate subdirectory (macosx on macOS, linux otherwise) instead of always using linux.

  • unified/swift-syntax-rs/README.md — Updates "Building with Bazel (CI)" to reflect both registered platforms and the macOS .pkg host constraint.

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
Copilot AI requested a review from jketema July 13, 2026 14:19
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.

2 participants