-
Notifications
You must be signed in to change notification settings - Fork 45
/
WORKSPACE.bzlmod
219 lines (188 loc) · 6.72 KB
/
WORKSPACE.bzlmod
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
# Part of the Crubit project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# https://github.com/bazelbuild/bazel-skylib/releases/tag/1.3.0
http_archive(
name = "platforms",
sha256 = "3a561c99e7bdbe9173aa653fd579fe849f1d8d67395780ab4770b1f381431d51",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz",
"https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz",
],
)
http_archive(
name = "bazel_skylib",
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
],
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
http_archive(
name = "rules_license",
sha256 = "6157e1e68378532d0241ecd15d3c45f6e5cfd98fc10846045509fb2a7cc9e381",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz",
"https://github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz",
],
)
http_archive(
name = "rules_rust",
patch_args = [
"-p1",
],
patches = [
# copybara:strip_begin(Google-internal)
# The patch is based on the copybara transformations here:
# http://google3/third_party/bazel_rules/rules_rust/copy.bara.sky;l=398;rcl=549936350
# copybara:strip_end
"@@//bazel/rules_rust:attach_rust_bindings_from_cc_aspect.patch",
],
sha256 = "4a9cb4fda6ccd5b5ec393b2e944822a62e050c7c06f1ea41607f14c4fdec57a2",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.25.1/rules_rust-v0.25.1.tar.gz"],
)
load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")
rules_rust_dependencies()
RUST_TOOLCHAIN_VERSION = "nightly/2024-07-20"
rust_register_toolchains(
allocator_library = "@//common:rust_allocator_shims",
dev_components = True,
edition = "2021",
versions = [
RUST_TOOLCHAIN_VERSION,
],
)
load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies")
crate_universe_dependencies()
load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository", "render_config")
# after changing `packages`, re-generate Cargo.lock:
# CARGO_BAZEL_REPIN=1 bazelisk sync --only=crate_index
crates_repository(
name = "crate_index",
cargo_lockfile = "//:Cargo.lock",
packages = {
"anyhow": crate.spec(
version = ">0.0.0",
),
"clap": crate.spec(
features = [
"derive",
"color",
"derive",
"env",
"std",
"string",
"suggestions",
],
version = ">=4.3.12",
),
"either": crate.spec(
version = ">1.0.0",
),
"flagset": crate.spec(
version = ">0.0.0",
),
"googletest": crate.spec(
version = ">0.0.0",
),
"itertools": crate.spec(
version = ">0.0.0",
),
"maplit": crate.spec(
version = ">0.0.0",
),
"pin-project": crate.spec(
version = ">0.0.0",
),
"proc-macro2": crate.spec(
version = ">0.0.0",
),
"quote": crate.spec(
version = ">0.0.0",
),
"regex": crate.spec(
version = ">=1.6.0",
),
"salsa": crate.spec(
version = ">0.0.0",
),
"serde": crate.spec(
features = [
"derive",
"rc",
],
version = ">0.0.0",
),
"serde_json": crate.spec(
version = ">0.0.0",
),
"static_assertions": crate.spec(
version = ">0.0.0",
),
"syn": crate.spec(
features = ["extra-traits"],
version = ">0.0.0",
),
"tempfile": crate.spec(
version = "=3.4.0",
),
"unicode-ident": crate.spec(
version = ">0.0.0",
),
},
render_config = render_config(
default_package_name = "",
),
rust_version = RUST_TOOLCHAIN_VERSION,
)
load("@crate_index//:defs.bzl", "crate_repositories")
crate_repositories()
# https://google.github.io/googletest/quickstart-bazel.html
http_archive(
name = "com_google_googletest",
sha256 = "7fda611bceb5a793824a3c63ecbf68d2389e70c38f5763e9b1d415ca24912f44",
strip_prefix = "googletest-1336c4b6d1a6f4bc6beebccb920e5ff858889292",
urls = ["https://github.com/google/googletest/archive/1336c4b6d1a6f4bc6beebccb920e5ff858889292.zip"],
)
# zstd is a dependency of llvm. See https://reviews.llvm.org/D143344#4232172
http_archive(
name = "llvm_zstd",
build_file = "@llvm-raw//utils/bazel/third_party_build:zstd.BUILD",
sha256 = "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0",
strip_prefix = "zstd-1.5.2",
urls = [
"https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz",
],
)
# @llvm-project//llvm:Support needs zlib.
http_archive(
name = "llvm_zlib",
build_file = "@llvm-raw//utils/bazel/third_party_build:zlib-ng.BUILD",
sha256 = "e36bb346c00472a1f9ff2a0a4643e590a254be6379da7cddd9daeb9a7f296731",
strip_prefix = "zlib-ng-2.0.7",
urls = [
"https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.7.zip",
],
)
# Create the "loader" repository, then use it to configure the desired LLVM
# repository. For more details, see the comment in bazel/llvm.bzl.
load("//bazel:llvm.bzl", "llvm_loader_repository", "llvm_loader_repository_dependencies")
llvm_loader_repository_dependencies()
llvm_loader_repository(name = "llvm-loader")
load("@llvm-loader//:llvm.bzl", "llvm_repository")
llvm_repository(name = "llvm-project")
# protobuf (used in nullability/; crubit proper should not depend on it)
http_archive(
name = "rules_proto",
sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
strip_prefix = "rules_proto-5.3.0-21.7",
urls = [
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz",
],
)
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
rules_proto_dependencies()
rules_proto_toolchains()