Skip to content

Commit 19824a6

Browse files
committed
example/bzlmod: recommend extra_toolchains flag
In the latest Bazel versions, rules_cc toolchains will take priority over our own toolchains during automatic resolution. Recommend users to override the priority by using explicit --extra_toolchains flag.
1 parent 66146a3 commit 19824a6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

examples/bzlmod/.bazelrc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ common:remote --remote_executor=grpcs://remote.buildbuddy.io
2525
# These will take precedence over the default ones.
2626
#
2727
# The flags `--extra_execution_platforms` and `--extra_toolchains` are used to override the staticcally
28-
# registered toolchains and execution platforms.
28+
# registered toolchains and execution platforms. This is recommended as other Bazel Modules (i.e. rules_cc)
29+
# may register their cc toolchains earlier and take default priority.
30+
#
2931
# For example:
3032
#
3133
# common:remote-linux --extra_execution_platforms=@toolchains_buildbuddy//platforms:linux_x86_64
@@ -49,17 +51,20 @@ common:remote --remote_executor=grpcs://remote.buildbuddy.io
4951
common:remote-linux --config=remote
5052
common:remote-linux --platforms=@toolchains_buildbuddy//platforms:linux_x86_64
5153
common:remote-linux --extra_execution_platforms=@toolchains_buildbuddy//platforms:linux_x86_64
54+
common:remote-linux --extra_toolchains=@toolchains_buildbuddy//toolchains/cc:ubuntu_gcc_x86_64
5255

5356
common:remote-linux-arm64 --config=remote
5457
common:remote-linux-arm64 --platforms=@toolchains_buildbuddy//platforms:linux_arm64
5558
common:remote-linux-arm64 --extra_execution_platforms=@toolchains_buildbuddy//platforms:linux_arm64
59+
common:remote-linux --extra_toolchains=@toolchains_buildbuddy//toolchains/cc:ubuntu_gcc_arm64
5660

5761
## Using custom Linux platform
58-
#
62+
#
5963
# This helps verify that user can extend our platform definitions via inheritence.
6064
common:custom-linux --config=remote
6165
common:custom-linux --platforms=//:my_linux_platform
6266
common:custom-linux --extra_execution_platforms=//:my_linux_platform
67+
common:remote-linux --extra_toolchains=@toolchains_buildbuddy//toolchains/cc:ubuntu_gcc_x86_64
6368

6469
## Target Windows platform when build remotely
6570
#
@@ -70,6 +75,7 @@ common:custom-linux --extra_execution_platforms=//:my_linux_platform
7075
common:remote-windows --config=remote
7176
common:remote-windows --platforms=@toolchains_buildbuddy//platforms:windows_x86_64
7277
common:remote-windows --extra_execution_platforms=@toolchains_buildbuddy//platforms:windows_x86_64
78+
common:remote-linux --extra_toolchains=@toolchains_buildbuddy//toolchains/cc:windows_msvc_x86_64
7379

7480

7581
# Separate file to keep API Key that should have the follow flag

0 commit comments

Comments
 (0)