Skip to content

Use linker placeholder for custom Xcode toolchains#1673

Open
bc-lee wants to merge 3 commits intobazelbuild:mainfrom
bc-lee:feature/fix-swift-snapshot-linker
Open

Use linker placeholder for custom Xcode toolchains#1673
bc-lee wants to merge 3 commits intobazelbuild:mainfrom
bc-lee:feature/fix-swift-snapshot-linker

Conversation

@bc-lee
Copy link
Copy Markdown
Contributor

@bc-lee bc-lee commented Mar 30, 2026

rules_swift currently reuses the Swift worker placeholder for linker search paths when TOOLCHAINS selects a custom macOS toolchain. That leaves __BAZEL_SWIFT_TOOLCHAIN_PATH__ unresolved in CppLink actions, which produces a warning during linking.

Split the custom toolchain placeholders so Swift-side behavior keeps using __BAZEL_SWIFT_TOOLCHAIN_PATH__ while linker flags use __BAZEL_CUSTOM_XCODE_TOOLCHAIN_PATH__, which apple_support already substitutes for link actions.

Fixes #1672

rules_swift currently reuses the Swift worker placeholder for linker
search paths when TOOLCHAINS selects a custom macOS toolchain. That
leaves __BAZEL_SWIFT_TOOLCHAIN_PATH__ unresolved in CppLink actions,
which produces a warning during linking.

Split the custom toolchain placeholders so Swift-side behavior keeps
using __BAZEL_SWIFT_TOOLCHAIN_PATH__ while linker flags use
__BAZEL_CUSTOM_XCODE_TOOLCHAIN_PATH__, which apple_support already
substitutes for link actions.
@bc-lee bc-lee marked this pull request as ready for review March 30, 2026 22:50
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.

TOOLCHAINS=<swift snapshot bundle id> emits unresolved Swift toolchain linker search path on macOS

1 participant