6
6
# bazel run @//bazel/cargo:crates_vendor
7
7
###############################################################################
8
8
9
- load(
10
- "@rules_rust//cargo:defs.bzl",
11
- "cargo_build_script",
12
- )
13
-
14
- # buildifier: disable=bzl-visibility
15
- load("@rules_rust//crate_universe/private:selects.bzl", "select_with_or")
16
- load(
17
- "@rules_rust//rust:defs.bzl",
18
- "rust_library",
19
- )
9
+ load("@rules_rust//cargo:defs.bzl", "cargo_build_script")
10
+ load("@rules_rust//rust:defs.bzl", "rust_library")
20
11
21
12
package(default_visibility = ["//visibility:public"])
22
13
@@ -26,287 +17,161 @@ package(default_visibility = ["//visibility:public"])
26
17
27
18
rust_library(
28
19
name = "ahash",
29
- srcs = glob(
30
- include = [
31
- "**/*.rs",
32
- ],
33
- exclude = [
34
- ],
35
- ),
36
- aliases = select({
37
- "//conditions:default": {
38
- },
39
- }),
20
+ srcs = glob(["**/*.rs"]),
40
21
compile_data = glob(
41
22
include = ["**"],
42
23
exclude = [
43
24
"**/* *",
44
- "BUILD.bazel",
45
25
"BUILD",
46
- "WORKSPACE .bazel",
26
+ "BUILD .bazel",
47
27
"WORKSPACE",
28
+ "WORKSPACE.bazel",
48
29
],
49
- ) + select_with_or({
50
- "//conditions:default": [
51
- ],
52
- }),
53
- crate_features = [
54
- ],
30
+ ),
55
31
crate_root = "src/lib.rs",
56
- data = select_with_or({
57
- "//conditions:default": [
58
- ],
59
- }),
60
32
edition = "2018",
61
- proc_macro_deps = [
62
- ] + select({
63
- "//conditions:default": [
64
- ],
65
- }),
66
- rustc_env = {
67
- },
68
- rustc_env_files = select_with_or({
69
- "//conditions:default": [
70
- ],
71
- }),
72
- rustc_flags = [
73
- # In most cases, warnings in 3rd party crates are not interesting as
74
- # they're out of the control of consumers. The flag here silences
75
- # warnings. For more details see:
76
- # https://doc.rust-lang.org/rustc/lints/levels.html
77
- "--cap-lints=allow",
78
- ],
33
+ rustc_flags = ["--cap-lints=allow"],
79
34
tags = [
80
35
"cargo-bazel",
36
+ "crate-name=ahash",
81
37
"manual",
82
38
"noclippy",
83
39
"norustfmt",
84
40
],
85
41
version = "0.8.3",
86
42
deps = [
43
+ "@crates_vendor__ahash-0.8.3//:build_script_build",
44
+ "@crates_vendor__cfg-if-1.0.0//:cfg_if",
87
45
] + select({
88
46
"@rules_rust//rust/platform:aarch64-apple-darwin": [
89
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
90
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
91
47
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
92
48
],
93
49
"@rules_rust//rust/platform:aarch64-apple-ios": [
94
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
95
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
96
50
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
97
51
],
98
52
"@rules_rust//rust/platform:aarch64-apple-ios-sim": [
99
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
100
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
53
+ "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
54
+ ],
55
+ "@rules_rust//rust/platform:aarch64-fuchsia": [
101
56
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
102
57
],
103
58
"@rules_rust//rust/platform:aarch64-linux-android": [
104
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
105
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
106
59
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
107
60
],
108
61
"@rules_rust//rust/platform:aarch64-pc-windows-msvc": [
109
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
110
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
111
62
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
112
63
],
113
64
"@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [
114
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
115
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
116
65
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
117
66
],
118
67
"@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [
119
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
120
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
121
68
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
122
69
],
123
70
"@rules_rust//rust/platform:armv7-linux-androideabi": [
124
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
125
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
126
71
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
127
72
],
128
73
"@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [
129
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
130
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
131
74
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
132
75
],
133
76
"@rules_rust//rust/platform:i686-apple-darwin": [
134
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
135
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
136
77
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
137
78
],
138
79
"@rules_rust//rust/platform:i686-linux-android": [
139
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
140
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
141
80
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
142
81
],
143
82
"@rules_rust//rust/platform:i686-pc-windows-msvc": [
144
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
145
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
146
83
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
147
84
],
148
85
"@rules_rust//rust/platform:i686-unknown-freebsd": [
149
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
150
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
151
86
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
152
87
],
153
88
"@rules_rust//rust/platform:i686-unknown-linux-gnu": [
154
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
155
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
156
89
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
157
90
],
158
91
"@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [
159
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
160
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
161
92
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
162
93
],
163
94
"@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [
164
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
165
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
166
95
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
167
96
],
168
97
"@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [
169
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
170
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
171
98
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
172
99
],
173
100
"@rules_rust//rust/platform:s390x-unknown-linux-gnu": [
174
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
175
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
101
+ "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
102
+ ],
103
+ "@rules_rust//rust/platform:thumbv7em-none-eabi": [
176
104
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
177
105
],
178
106
"@rules_rust//rust/platform:wasm32-unknown-unknown": [
179
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
180
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
181
107
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
182
108
],
183
109
"@rules_rust//rust/platform:wasm32-wasi": [
184
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
185
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
186
110
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
187
111
],
188
112
"@rules_rust//rust/platform:x86_64-apple-darwin": [
189
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
190
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
191
113
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
192
114
],
193
115
"@rules_rust//rust/platform:x86_64-apple-ios": [
194
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
195
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
116
+ "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
117
+ ],
118
+ "@rules_rust//rust/platform:x86_64-fuchsia": [
196
119
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
197
120
],
198
121
"@rules_rust//rust/platform:x86_64-linux-android": [
199
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
200
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
201
122
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
202
123
],
203
124
"@rules_rust//rust/platform:x86_64-pc-windows-msvc": [
204
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
205
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
206
125
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
207
126
],
208
127
"@rules_rust//rust/platform:x86_64-unknown-freebsd": [
209
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
210
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
211
128
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
212
129
],
213
130
"@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [
214
- "@crates_vendor__ahash-0.8.3//:build_script_build", # common dependency
215
- "@crates_vendor__cfg-if-1.0.0//:cfg_if", # common dependency
216
131
"@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
217
132
],
218
- "//conditions:default": [
219
- "@crates_vendor__ahash-0.8.3//:build_script_build",
220
- "@crates_vendor__cfg-if-1.0.0//:cfg_if",
133
+ "@rules_rust//rust/platform:x86_64-unknown-none": [
134
+ "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
221
135
],
136
+ "//conditions:default": [],
222
137
}),
223
138
)
224
139
225
140
cargo_build_script(
226
- # See comment associated with alias. Do not change this name
227
141
name = "ahash_build_script",
228
- srcs = glob(
229
- include = [
230
- "**/*.rs",
231
- ],
232
- exclude = [
233
- ],
234
- ),
235
- aliases = select({
236
- "//conditions:default": {
237
- },
238
- }),
239
- build_script_env = {
240
- },
241
- compile_data = select_with_or({
242
- "//conditions:default": [
243
- ],
244
- }),
245
- crate_features = [
246
- ],
142
+ srcs = glob(["**/*.rs"]),
247
143
crate_name = "build_script_build",
248
144
crate_root = "build.rs",
249
145
data = glob(
250
146
include = ["**"],
251
147
exclude = [
252
148
"**/* *",
253
- "BUILD.bazel",
254
149
"BUILD",
255
- "WORKSPACE .bazel",
150
+ "BUILD .bazel",
256
151
"WORKSPACE",
152
+ "WORKSPACE.bazel",
257
153
],
258
- ) + select_with_or({
259
- "//conditions:default": [
260
- ],
261
- }),
154
+ ),
262
155
edition = "2018",
263
- proc_macro_deps = [
264
- ] + select({
265
- "//conditions:default": [
266
- ],
267
- }),
268
- rustc_env = {
269
- },
270
- rustc_env_files = select_with_or({
271
- "//conditions:default": [
272
- ],
273
- }),
274
156
rustc_flags = [
275
- # In most cases, warnings in 3rd party crates are not interesting as
276
- # they're out of the control of consumers. The flag here silences
277
- # warnings. For more details see:
278
- # https://doc.rust-lang.org/rustc/lints/levels.html
279
157
"--cap-lints=allow",
280
158
],
281
159
tags = [
282
160
"cargo-bazel",
161
+ "crate-name=ahash",
283
162
"manual",
284
163
"noclippy",
285
164
"norustfmt",
286
165
],
287
- tools = select_with_or({
288
- "//conditions:default": [
289
- ],
290
- }),
291
166
version = "0.8.3",
292
167
visibility = ["//visibility:private"],
293
168
deps = [
294
- ] + select({
295
- "//conditions:default": [
296
- "@crates_vendor__version_check-0.9.4//:version_check",
297
- ],
298
- }),
169
+ "@crates_vendor__version_check-0.9.4//:version_check",
170
+ ],
299
171
)
300
172
301
173
alias(
302
- # Because `cargo_build_script` does some invisible target name mutating to
303
- # determine the package and crate name for a build script, the Bazel
304
- # target namename of any build script cannot be the Cargo canonical name
305
- # of `build_script_build` without losing out on having certain Cargo
306
- # environment variables set.
307
174
name = "build_script_build",
308
175
actual = "ahash_build_script",
309
- tags = [
310
- "manual",
311
- ],
176
+ tags = ["manual"],
312
177
)
0 commit comments