Use Bazel-provided auto-configured toolchains#163
Closed
fmeum wants to merge 2 commits intobazelbuild:mainfrom
Closed
Use Bazel-provided auto-configured toolchains#163fmeum wants to merge 2 commits intobazelbuild:mainfrom
fmeum wants to merge 2 commits intobazelbuild:mainfrom
Conversation
The auto-configured toolchains provided by Bazel itself have diverged heavily from the version maintained in this repo. There is no need to maintain this duplication until Starlarkification has progressed succiciently for rules_cc to be the source of truth for them. This is particularly relevant for Bzlmod, which currently uses the toolchains defined in rules_cc. As a result, Bazel C++ builds will use subtly different toolchains depending on whether `--enable_bzlmod` is used or not. This is fixed by loading toolchain detection logic from `@bazel_tools` in the module extension.
oquenchil
approved these changes
Jan 11, 2023
Contributor
|
This got rolled back in bc665f9 |
Collaborator
Author
|
It got rolled back, but in the meantime Bazel's toolchain has finally been moved to rules_cc (in Bazel 8). The linked issue could be fixed in rules_cc, but the non-apple_support toolchain for macOS is not actively maintained. |
Contributor
|
Good point, thanks. Commit c2549f6 has added a recent copy of the toolchain configuration code; maybe cc_toolchain_config.bzl is unused now and can be deleted entirely? |
Collaborator
Author
|
Which file are you referring to? That one doesn't exist in the Bazel repo at HEAD. |
Contributor
|
Sorry, I mean https://github.com/bazelbuild/rules_cc/blob/main/cc/private/toolchain/cc_toolchain_config.bzl. That one still has |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The auto-configured toolchains provided by Bazel itself have diverged heavily from the version maintained in this repo. There is no need to maintain this duplication until Starlarkification has progressed succiciently for rules_cc to be the source of truth for them.
This is particularly relevant for Bzlmod, which currently uses the toolchains defined in rules_cc. As a result, Bazel C++ builds will use subtly different toolchains depending on whether
--enable_bzlmodis used or not. This is fixed by loading toolchain detection logic from@bazel_toolsin the module extension.