Skip to content

Commit 97264b7

Browse files
authored
Update wasm_bindgen to use crate universe. (#1398)
* Update wasm_bindgen to use crate universe. * Deleted cargo-raze content and generated crate_universe
1 parent d3197a6 commit 97264b7

File tree

307 files changed

+19222
-13747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

307 files changed

+19222
-13747
lines changed

examples/wasm/BUILD.bazel

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# buildifier: disable=module-docstring
1615
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test")
1716
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_shared_library")
1817
load("@rules_rust//wasm_bindgen:wasm_bindgen.bzl", "rust_wasm_bindgen")
@@ -24,7 +23,7 @@ rust_binary(
2423
srcs = ["main.rs"],
2524
edition = "2018",
2625
deps = [
27-
"@rules_rust//wasm_bindgen/raze:wasm_bindgen",
26+
"@rules_rust//wasm_bindgen/3rdparty:wasm_bindgen",
2827
],
2928
)
3029

@@ -33,7 +32,7 @@ rust_shared_library(
3332
srcs = ["main.rs"],
3433
edition = "2018",
3534
deps = [
36-
"@rules_rust//wasm_bindgen/raze:wasm_bindgen",
35+
"@rules_rust//wasm_bindgen/3rdparty:wasm_bindgen",
3736
],
3837
)
3938

wasm_bindgen/3rdparty/BUILD.bazel

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
2+
load("//crate_universe:defs.bzl", "crate", "crates_vendor")
3+
load("//wasm_bindgen:repositories.bzl", "WASM_BINDGEN_VERSION")
4+
5+
exports_files([
6+
"BUILD.wasm-bindgen-cli.bazel",
7+
])
8+
9+
crates_vendor(
10+
name = "crates_vendor",
11+
annotations = {
12+
"curl-sys": [crate.annotation(
13+
gen_build_script = False,
14+
)],
15+
"log": [crate.annotation(
16+
rustc_flags = [
17+
"--cfg=atomic_cas",
18+
"--cfg=use_std",
19+
],
20+
version = "<5",
21+
)],
22+
"openssl-sys": [crate.annotation(
23+
gen_build_script = False,
24+
rustc_flags = [
25+
# Vendored openssl is 1.0.2m
26+
"--cfg=ossl101",
27+
"--cfg=ossl102",
28+
"--cfg=ossl102f",
29+
"--cfg=ossl102h",
30+
"--cfg=ossl110",
31+
"--cfg=ossl110f",
32+
"--cfg=ossl110g",
33+
"--cfg=ossl111",
34+
"--cfg=ossl111b",
35+
"-l",
36+
"dylib=ssl",
37+
"-l",
38+
"dylib=crypto",
39+
],
40+
)],
41+
"proc-macro2": [crate.annotation(
42+
rustc_flags = ["--cfg=use_proc_macro"],
43+
)],
44+
"unicase": [crate.annotation(
45+
rustc_flags = [
46+
"--cfg=__unicase__iter_cmp",
47+
"--cfg=__unicase__defauler_hasher",
48+
],
49+
)],
50+
},
51+
manifests = ["@rules_rust_wasm_bindgen_cli//:Cargo.toml"],
52+
mode = "remote",
53+
packages = {
54+
"wasm-bindgen": crate.spec(
55+
version = WASM_BINDGEN_VERSION,
56+
),
57+
},
58+
repository_name = "rules_rust_wasm_bindgen",
59+
tags = ["manual"],
60+
)
61+
62+
alias(
63+
name = "wasm_bindgen_cli",
64+
actual = "@rules_rust_wasm_bindgen_cli",
65+
tags = ["manual"],
66+
visibility = ["//visibility:public"],
67+
)
68+
69+
alias(
70+
name = "wasm_bindgen",
71+
actual = "//wasm_bindgen/3rdparty/crates:wasm-bindgen",
72+
visibility = ["//visibility:public"],
73+
)
74+
75+
bzl_library(
76+
name = "bzl_lib",
77+
srcs = glob(["**/*.bzl"]) + [
78+
"//wasm_bindgen/3rdparty/crates:defs.bzl",
79+
"//wasm_bindgen/3rdparty/crates:crates.bzl",
80+
],
81+
visibility = ["//wasm_bindgen:__pkg__"],
82+
)
83+
84+
filegroup(
85+
name = "distro",
86+
srcs = glob([
87+
"*.bzl",
88+
"*.bazel",
89+
]) + [
90+
"//wasm_bindgen/3rdparty/crates:srcs",
91+
],
92+
visibility = ["//wasm_bindgen:__pkg__"],
93+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
load("@rules_rust//rust:defs.bzl", "rust_binary")
2+
load("@rules_rust//wasm_bindgen:repositories.bzl", "WASM_BINDGEN_VERSION")
3+
load("@rules_rust//wasm_bindgen/3rdparty/crates:defs.bzl", "aliases", "all_crate_deps")
4+
5+
package(default_visibility = ["//visibility:public"])
6+
7+
exports_files([
8+
"Cargo.toml",
9+
])
10+
11+
# TODO: Comment on bootstrapping
12+
rust_binary(
13+
name = "wasm-bindgen-cli",
14+
srcs = glob(["**/*.rs"]),
15+
aliases = aliases(),
16+
crate_features = [
17+
],
18+
crate_root = "src/bin/wasm-bindgen.rs",
19+
data = [],
20+
edition = "2018",
21+
proc_macro_deps = all_crate_deps(proc_macro = True),
22+
rustc_flags = [
23+
# Don't produce warnings for this crate
24+
"--cap-lints=allow",
25+
],
26+
version = WASM_BINDGEN_VERSION,
27+
deps = all_crate_deps(),
28+
)
29+
30+
alias(
31+
name = "rules_rust_wasm_bindgen_cli",
32+
actual = ":wasm-bindgen-cli",
33+
tags = ["manual"],
34+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
###############################################################################
2+
# @generated
3+
# This file is auto-generated by the cargo-bazel tool.
4+
#
5+
# DO NOT MODIFY: Local changes may be replaced in future executions.
6+
###############################################################################
7+
8+
load(
9+
"@bazel_skylib//lib:selects.bzl",
10+
"selects",
11+
)
12+
13+
# buildifier: disable=bzl-visibility
14+
load("@rules_rust//crate_universe/private:selects.bzl", "select_with_or")
15+
load(
16+
"@rules_rust//rust:defs.bzl",
17+
"rust_library",
18+
)
19+
20+
package(default_visibility = ["//visibility:public"])
21+
22+
# licenses([
23+
# "TODO", # Unlicense/MIT
24+
# ])
25+
26+
rust_library(
27+
name = "aho_corasick",
28+
srcs = glob(
29+
include = [
30+
"**/*.rs",
31+
],
32+
exclude = [
33+
],
34+
),
35+
aliases = selects.with_or({
36+
"//conditions:default": {
37+
},
38+
}),
39+
compile_data = glob(["**"]) + select_with_or({
40+
"//conditions:default": [
41+
],
42+
}),
43+
crate_features = [
44+
"default",
45+
"std",
46+
],
47+
crate_root = "src/lib.rs",
48+
data = select_with_or({
49+
"//conditions:default": [
50+
],
51+
}),
52+
edition = "2018",
53+
proc_macro_deps = [
54+
] + select_with_or({
55+
"//conditions:default": [
56+
],
57+
}),
58+
rustc_env = {
59+
},
60+
rustc_env_files = select_with_or({
61+
"//conditions:default": [
62+
],
63+
}),
64+
rustc_flags = [
65+
# In most cases, warnings in 3rd party crates are not interesting as
66+
# they're out of the control of consumers. The flag here silences
67+
# warnings. For more details see:
68+
# https://doc.rust-lang.org/rustc/lints/levels.html
69+
"--cap-lints=allow",
70+
],
71+
tags = [
72+
"cargo-bazel",
73+
"manual",
74+
"noclippy",
75+
"norustfmt",
76+
],
77+
version = "0.7.18",
78+
deps = [
79+
] + select_with_or({
80+
"//conditions:default": [
81+
"@rules_rust_wasm_bindgen__memchr-2.5.0//:memchr",
82+
],
83+
}),
84+
)

0 commit comments

Comments
 (0)