66# bazel run @//bazel/cargo:crates_vendor
77###############################################################################
88
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")
2011
2112package(default_visibility = ["//visibility:public"])
2213
@@ -26,287 +17,161 @@ package(default_visibility = ["//visibility:public"])
2617
2718rust_library(
2819 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"]),
4021 compile_data = glob(
4122 include = ["**"],
4223 exclude = [
4324 "**/* *",
44- "BUILD.bazel",
4525 "BUILD",
46- "WORKSPACE .bazel",
26+ "BUILD .bazel",
4727 "WORKSPACE",
28+ "WORKSPACE.bazel",
4829 ],
49- ) + select_with_or({
50- "//conditions:default": [
51- ],
52- }),
53- crate_features = [
54- ],
30+ ),
5531 crate_root = "src/lib.rs",
56- data = select_with_or({
57- "//conditions:default": [
58- ],
59- }),
6032 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"],
7934 tags = [
8035 "cargo-bazel",
36+ "crate-name=ahash",
8137 "manual",
8238 "noclippy",
8339 "norustfmt",
8440 ],
8541 version = "0.8.3",
8642 deps = [
43+ "@crates_vendor__ahash-0.8.3//:build_script_build",
44+ "@crates_vendor__cfg-if-1.0.0//:cfg_if",
8745 ] + select({
8846 "@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
9147 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
9248 ],
9349 "@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
9650 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
9751 ],
9852 "@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": [
10156 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
10257 ],
10358 "@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
10659 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
10760 ],
10861 "@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
11162 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
11263 ],
11364 "@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
11665 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
11766 ],
11867 "@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
12168 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
12269 ],
12370 "@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
12671 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
12772 ],
12873 "@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
13174 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
13275 ],
13376 "@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
13677 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
13778 ],
13879 "@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
14180 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
14281 ],
14382 "@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
14683 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
14784 ],
14885 "@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
15186 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
15287 ],
15388 "@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
15689 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
15790 ],
15891 "@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
16192 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
16293 ],
16394 "@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
16695 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
16796 ],
16897 "@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
17198 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
17299 ],
173100 "@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": [
176104 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
177105 ],
178106 "@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
181107 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
182108 ],
183109 "@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
186110 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
187111 ],
188112 "@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
191113 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
192114 ],
193115 "@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": [
196119 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
197120 ],
198121 "@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
201122 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
202123 ],
203124 "@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
206125 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
207126 ],
208127 "@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
211128 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
212129 ],
213130 "@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
216131 "@crates_vendor__once_cell-1.18.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
217132 ],
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")))
221135 ],
136+ "//conditions:default": [],
222137 }),
223138)
224139
225140cargo_build_script(
226- # See comment associated with alias. Do not change this name
227141 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"]),
247143 crate_name = "build_script_build",
248144 crate_root = "build.rs",
249145 data = glob(
250146 include = ["**"],
251147 exclude = [
252148 "**/* *",
253- "BUILD.bazel",
254149 "BUILD",
255- "WORKSPACE .bazel",
150+ "BUILD .bazel",
256151 "WORKSPACE",
152+ "WORKSPACE.bazel",
257153 ],
258- ) + select_with_or({
259- "//conditions:default": [
260- ],
261- }),
154+ ),
262155 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- }),
274156 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
279157 "--cap-lints=allow",
280158 ],
281159 tags = [
282160 "cargo-bazel",
161+ "crate-name=ahash",
283162 "manual",
284163 "noclippy",
285164 "norustfmt",
286165 ],
287- tools = select_with_or({
288- "//conditions:default": [
289- ],
290- }),
291166 version = "0.8.3",
292167 visibility = ["//visibility:private"],
293168 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+ ],
299171)
300172
301173alias(
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.
307174 name = "build_script_build",
308175 actual = "ahash_build_script",
309- tags = [
310- "manual",
311- ],
176+ tags = ["manual"],
312177)
0 commit comments