Minified Clang toolchain distribution
This repository contains Github Actions to build and package the clang C toolchains for consumption with Bazel and optimized for buildbuddy CI.
We build a Clang toolchain from the upstream source llvm-project
with CMake and Ninja.
Generally following the instructions from:
The resulting toolchain is designed for consumption with toolchains_llvm
and to be a drop-in replacement for the toolchains provided by the upstream llvm-project
. Similar to Rust, we also compress
the package with zstd
.
Just add the following to your MODULE.bazel file.
bazel_dep(name = "toolchains_llvm", version = "1.2.0", dev_dependency = True)
LLVM_VERSIONS = {
"": "19.1.6",
}
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
llvm.toolchain(
name = "llvm_toolchain",
llvm_versions = LLVM_VERSIONS,
sha256 = {
"linux-x86_64": "a23d498699b22944be3a5a0470c0cfb229f801bbc1e460432617f8d08d0d57ea",
"linux-aarch64": "",
},
stdlib = {
"linux-x86_64": "stdc++",
"linux-aarch64": "stdc++",
},
urls = {
"linux-x86_64": ["https://github.com/marvin-hansen/buildbuddy-clang/releases/download/clang-19.1.6-x86-64/linux_x86_64.tar.zst"],
"linux-aarch64": ["https://github.com/marvin-hansen/buildbuddy-clang/releases/download/clang-19.1.6-arm64/linux_aarch64.tar.zst"],
},
)
use_repo(llvm, "llvm_toolchain", "llvm_toolchain_llvm")
register_toolchains("@llvm_toolchain//:all")
We also build a sysroot for the toolchain for intel and Arm.
This repo started out as a fork from https://github.com/MaterializeInc/toolchains
Special thanks to @ParkMyCar for open sourcing and maintaining the said repo.
Also, special thanks to @scasagrande for his work on sysroot building for llvm toolchain.
Apache-2.0, as the original repo.