66# bazel run @//bazel/cargo/wasmtime:crates_vendor
77###############################################################################
88
9- load("@rules_rust//cargo:defs.bzl", "cargo_build_script")
9+ load(
10+ "@rules_rust//cargo:defs.bzl",
11+ "cargo_build_script",
12+ "cargo_toml_env_vars",
13+ )
1014load("@rules_rust//rust:defs.bzl", "rust_library")
1115
1216package(default_visibility = ["//visibility:public"])
1317
18+ cargo_toml_env_vars(
19+ name = "cargo_toml_env_vars",
20+ src = "Cargo.toml",
21+ )
22+
1423rust_library(
1524 name = "ahash",
1625 srcs = glob(
1726 include = ["**/*.rs"],
18- allow_empty = False ,
27+ allow_empty = True ,
1928 ),
2029 compile_data = glob(
2130 include = ["**"],
@@ -31,6 +40,9 @@ rust_library(
3140 ),
3241 crate_root = "src/lib.rs",
3342 edition = "2018",
43+ rustc_env_files = [
44+ ":cargo_toml_env_vars",
45+ ],
3446 rustc_flags = [
3547 "--cap-lints=allow",
3648 ],
@@ -56,15 +68,15 @@ rust_library(
5668 "@rules_rust//rust/platform:aarch64-apple-ios-sim": [
5769 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
5870 ],
59- "@rules_rust//rust/platform:aarch64-fuchsia": [
60- "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
61- ],
6271 "@rules_rust//rust/platform:aarch64-linux-android": [
6372 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
6473 ],
6574 "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [
6675 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
6776 ],
77+ "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [
78+ "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
79+ ],
6880 "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [
6981 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
7082 ],
@@ -74,6 +86,9 @@ rust_library(
7486 "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [
7587 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
7688 ],
89+ "@rules_rust//rust/platform:aarch64-unknown-uefi": [
90+ "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
91+ ],
7792 "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [
7893 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
7994 ],
@@ -104,25 +119,34 @@ rust_library(
104119 "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [
105120 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
106121 ],
122+ "@rules_rust//rust/platform:riscv64gc-unknown-linux-gnu": [
123+ "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
124+ ],
107125 "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [
108126 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
109127 ],
110128 "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [
111129 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
112130 ],
131+ "@rules_rust//rust/platform:wasm32-unknown-emscripten": [
132+ "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
133+ ],
113134 "@rules_rust//rust/platform:wasm32-unknown-unknown": [
114135 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
115136 ],
116- "@rules_rust//rust/platform:wasm32-wasi ": [
137+ "@rules_rust//rust/platform:wasm32-wasip1 ": [
117138 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
118139 ],
119- "@rules_rust//rust/platform:x86_64-apple-darwin ": [
140+ "@rules_rust//rust/platform:wasm32-wasip1-threads ": [
120141 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
121142 ],
122- "@rules_rust//rust/platform:x86_64-apple-ios ": [
143+ "@rules_rust//rust/platform:wasm32-wasip2 ": [
123144 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
124145 ],
125- "@rules_rust//rust/platform:x86_64-fuchsia": [
146+ "@rules_rust//rust/platform:x86_64-apple-darwin": [
147+ "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
148+ ],
149+ "@rules_rust//rust/platform:x86_64-apple-ios": [
126150 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
127151 ],
128152 "@rules_rust//rust/platform:x86_64-linux-android": [
@@ -134,6 +158,9 @@ rust_library(
134158 "@rules_rust//rust/platform:x86_64-unknown-freebsd": [
135159 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
136160 ],
161+ "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [
162+ "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
163+ ],
137164 "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [
138165 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
139166 ],
@@ -143,15 +170,31 @@ rust_library(
143170 "@rules_rust//rust/platform:x86_64-unknown-none": [
144171 "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
145172 ],
173+ "@rules_rust//rust/platform:x86_64-unknown-uefi": [
174+ "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none")))
175+ ],
146176 "//conditions:default": [],
147177 }),
148178)
149179
150180cargo_build_script(
151- name = "ahash_bs ",
181+ name = "_bs ",
152182 srcs = glob(
153183 include = ["**/*.rs"],
154- allow_empty = False,
184+ allow_empty = True,
185+ ),
186+ compile_data = glob(
187+ include = ["**"],
188+ allow_empty = True,
189+ exclude = [
190+ "**/* *",
191+ "**/*.rs",
192+ ".tmp_git_root/**/*",
193+ "BUILD",
194+ "BUILD.bazel",
195+ "WORKSPACE",
196+ "WORKSPACE.bazel",
197+ ],
155198 ),
156199 crate_name = "build_script_build",
157200 crate_root = "build.rs",
@@ -168,6 +211,10 @@ cargo_build_script(
168211 ],
169212 ),
170213 edition = "2018",
214+ pkg_name = "ahash",
215+ rustc_env_files = [
216+ ":cargo_toml_env_vars",
217+ ],
171218 rustc_flags = [
172219 "--cap-lints=allow",
173220 ],
@@ -187,6 +234,6 @@ cargo_build_script(
187234
188235alias(
189236 name = "build_script_build",
190- actual = ":ahash_bs ",
237+ actual = ":_bs ",
191238 tags = ["manual"],
192239)
0 commit comments