0.10.1
Minimum bazel version: 6.0.0 (6.1.0 if using blzmod)
If you're using bzlmod
, add the following to MODULE.bazel
:
bazel_dep(name = "toolchains_llvm", version = "0.10.1")
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
llvm.toolchain(
llvm_version = "16.0.0",
)
use_repo(llvm, "llvm_toolchain")
# use_repo(llvm, "llvm_toolchain_llvm") # if you depend on specific tools in scripts
register_toolchains("@llvm_toolchain//:all")
To not using bzlmod
, include this section in your WORKSPACE
:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "toolchains_llvm",
sha256 = "c32e6fc537e78f17e88c9cfe6c06a0db5e43b8098862dd65a62e44c9a4ea2cce",
strip_prefix = "toolchains_llvm-0.10.1",
canonical_id = "0.10.1",
url = "https://github.com/grailbio/bazel-toolchain/releases/download/0.10.1/toolchains_llvm-0.10.1.tar.gz",
)
load("@toolchains_llvm//toolchain:deps.bzl", "bazel_toolchain_dependencies")
bazel_toolchain_dependencies()
load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain")
llvm_toolchain(
name = "llvm_toolchain",
llvm_version = "16.0.0",
)
load("@toolchains_llvm//:toolchains.bzl", "llvm_register_toolchains")
llvm_register_toolchains()
And add the following section to your .bazelrc file:
# Not needed after https://github.com/bazelbuild/bazel/issues/7260 is closed
build --incompatible_enable_cc_toolchain_resolution
# For macOS only:
# Needed for Bazel versions before 7.
# Without this, one can use `--linkopt='-undefined dynamic_lookup'`.
# This feature is intentionally not supported on macOS.
build --features=-supports_dynamic_linker
# Not needed after https://github.com/grailbio/bazel-toolchain/pull/229.
build --features=-libtool
Full Changelog: 0.10.0...0.10.1