forked from bazelbuild/bazel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MODULE.bazel
405 lines (358 loc) · 15.3 KB
/
MODULE.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
"""Bazel build and test dependencies."""
# NOTE: When editing this file, also update the lockfile.
# bazel mod deps --lockfile_mode=update
module(
name = "bazel",
version = "9.0.0-prerelease",
repo_name = "io_bazel",
)
# =========================================
# Bazel module dependencies
# =========================================
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "grpc", version = "1.66.0.bcr.2", repo_name = "com_github_grpc_grpc")
bazel_dep(name = "grpc-java", version = "1.66.0")
bazel_dep(name = "googleapis", version = "0.0.0-20240819-fe8ba054a")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "stardoc", version = "0.7.1", repo_name = "io_bazel_skydoc")
bazel_dep(name = "zstd-jni", version = "1.5.2-3.bcr.1")
bazel_dep(name = "blake3", version = "1.5.1.bcr.1")
bazel_dep(name = "zlib", version = "1.3.1.bcr.3")
bazel_dep(name = "rules_cc", version = "0.0.17")
bazel_dep(name = "rules_java", version = "8.5.1")
bazel_dep(name = "rules_graalvm", version = "0.11.1")
bazel_dep(name = "rules_proto", version = "7.0.2")
bazel_dep(name = "rules_jvm_external", version = "6.5")
bazel_dep(name = "rules_python", version = "0.40.0")
bazel_dep(name = "rules_testing", version = "0.6.0")
bazel_dep(name = "googletest", version = "1.15.2", repo_name = "com_google_googletest")
bazel_dep(name = "with_cfg.bzl", version = "0.6.0")
bazel_dep(name = "abseil-cpp", version = "20240722.0")
bazel_dep(name = "rules_shell", version = "0.2.0")
# repo_name needs to be used, until WORKSPACE mode is to be supported in bazel_tools
bazel_dep(name = "protobuf", version = "29.0", repo_name = "com_google_protobuf")
# TODO: wyv@ - add remoteapis to the BCR
bazel_dep(name = "remoteapis", version = "")
# TODO: wyv@ - eventually this part should be unnecessary (after we fix up the googleapis module
# in the BCR)
switched_rules = use_extension("@googleapis//:extensions.bzl", "switched_rules")
switched_rules.use_languages(
cc = True,
go = True,
grpc = True,
java = True,
python = True,
)
single_version_override(
module_name = "rules_jvm_external",
patch_strip = 1,
patches = ["//third_party:rules_jvm_external_6.5.patch"],
version = "6.5",
)
# TODO(pcloudy): Remove once the next version of rules_graalvm is available.
single_version_override(
module_name = "rules_graalvm",
patch_strip = 1,
patches = ["//third_party:rules_graalvm_fix.patch"],
)
local_path_override(
module_name = "remoteapis",
path = "./third_party/remoteapis",
)
# The following Bazel modules are not direct dependencies for building Bazel,
# but are required for visibility from DIST_ARCHIVE_REPOS in repositories.bzl
bazel_dep(name = "apple_support", version = "1.15.1")
bazel_dep(name = "bazel_features", version = "1.21.0")
bazel_dep(name = "c-ares", version = "1.15.0")
bazel_dep(name = "rules_go", version = "0.48.0")
bazel_dep(name = "rules_kotlin", version = "1.9.6")
# =========================================
# Java dependencies
# =========================================
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
artifacts = [
# keep sorted
"com.beust:jcommander:1.82",
"com.github.ben-manes.caffeine:caffeine:3.0.5",
"com.github.stephenc.jcip:jcip-annotations:1.0-1",
"com.google.api-client:google-api-client:1.35.2",
"com.google.api-client:google-api-client-gson:1.35.2",
"com.google.auth:google-auth-library-credentials:1.6.0",
"com.google.auth:google-auth-library-oauth2-http:1.6.0",
"com.google.auto:auto-common:1.2.1",
"com.google.auto.service:auto-service:1.0",
"com.google.auto.service:auto-service-annotations:1.0.1",
"com.google.auto.value:auto-value:1.11.0",
"com.google.auto.value:auto-value-annotations:1.11.0",
"com.google.code.findbugs:jsr305:3.0.2",
"com.google.code.gson:gson:2.10.1",
"com.google.code.java-allocation-instrumenter:java-allocation-instrumenter:3.3.0",
"com.google.errorprone:error_prone_annotation:2.32.0",
"com.google.errorprone:error_prone_annotations:2.32.0",
"com.google.errorprone:error_prone_check_api:2.32.0",
"com.google.errorprone:error_prone_core:2.32.0",
"com.google.errorprone:error_prone_type_annotations:2.32.0",
"com.google.flogger:flogger:0.5.1",
"com.google.flogger:flogger-system-backend:0.5.1",
"com.google.flogger:google-extensions:0.5.1",
"com.google.guava:failureaccess:1.0.1",
"com.google.guava:guava:33.2.1-jre",
"com.google.http-client:google-http-client:1.42.0",
"com.google.http-client:google-http-client-gson:1.42.0",
"com.google.j2objc:j2objc-annotations:1.3",
"com.google.turbine:turbine:0.8.0",
"com.guardsquare:proguard-base:jar:7.5.0",
"com.ryanharter.auto.value:auto-value-gson-extension:1.3.1",
"com.ryanharter.auto.value:auto-value-gson-factory:1.3.1",
"com.ryanharter.auto.value:auto-value-gson-runtime:1.3.1",
"com.squareup:javapoet:1.12.0",
"commons-collections:commons-collections:3.2.2",
"commons-lang:commons-lang:2.6",
"io.github.java-diff-utils:java-diff-utils:4.12",
"io.grpc:grpc-api:1.66.0",
"io.grpc:grpc-auth:1.66.0",
"io.grpc:grpc-context:1.66.0",
"io.grpc:grpc-core:1.66.0",
"io.grpc:grpc-inprocess:1.66.0",
"io.grpc:grpc-netty:1.66.0",
"io.grpc:grpc-protobuf:1.66.0",
"io.grpc:grpc-protobuf-lite:1.66.0",
"io.grpc:grpc-stub:1.66.0",
"io.netty:netty-buffer:4.1.100.Final",
"io.netty:netty-codec:4.1.100.Final",
"io.netty:netty-codec-http:4.1.100.Final",
"io.netty:netty-codec-http2:4.1.100.Final",
"io.netty:netty-common:4.1.100.Final",
"io.netty:netty-handler:4.1.100.Final",
"io.netty:netty-handler-proxy:4.1.100.Final",
"io.netty:netty-resolver:4.1.100.Final",
"io.netty:netty-resolver-dns:4.1.100.Final",
"io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64:2.0.56.Final",
"io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64:2.0.56.Final",
"io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64:2.0.56.Final",
"io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64:2.0.56.Final",
"io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64:2.0.56.Final",
"io.netty:netty-tcnative-classes:2.0.56.Final",
"io.netty:netty-transport:4.1.100.Final",
"io.netty:netty-transport-classes-epoll:4.1.100.Final",
"io.netty:netty-transport-classes-kqueue:4.1.100.Final",
"io.netty:netty-transport-native-epoll:jar:linux-aarch_64:4.1.100.Final",
"io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.100.Final",
"io.netty:netty-transport-native-kqueue:jar:osx-aarch_64:4.1.100.Final",
"io.netty:netty-transport-native-kqueue:jar:osx-x86_64:4.1.100.Final",
"io.netty:netty-transport-native-unix-common:4.1.100.Final",
"io.netty:netty-transport-native-unix-common:jar:linux-aarch_64:4.1.100.Final",
"io.netty:netty-transport-native-unix-common:jar:linux-x86_64:4.1.100.Final",
"io.netty:netty-transport-native-unix-common:jar:osx-aarch_64:4.1.100.Final",
"io.netty:netty-transport-native-unix-common:jar:osx-x86_64:4.1.100.Final",
"io.reactivex.rxjava3:rxjava:3.1.2",
"it.unimi.dsi:fastutil:7.2.1",
"javax.activation:javax.activation-api:1.2.0",
"javax.annotation:javax.annotation-api:1.3.2",
"javax.inject:javax.inject:1",
"org.apache.commons:commons-compress:1.26.1",
"org.apache.commons:commons-pool2:2.8.0",
"org.apache.tomcat:tomcat-annotations-api:8.0.5",
"org.apache.velocity:velocity:1.7",
"org.checkerframework:checker-qual:3.19.0",
"org.openjdk.jmh:jmh-core:1.37",
"org.openjdk.jmh:jmh-generator-annprocess:1.37",
"org.ow2.asm:asm:9.2",
"org.ow2.asm:asm-analysis:9.2",
"org.ow2.asm:asm-commons:9.2",
"org.ow2.asm:asm-tree:9.2",
"org.ow2.asm:asm-util:9.2",
"org.pcollections:pcollections:3.1.4",
"org.threeten:threeten-extra:1.5.0",
"org.tukaani:xz:1.9",
"org.yaml:snakeyaml:1.28",
"tools.profiler:async-profiler:3.0",
# The following jars are for testing.
# junit is not test only due to //src/java_tools/junitrunner/java/com/google/testing/junit/junit4:runner,
# and hamcrest is a dependency of junit.
"junit:junit:4.13.2",
"org.hamcrest:hamcrest-core:1.3",
],
excluded_artifacts = [
# org.apache.httpcomponents and org.eclipse.jgit:org.eclipse.jgit
# require java.security.jgss module to be embedded in the Bazel binary.
"org.apache.httpcomponents:httpclient",
"org.apache.httpcomponents:httpcore",
"org.eclipse.jgit:org.eclipse.jgit",
],
fail_if_repin_required = True,
lock_file = "//:maven_install.json",
repositories = [
"https://repo1.maven.org/maven2",
],
strict_visibility = True,
)
# Test only maven dependencies
[
maven.artifact(
testonly = True,
artifact = artifact,
group = group,
version = version,
)
for group, artifact, version in [coord.split(":") for coord in [
"com.google.guava:guava-testlib:33.2.1-jre",
"com.google.jimfs:jimfs:1.2",
"com.google.testing.compile:compile-testing:0.18",
"com.google.testparameterinjector:test-parameter-injector:1.16",
"com.google.truth:truth:1.4.0",
"com.google.truth.extensions:truth-java8-extension:1.4.0",
"com.google.truth.extensions:truth-liteproto-extension:1.4.0",
"com.google.truth.extensions:truth-proto-extension:1.4.0",
"org.mockito:mockito-core:5.4.0",
]]
]
use_repo(maven, "maven")
java_toolchains = use_extension("@rules_java//java:extensions.bzl", "toolchains")
use_repo(
java_toolchains,
"local_jdk",
# The following are required for visibility in //src:test_repos
"remote_java_tools",
"remote_java_tools_darwin_arm64",
"remote_java_tools_darwin_x86_64",
"remote_java_tools_linux",
"remote_java_tools_windows",
"remotejdk11_linux",
"remotejdk11_linux_aarch64",
"remotejdk11_linux_ppc64le",
"remotejdk11_linux_s390x",
"remotejdk11_macos",
"remotejdk11_macos_aarch64",
"remotejdk11_win",
"remotejdk11_win_arm64",
"remotejdk17_linux",
"remotejdk17_linux_s390x",
"remotejdk17_macos",
"remotejdk17_macos_aarch64",
"remotejdk17_win",
"remotejdk17_win_arm64",
"remotejdk21_linux",
"remotejdk21_linux_s390x",
"remotejdk21_macos",
"remotejdk21_macos_aarch64",
"remotejdk21_win",
)
# =========================================
# Python dependencies
# =========================================
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
is_default = True,
python_version = "3.11",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "bazel_pip_dev_deps",
python_version = "3.11",
requirements_lock = "//:requirements.txt",
)
use_repo(pip, "bazel_pip_dev_deps")
# =========================================
# Other Bazel build dependencies
# =========================================
bazel_build_deps = use_extension("//:extensions.bzl", "bazel_build_deps")
use_repo(
bazel_build_deps,
"bazel_tools_repo_cache",
"bootstrap_repo_cache",
"debian_bin_deps",
"debian_cc_deps",
"debian_java_deps",
"debian_proto_deps",
"openjdk_linux_aarch64_vanilla",
"openjdk_linux_ppc64le_vanilla",
"openjdk_linux_s390x_vanilla",
"openjdk_linux_vanilla",
"openjdk_macos_aarch64_vanilla",
"openjdk_macos_x86_64_vanilla",
"openjdk_win_arm64_vanilla",
"openjdk_win_vanilla",
"workspace_repo_cache",
)
# Required only by `--extra_toolchains=@local_config_cc//:cc-toolchain-arm64_windows` from .bazelrc
cc_configure = use_extension("@rules_cc//cc:extensions.bzl", "cc_configure_extension")
use_repo(cc_configure, "local_config_cc")
gvm = use_extension("@rules_graalvm//:extensions.bzl", "graalvm")
gvm.graalvm(
name = "graalvm",
distribution = "ce",
java_version = "21",
version = "21.0.2",
)
use_repo(gvm, "graalvm_toolchains")
http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
# DO NOT UPDATE the jq versions, they are used to verify compatibility with old and new versions.
http_file(
name = "jq_linux_amd64",
executable = True,
integrity = "sha256-xrOn19PntwxvUbcGo7kL0BgzhGxU0yyjLwAn8AIm/20=",
urls = ["https://github.com/jqlang/jq/releases/download/jq-1.5/jq-linux64"],
)
http_file(
name = "jq_linux_arm64",
executable = True,
integrity = "sha256-TdLYoGYd8LIvG7mh+YMPBrbzuPfZEhGh7118TwaotKU=",
urls = ["https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-arm64"],
)
http_file(
name = "jq_linux_s390x",
executable = True,
integrity = "sha256-hot8PKdCJKAt22EyYd38LkOxLart1etYNz29x/LF+SQ=",
urls = ["https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-s390x"],
)
http_file(
name = "jq_macos_amd64",
executable = True,
integrity = "sha256-OG6SyYKlb+SFFGjXqTHfyilWDO4wag5mxqG9QGXT2sU=",
urls = ["https://github.com/jqlang/jq/releases/download/jq-1.5/jq-osx-amd64"],
)
http_file(
name = "jq_macos_arm64",
executable = True,
integrity = "sha256-C75hnmY+DeLFUL4v4NJA0HZ5nW+KZStw+gSuqKg2Loo=",
urls = ["https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-macos-arm64"],
)
http_file(
name = "jq_windows_amd64",
executable = True,
integrity = "sha256-6+zYQLpH779mgihoF4zHIaFRBgk396xAbj0xvQFb3pQ=",
urls = ["https://github.com/jqlang/jq/releases/download/jq-1.5/jq-win64.exe"],
)
# =========================================
# Other Bazel testing dependencies
# =========================================
bazel_dep(name = "bazel_ci_rules", version = "1.0.0")
rbe_preconfig = use_repo_rule("@bazel_ci_rules//:rbe_repo.bzl", "rbe_preconfig")
rbe_preconfig(
name = "rbe_ubuntu2004",
toolchain = "ubuntu2004",
)
list_source_repository = use_repo_rule("//src/test/shell/bazel:list_source_repository.bzl", "list_source_repository")
list_source_repository(name = "local_bazel_source_list")
winsdk_configure = use_repo_rule("//src/main/res:winsdk_configure.bzl", "winsdk_configure")
winsdk_configure(name = "local_config_winsdk")
# /usr/local/kythe is setup on Bazel CI machines
local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "local_repository")
local_repository(
name = "kythe_release",
path = "/usr/local/kythe",
)
remote_coverage_tools_extension = use_extension("//tools/test:extensions.bzl", "remote_coverage_tools_extension")
use_repo(remote_coverage_tools_extension, "remote_coverage_tools")
# =========================================
# Register platforms & toolchains
# =========================================
register_execution_platforms("//:default_host_platform")
register_toolchains("@rules_python//python:autodetecting_toolchain")
register_toolchains("@local_config_winsdk//:all")
register_toolchains("//src/main/res:empty_rc_toolchain")
register_toolchains("@graalvm_toolchains//:gvm")