@@ -34,10 +34,24 @@ bazel_dep(name = "rules_rust", version = "0.69.0")
3434bazel_dep (name = "rules_swift" , version = "4.0.0-rc4" )
3535bazel_dep (name = "swift-syntax" , version = "602.0.0.bcr.2" )
3636# `apple_support` is a transitive dep of `rules_swift`, but we depend on it
37- # directly so we can `use_repo` `local_config_xcode` (see below). This lets
38- # `xcode_swift_toolchain`'s `system_sdk` selects — which are keyed on the
39- # exact Xcode version string from `xcode_locator.m` (e.g.
40- # `xcode_26_6_0_17F113`) — resolve on macOS.
37+ # directly for two reasons on macOS:
38+ #
39+ # 1. We `use_repo` `local_config_xcode` (see below) so
40+ # `xcode_swift_toolchain`'s `system_sdk` selects — which are keyed on
41+ # the exact Xcode version string from `xcode_locator.m` (e.g.
42+ # `xcode_26_6_0_17F113`) — resolve.
43+ #
44+ # 2. It registers `@local_config_apple_cc_toolchains//:all`, whose
45+ # `cc-toolchain-darwin_*` toolchains report a proper Apple target
46+ # triple (`arm64-apple-macosx` / `x86_64-apple-macosx`) via
47+ # `target_gnu_system_name`. Bazel's built-in `local_config_cc`
48+ # toolchain reports the literal string `"local"`, and
49+ # `xcode_swift_toolchain` fails analysis in
50+ # `target_triples.parse(ctx.var.get("CC_TARGET_TRIPLE") or
51+ # cc_toolchain.target_gnu_system_name)` with
52+ # "Invalid target triple: local". Since module-registered toolchains
53+ # are ordered by the module DAG and `local_config_cc` wins by default,
54+ # we override the priority via `--extra_toolchains` in `.bazelrc`.
4155bazel_dep (name = "apple_support" , version = "2.6.1" )
4256
4357bazel_dep (name = "zstd" , version = "1.5.7.bcr.1" )
0 commit comments