@@ -28,9 +28,13 @@ bazel_dep(name = "rules_rust", version = "0.54.1")
28
28
bazel_dep (name = "rules_foreign_cc" , version = "0.13.0" )
29
29
bazel_dep (name = "abseil-cpp" , version = "20240722.0" , repo_name = "com_google_absl" )
30
30
31
+ # TODO: Remove when protobuf is released with a version of rules_python that supports 8.x
32
+ bazel_dep (name = "rules_python" , version = "1.0.0" )
33
+
31
34
# As a workaround for https://github.com/bazelbuild/rules_foreign_cc/issues/1018.
32
35
rules_foreign_cc_tools = use_extension ("@rules_foreign_cc//foreign_cc:extensions.bzl" , "tools" )
33
36
use_repo (rules_foreign_cc_tools , ninja_mac = "ninja_1.12.1_mac" )
37
+
34
38
register_toolchains (
35
39
"//:ninja_mac_arm64_toolchain" ,
36
40
)
@@ -66,28 +70,29 @@ LLVM_VERSIONS = {
66
70
67
71
llvm .toolchain (
68
72
name = "llvm_toolchain" ,
69
- llvm_versions = LLVM_VERSIONS ,
70
73
cxx_standard = {"" : "c++17" },
74
+ llvm_versions = LLVM_VERSIONS ,
71
75
)
72
76
llvm .extra_target_compatible_with (
73
77
name = "llvm_toolchain" ,
74
78
constraints = ["@//:cxx17" ],
75
79
)
76
80
use_repo (llvm , "llvm_toolchain" , "llvm_toolchain_llvm" )
81
+
77
82
register_toolchains ("@llvm_toolchain//:all" )
78
83
79
84
llvm .toolchain (
80
85
name = "llvm_toolchain_cxx20" ,
81
- llvm_versions = LLVM_VERSIONS ,
82
86
cxx_standard = {"" : "c++20" },
87
+ llvm_versions = LLVM_VERSIONS ,
83
88
)
84
89
llvm .extra_target_compatible_with (
85
90
name = "llvm_toolchain_cxx20" ,
86
91
constraints = ["//:cxx20" ],
87
92
)
88
93
use_repo (llvm , "llvm_toolchain_cxx20" )
89
- register_toolchains ("@llvm_toolchain_cxx20//:all" )
90
94
95
+ register_toolchains ("@llvm_toolchain_cxx20//:all" )
91
96
92
97
# Example toolchain with user provided URLs.
93
98
# TODO(siddharthab): Add test.
@@ -132,6 +137,7 @@ llvm.toolchain(
132
137
absolute_paths = True ,
133
138
llvm_versions = LLVM_VERSIONS ,
134
139
)
140
+
135
141
# We can share the downloaded LLVM distribution with the first configuration.
136
142
llvm .toolchain_root (
137
143
name = "llvm_toolchain_with_absolute_paths" ,
@@ -144,6 +150,7 @@ llvm.toolchain(
144
150
name = "llvm_toolchain_with_system_llvm" ,
145
151
llvm_versions = LLVM_VERSIONS ,
146
152
)
153
+
147
154
# For this toolchain to work, the LLVM distribution archive would need to be unpacked here.
148
155
llvm .toolchain_root (
149
156
name = "llvm_toolchain_with_system_llvm" ,
@@ -156,35 +163,38 @@ llvm.toolchain(
156
163
name = "llvm_toolchain_with_sysroot" ,
157
164
llvm_versions = LLVM_VERSIONS ,
158
165
)
166
+
159
167
# We can share the downloaded LLVM distribution with the first configuration.
160
168
llvm .toolchain_root (
161
169
name = "llvm_toolchain_with_sysroot" ,
162
170
label = "@llvm_toolchain_llvm//:BUILD" ,
163
171
)
164
172
llvm .sysroot (
165
173
name = "llvm_toolchain_with_sysroot" ,
166
- targets = ["linux-x86_64" ],
167
174
label = "@org_chromium_sysroot_linux_x64//:sysroot" ,
175
+ targets = ["linux-x86_64" ],
168
176
)
169
177
use_repo (llvm , "llvm_toolchain_with_sysroot" )
170
-
171
178
llvm .toolchain (
172
179
name = "llvm_toolchain_linux_exec" ,
180
+ exec_arch = "amd64" ,
181
+ # Option 2:
182
+ # distribution = "clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04.tar.xz",
183
+ exec_os = "linux" ,
173
184
llvm_version = "17.0.6" ,
174
185
# Option 1:
175
186
sha256 = {"" : "884ee67d647d77e58740c1e645649e29ae9e8a6fe87c1376be0f3a30f3cc9ab3" },
176
187
strip_prefix = {"" : "clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04" },
177
188
urls = {"" : ["https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04.tar.xz" ]},
178
- # Option 2:
179
- # distribution = "clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04.tar.xz",
180
- exec_os = "linux" ,
181
- exec_arch = "amd64" ,
182
189
)
183
190
use_repo (llvm , "llvm_toolchain_linux_exec" )
184
191
185
192
# Toolchain example for WebAssembly.
186
193
llvm .toolchain (
187
194
name = "llvm_toolchain_wasm" ,
195
+ libclang_rt = {
196
+ "@libclang_rt_wasm32//:libclang_rt.builtins-wasm32.a" : "wasm32-unknown-unknown/libclang_rt.builtins.a" ,
197
+ },
188
198
# WebAssembly tests use a separate (newer) version of LLVM to exercise
189
199
# support for experimental features such as wasm64.
190
200
llvm_versions = {
@@ -195,9 +205,6 @@ llvm.toolchain(
195
205
"wasm32" : "libc" ,
196
206
"wasm64" : "none" ,
197
207
},
198
- libclang_rt = {
199
- "@libclang_rt_wasm32//:libclang_rt.builtins-wasm32.a" : "wasm32-unknown-unknown/libclang_rt.builtins.a" ,
200
- },
201
208
)
202
209
llvm .sysroot (
203
210
name = "llvm_toolchain_wasm" ,
@@ -209,17 +216,20 @@ llvm.sysroot(
209
216
label = "@wasi_sdk_sysroots//empty" ,
210
217
targets = ["wasm64" ],
211
218
)
212
-
213
219
use_repo (llvm , "llvm_toolchain_wasm" )
220
+
214
221
register_toolchains ("@llvm_toolchain_wasm//:all" )
215
222
216
223
wasi_sdk_sysroots = use_repo_rule ("//wasm:wasi_sdk.bzl" , "wasi_sdk_sysroots" )
224
+
217
225
wasi_sdk_sysroots (name = "wasi_sdk_sysroots" )
218
226
219
227
libclang_rt_wasm32 = use_repo_rule ("//wasm:wasi_sdk.bzl" , "libclang_rt_wasm32" )
228
+
220
229
libclang_rt_wasm32 (name = "libclang_rt_wasm32" )
221
230
222
231
http_archive = use_repo_rule ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
232
+
223
233
# This sysroot is used by github.com/vsco/bazel-toolchains.
224
234
http_archive (
225
235
name = "org_chromium_sysroot_linux_x64" ,
0 commit comments