Skip to content

Commit 93c5424

Browse files
committed
refactor(llvm): get a smaller distribution
This is a @dzbarsky special :)
1 parent 9b31bb1 commit 93c5424

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

bazel/include/llvm.MODULE.bazel

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,42 @@ execution_cpus = [
2121
"x86_64",
2222
]
2323

24+
# Get a smaller llvm distribution for fetch and repo rule performance
25+
# (Maybe --repo_contents_cache makes this less important someday)
26+
# From https://github.com/dzbarsky/static-clang/releases/tag/v20.1.1-4
27+
dzbarsky_static_clang = {
28+
"macos": {
29+
"aarch64": struct(
30+
sha256 = "a4e65db49d01e4b37abcbc36a03e4f1121fbea63a7c7b58f9d49e3848a4cbdfc", # darwin_arm64.tar.zst
31+
# 3491c3d2062a57216d34a85662942a9f7e24b997a065832e8dbec943c0c1cfc1 darwin_arm64_minimal.tar.zst
32+
),
33+
"x86_64": struct(
34+
sha256 = "b681a621e6d456e20fdfc7626db23edad63f7dabb1442790db3397431688cb41", # darwin_amd64.tar.zst
35+
# 7952368ac99c61a2bfaec147aa2a4055b5ee9cba01789cc78289106e7d0dfe34 darwin_amd64_minimal.tar.zst
36+
),
37+
},
38+
"linux": {
39+
"aarch64": struct(
40+
sha256 = "a71d6686edfb32e455717a1befb013b580a52042915a49f21fc25f83fff59e20", # linux_arm64.tar.zst
41+
# 485f4c6efe55e595d93ae870d5c11fdd2ee532f91f8cfe3da417baa5c0c86ccc linux_arm64_minimal.tar.zst
42+
),
43+
"x86_64": struct(
44+
sha256 = "2096e63a41887a860199aec0f046f82e6469b2cd5ae4e4245a7a111bff4abe5b", # linux_amd64.tar.zst
45+
# 7bfc12074796463443477218f1ba92a5c6a3e6f87959e2ec1a574422a05d84de linux_amd64_minimal.tar.zst
46+
),
47+
},
48+
}
49+
2450
[
2551
[
2652
llvm.toolchain(
2753
name = "llvm_toolchain_{}_{}".format(exec_os, exec_cpu),
2854
exec_arch = exec_cpu,
2955
exec_os = exec_os if exec_os != "macos" else "darwin",
30-
llvm_version = "20.1.2"
56+
sha256 = dzbarsky_static_clang[exec_os][exec_arch].sha256,
57+
strip_prefix = dzbarsky_static_clang[exec_os][exec_arch].strip_prefix,
58+
urls = dzbarsky_static_clang[exec_os][exec_arch].urls,
59+
llvm_version = "20.1.1"
3160
),
3261
llvm.sysroot(
3362
name = "llvm_toolchain_{}_{}".format(exec_os, exec_cpu),

0 commit comments

Comments
 (0)