-
Notifications
You must be signed in to change notification settings - Fork 12
example/bzlmod: recommend extra_toolchains flag #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The way toolchains are ordered hasn't changed, so I think this should still only depend on the relative order between the dep on Ideally we wouldn't mix this way of registering the toolchain with
|
19824a6
to
a6ddf88
Compare
I think we can do (2), except still keep the register_toolchains in our module. |
I was able to get a slimmed-down version of this example to build with RBE from Darwin with the following:
I do call |
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 toolchain registration, by either calling `register_toolchains` in their own MODULE.bazel file, or using `--extra_toolchains` flag in their `.bazelrc` file.
0dce982
to
5cfa262
Compare
# register_toolchains( | ||
# "@toolchains_buildbuddy//toolchains/cc:all", | ||
# ) | ||
# User may explicitly choose a specific toolchain using the `--extra_toolchains=` flag. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still misleading: The individual toolchains we register don't compete with each other since their target constraints differ, so users never have to order them explicitly. Instead, they could just drop some of the arguments to this call.
The case in which users need --extra_toolchains
is if they only want our toolchain(s) to win sometimes. I guess we don't have to tell them about --extra_toolchains
in that case since there is nothing special about this case (no ordering issues, nothing specific to Bzlmod or BuildBuddy).
We could still call out the flag as an alternative to the call, but not for the purpose mentioned in the comment.
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.