-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add support for LLVM toolchain #2014
base: main
Are you sure you want to change the base?
Conversation
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.
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.
Thanks for the making the bazel build more predictable.
@@ -4,6 +4,7 @@ | |||
# | |||
# 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") |
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.
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 |
# 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 |
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.
newline at eof
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. |
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.