-
Notifications
You must be signed in to change notification settings - Fork 5
/
WORKSPACE
379 lines (301 loc) · 12.5 KB
/
WORKSPACE
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
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_jar")
http_archive(
name = "build_bazel_apple_support",
sha256 = "02f7456e589471dcfc73f1b9ca7f2c2ea5ca4aea999674abea9aebe818700b6e",
url = "https://github.com/bazelbuild/apple_support/releases/download/1.17.0/apple_support.1.17.0.tar.gz",
)
load(
"@build_bazel_apple_support//lib:repositories.bzl",
"apple_support_dependencies",
)
apple_support_dependencies()
http_archive(
name = "build_bazel_rules_apple",
sha256 = "62847b3f444ce514ae386704a119ad7b29fa6dfb65a38bff4ae239f2389a0429",
url = "https://github.com/bazelbuild/rules_apple/releases/download/3.8.0/rules_apple.3.8.0.tar.gz",
)
http_archive(
name = "rules_java",
sha256 = "27abf8d2b26f4572ba4112ae8eb4439513615018e03a299f85a8460f6992f6a3",
urls = [
"https://github.com/bazelbuild/rules_java/releases/download/6.4.0/rules_java-6.4.0.tar.gz",
],
)
http_archive(
name = "build_bazel_rules_swift",
sha256 = "9919ed1d8dae509645bfd380537ae6501528d8de971caebed6d5185b9970dc4d",
url = "https://github.com/bazelbuild/rules_swift/releases/download/2.1.1/rules_swift.2.1.1.tar.gz",
)
load(
"@build_bazel_rules_swift//swift:repositories.bzl",
"swift_rules_dependencies",
)
swift_rules_dependencies()
load(
"@build_bazel_rules_swift//swift:extras.bzl",
"swift_rules_extra_dependencies",
)
swift_rules_extra_dependencies()
RULES_RUST_VERSION = "0.55.1"
http_archive(
name = "rules_rust",
sha256 = "b191375028448a69532046e901d8e6e627a6b00d58bec79027a05c1d3e090d00",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/%s/rules_rust-%s.tar.gz" % (RULES_RUST_VERSION, RULES_RUST_VERSION)],
)
load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains", "rust_repository_set")
rules_rust_dependencies()
RUST_VERSION = "1.83.0"
rust_register_toolchains(
extra_target_triples = [
"aarch64-apple-ios-sim",
"aarch64-apple-ios",
"aarch64-linux-android",
"armv7-linux-androideabi",
"i686-linux-android",
"x86_64-apple-ios",
"x86_64-linux-android",
],
rustfmt_version = "nightly/2024-09-09",
# We need this shas, since these archives are generated by us and we want to make sure we always use these as opposed
# to the official ones. There is a `rust_std_checksum.sh` script that generates these shas in the `tools` directory.
# For security reasons, we include all shas here to make sure that a malicious actor with access to rust-std-mobile
# can't include a compromised tool.
#
# tl;dr; run e.g. $ ./tools/rust_std_checksum.sh 1.82.0
sha256s = {
"rust-std-" + RUST_VERSION + "-aarch64-apple-ios-sim.tar.gz": "93dfa00fb69caf9772853409d600b03bf274cea82f76be73920c9c9da0e326bf",
"rust-std-" + RUST_VERSION + "-aarch64-apple-ios.tar.gz": "a3d44bc13377a49412aaa6a6b83c21f6b2e3ca7591c03748af08a307adc26793",
"rust-std-" + RUST_VERSION + "-x86_64-apple-ios.tar.gz": "ffa21586b4d414a6ddf43b27390a06463529d1c0c3217e20bfc7e9ad0c40bbf7",
"rust-std-" + RUST_VERSION + "-aarch64-linux-android.tar.gz": "1e402899fc714e1aa09d6930a4047a4dc0fd59607bd362538dfa27e13589517b",
"rust-std-" + RUST_VERSION + "-armv7-linux-androideabi.tar.gz": "48ec8b7a089dd5dec7e16a446ac1e4c5fa8c474bb5bce98df0a557640b319d37",
"rust-std-" + RUST_VERSION + "-i686-linux-android.tar.gz": "0d74f42a65641456c96c82c9dc27a5dec51ee178a3391c9c744370d64acf632f",
"rustc-" + RUST_VERSION + "-aarch64-apple-darwin.tar.gz": "feef342e824def809558cb2d4913fa31258a798a933c13018556bdc76dd2e3b7",
"cargo-" + RUST_VERSION + "-aarch64-apple-darwin.tar.gz": "368bcb0627eed5a235d06cce634904d01396e39ddce253e6fea9831eb711fda0",
"llvm-tools-" + RUST_VERSION + "-aarch64-apple-darwin.tar.gz": "c3fedc1e1e722bffb6df67992de9b7394b5b76d9ce4dee8d7de32dd0db296214",
"rust-std-" + RUST_VERSION + "-aarch64-apple-darwin.tar.gz": "7b9fa15213cf3fae3a4ae80bb2a0ebabdce29599aa381bbb7b12bb5043fe9a04",
"clippy-" + RUST_VERSION + "-aarch64-apple-darwin.tar.gz": "4ce4017695945041bdfd92f6d3f327a9665fb045774a56a451436092524ce38b",
"rustfmt-" + RUST_VERSION + "-aarch64-apple-darwin.tar.gz": "3362689cd250a6db2ad6192aac4550119543a5d7ca0a25453e77f86dbb3f2381",
},
urls = [
# NOTE: `urls` are technically mirrors so we want to make sure we always try our own first then the official ones.
# We'll ensure that the ones we want to serve always come from us by the previous sha256s dictionary. Please ensure
# that the extensions on both of these are the same.
"https://github.com/bitdriftlabs/rust-std-mobile/releases/download/" + RUST_VERSION + "/{}.tar.gz",
# We need this because we only serve std for mobile archs but rustc, clippy, cargo, llvm-tools and even std for
# apple-darwin/linux are served from the official mirror.
"https://static.rust-lang.org/dist/{}.tar.gz",
],
versions = [
RUST_VERSION,
],
)
# This is necessary in order to cross compile for darwin x86_64 from aarch64, done in order to provide x86_64
# dylibs in CI.
rust_repository_set(
name = "rust_macos_x86_64_aarch64_tuple",
edition = "2021",
exec_triple = "aarch64-apple-darwin",
extra_target_triples = ["x86_64-apple-darwin"],
versions = [RUST_VERSION],
)
# This is necessary in order to cross compile for darwin aarch64 from x86_64, done in order to provide aarch64
# dylibs in CI.
rust_repository_set(
name = "rust_macos_aarch64_x86_64_tuple",
edition = "2021",
exec_triple = "x86_64-apple-darwin",
extra_target_triples = ["aarch64-apple-darwin"],
versions = [RUST_VERSION],
)
http_archive(
name = "rules_xcodeproj",
integrity = "sha256-b+AKGo9kJFkcN52bTraVuIu6hKlTEe/Y+LAHkhXs29o=",
url = "https://github.com/MobileNativeFoundation/rules_xcodeproj/releases/download/2.7.0/release.tar.gz",
)
load(
"@rules_xcodeproj//xcodeproj:repositories.bzl",
"xcodeproj_rules_dependencies",
)
xcodeproj_rules_dependencies()
load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()
load(
"@build_bazel_rules_apple//apple:apple.bzl",
"provisioning_profile_repository",
)
provisioning_profile_repository(
name = "local_provisioning_profiles",
)
load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")
rules_java_dependencies()
rules_java_toolchains()
apple_support_dependencies()
load(
"@build_bazel_rules_apple//apple:repositories.bzl",
"apple_rules_dependencies",
)
apple_rules_dependencies()
RULES_ANDROID_VERSION = "0.1.2"
RULES_ANDROID_NDK_SHA = "65aedff0cd728bee394f6fb8e65ba39c4c5efb11b29b766356922d4a74c623f5"
http_archive(
name = "rules_android_ndk",
sha256 = RULES_ANDROID_NDK_SHA,
strip_prefix = "rules_android_ndk-%s" % RULES_ANDROID_VERSION,
url = "https://github.com/bazelbuild/rules_android_ndk/releases/download/v%s/rules_android_ndk-v%s.tar.gz" % (RULES_ANDROID_VERSION, RULES_ANDROID_VERSION),
)
load("//bazel/android:configure.bzl", "android_configure")
android_configure(
name = "local_config_android",
build_tools_version = "34.0.0",
# This value is the minimum supported Android sdk version.
ndk_api_level = 21,
# This is the target SDK version.
sdk_api_level = 34,
)
load("@local_config_android//:android_configure.bzl", "android_workspace")
android_workspace()
load(
"//bazel:capture_repositories.bzl",
"capture_repositories",
)
capture_repositories()
load(
"//bazel:capture_dependencies.bzl",
"jvm_dependencies",
)
jvm_dependencies()
load(
"//bazel:capture_tool_dependencies.bzl",
"tool_dependencies",
)
tool_dependencies()
load("@SwiftLint//bazel:repos.bzl", "swiftlint_repos")
swiftlint_repos()
load("@SwiftLint//bazel:deps.bzl", "swiftlint_deps")
swiftlint_deps()
### Kotlin
load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories", "kotlinc_version")
_KOTLIN_COMPILER_VERSION = "1.9.24"
_KOTLIN_COMPILER_SHA = "eb7b68e01029fa67bc8d060ee54c12018f2c60ddc438cf21db14517229aa693b"
kotlin_repositories(
compiler_release = kotlinc_version(
release = _KOTLIN_COMPILER_VERSION,
sha256 = _KOTLIN_COMPILER_SHA,
),
)
register_toolchains("//:kotlin_toolchain")
load("@rules_detekt//detekt:dependencies.bzl", "rules_detekt_dependencies")
rules_detekt_dependencies()
load("@rules_detekt//detekt:toolchains.bzl", "rules_detekt_toolchains")
rules_detekt_toolchains()
load("@rules_rust//tools/rust_analyzer:deps.bzl", "rust_analyzer_deps")
rust_analyzer_deps()
load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
new_git_repository(
name = "bitdrift_api",
branch = "main",
build_file = "//bazel:BUILD.bitdriftlabs_api",
remote = "https://github.com/bitdriftlabs/api.git",
)
_RULES_ANDROID_VERSION = "0.1.1"
_RULES_ANDROID_SHA = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806"
http_archive(
name = "build_bazel_rules_android",
sha256 = _RULES_ANDROID_SHA,
strip_prefix = "rules_android-{}".format(_RULES_ANDROID_VERSION),
urls = [
"https://github.com/bazelbuild/rules_android/archive/v{}.zip".format(_RULES_ANDROID_VERSION),
],
)
http_archive(
name = "robolectric",
sha256 = "a270fd6fd83f9f024623e787696e6b73c44664b7c95f3d937ed35bf0a94a67ae",
strip_prefix = "robolectric-bazel-4.13",
urls = ["https://github.com/robolectric/robolectric-bazel/releases/download/4.13/robolectric-bazel-4.13.tar.gz"],
)
load("@robolectric//bazel:robolectric.bzl", "robolectric_repositories")
robolectric_repositories()
load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies")
crate_universe_dependencies()
load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository")
crates_repository(
name = "crate_index",
annotations = {
"bd-grpc": [
crate.annotation(
build_script_env = {"SKIP_PROTO_GEN": "1"},
),
],
"bd-pgv": [
crate.annotation(
build_script_env = {"SKIP_PROTO_GEN": "1"},
),
],
"bd-proto": [
crate.annotation(
build_script_env = {"SKIP_PROTO_GEN": "1"},
),
],
# A recent rustix update seems to have broken something here, so manually add in the crates we need to build under Bazel.
"linux-raw-sys": [
crate.annotation(
crate_features = [
"errno",
"std",
"general",
"ioctl",
],
),
],
},
cargo_config = "//:Cargo.toml",
cargo_lockfile = "//:Cargo.lock",
# This trades the chance that the registry gets corrupted for speed when repinning.
isolated = False,
lockfile = "//:Cargo.Bazel.lock",
manifests = [
"//:Cargo.toml",
"//proto:Cargo.toml",
"//platform/jvm:Cargo.toml",
"//test/platform/jvm:Cargo.toml",
"//platform/shared:Cargo.toml",
"//platform/swift/source:Cargo.toml",
"//platform/test_helpers:Cargo.toml",
"//test/platform/pom_checker:Cargo.toml",
"//test/platform/swift/bridging:Cargo.toml",
"//test/benchmark:Cargo.toml",
],
)
load(
"@crate_index//:defs.bzl",
cargo_remote_crate_repositories = "crate_repositories",
)
cargo_remote_crate_repositories()
http_jar(
name = "bazel_diff",
sha256 = "9c4546623a8b9444c06370165ea79a897fcb9881573b18fa5c9ee5c8ba0867e2",
urls = [
"https://github.com/Tinder/bazel-diff/releases/download/4.3.0/bazel-diff_deploy.jar",
],
)
http_archive(
name = "SwiftBenchmark",
build_file = "@//bazel/third_party:SwiftBenchmark.BUILD",
sha256 = "9c5bccfbddaeed7d3aa731118644655c0e550ab2267e1a3238ca0daa06ade0f9",
strip_prefix = "swift-benchmark-0.1.2",
urls = ["https://github.com/google/swift-benchmark/archive/0.1.2.tar.gz"],
)
http_archive(
name = "SwiftArgumentParser",
build_file = "@//bazel/third_party:SwiftArgumentParser.BUILD",
sha256 = "44782ba7180f924f72661b8f457c268929ccd20441eac17301f18eff3b91ce0c",
strip_prefix = "swift-argument-parser-1.2.2",
urls = ["https://github.com/apple/swift-argument-parser/archive/1.2.2.tar.gz"],
)
http_archive(
name = "Difference",
build_file = "@//bazel/third_party:Difference.BUILD",
sha256 = "3a8f2e1f0f347f512da60968dab6bafdafb0afb46c0d0876f23b3dcb7e0ec199",
strip_prefix = "Difference-1.0.2",
urls = ["https://github.com/krzysztofzablocki/Difference/archive/1.0.2.tar.gz"],
)