Releases: FBorowiec/hermetic_clang_toolchain
Releases · FBorowiec/hermetic_clang_toolchain
v1.0.1
bazel_dep(name = "hermetic_clang_toolchain", version = "1.0.1")
hermetic_clang = use_extension("@hermetic_clang_toolchain//clang_toolchain:hermetic_clang.bzl", "hermetic_clang_extension")
hermetic_clang.use(version = "21.1.0")
use_repo(hermetic_clang, "hermetic_clang")
register_toolchains("@hermetic_clang_toolchain//clang_toolchain:hermetic_clang_toolchain")v1.0.0
Hermetic Clang Toolchain for Bazel
A fully hermetic Clang/LLVM toolchain for Bazel that produces completely
self-contained, statically linked binaries with zero host system dependencies.
Hermeticity
- hermetic: Produces statically linked binaries with no host dependencies
- clang 18.1.8: Uses pre-built- LLVM/Clangcompiler
- musl libc:- c/c++standard libraries fetched from Alpine repo
- libstdc++ 14.2.0: Alpine's C++ standard library built for- musl
- statically linked: All binaries are statically linked (no dynamic dependencies)
Usage
Add this to your MODULE.bazel:
bazel_dep(name = "hermetic_clang_toolchain", version = "1.0.0")
hermetic_clang = use_extension("@hermetic_clang_toolchain//clang_toolchain:hermetic_clang.bzl", "hermetic_clang_extension")
use_repo(hermetic_clang, "hermetic_clang_18_1_8")
register_toolchains("@hermetic_clang_toolchain//clang_toolchain:hermetic_clang_toolchain")Add this to your .bazelrc:
# Disable default C++ toolchain detection
build --incompatible_enable_cc_toolchain_resolution
build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
# Use hermetic clang toolchain
build --extra_toolchains=@hermetic_clang_toolchain//clang_toolchain:hermetic_clang_toolchain