Skip to content

Commit dca60ea

Browse files
authored
bazel: use_repo(apple_cc_configure, "local_config_apple_cc_toolchains")
1 parent f4c41e4 commit dca60ea

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

MODULE.bazel

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,15 @@ register_toolchains(
307307
xcode_configure = use_extension("@apple_support//xcode:xcode_configure.bzl", "xcode_configure_extension")
308308
use_repo(xcode_configure, "local_config_xcode")
309309

310+
# `apple_support` also registers `@local_config_apple_cc_toolchains//:all`
311+
# from its own `MODULE.bazel`, but the CC toolchains it generates lose
312+
# toolchain-resolution ordering to Bazel's built-in `local_config_cc`.
313+
# We override that priority in `.bazelrc` via
314+
# `build:macos --extra_toolchains=@local_config_apple_cc_toolchains//:all`,
315+
# which requires the repo to be visible from the root module.
316+
apple_cc_configure = use_extension("@apple_support//crosstool:setup.bzl", "apple_cc_configure_extension")
317+
use_repo(apple_cc_configure, "local_config_apple_cc_toolchains")
318+
310319
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
311320
node.toolchain(
312321
name = "nodejs",

0 commit comments

Comments
 (0)