Open
Conversation
added 2 commits
February 15, 2024 19:38
We should strive to make our Bazel builds as hermetic as possible. Bazel has support for toolchains (https://bazel.build/extending/toolchains) which I admit are a bit more advanced than I am familiar with. Fortunately, there seems to be a community contribution, for a toolchain that is provided for LLVM. I picked a version that is quite old (11.1) since some of our developers at Google are on 20.04 LTS.
sdasgup3
approved these changes
Feb 15, 2024
Member
sdasgup3
left a comment
There was a problem hiding this comment.
Thanks for the making the bazel build more predictable.
| # For more details, please check https://github.com/bazelbuild/bazel/issues/18958 | ||
| ############################################################################### | ||
| bazel_dep(name = "toolchains_llvm", version = "0.10.3") | ||
| bazel_dep(name = "bazel_skylib", version = "1.3.0") |
Member
There was a problem hiding this comment.
Should we need to change the bazel_skylib version here to 1.4.2
|
We build stablehlo using https://github.com/uber/hermetic_cc_toolchain with great success |
GleasonK
reviewed
Feb 20, 2024
| # Make sure we don't pickup the default CPP toolchains | ||
| build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 | ||
| # Not needed after https://github.com/bazelbuild/bazel/issues/7260 is closed | ||
| build --incompatible_enable_cc_toolchain_resolution No newline at end of file |
Contributor
Author
|
I'm going to pause on this PR -- I should contribute for bazel-contrib/toolchains_llvm#275 so that it's a bit more straightforward for us at Google. |
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.
We should strive to make our Bazel builds as hermetic as possible. Bazel has support for toolchains
(https://bazel.build/extending/toolchains) which I admit are a bit more advanced than I am familiar with.
Fortunately, there seems to be a community contribution, for a toolchain that is provided for LLVM.
I picked a version that is quite old (11.1) since some of our developers at Google are on 20.04 LTS.
Alternate approach is to use something like https://nixos.org/ to bring in toolchains.