Skip to content

Commit 8e7e3ba

Browse files
author
Jalal El Mansouri
authored
Partially raze wasm_bindgen to remove out_dir_tar (#358)
1 parent a2c2ba5 commit 8e7e3ba

File tree

2 files changed

+70
-119
lines changed

2 files changed

+70
-119
lines changed

wasm_bindgen/raze/remote/mime_guess-1.8.7.BUILD

Lines changed: 28 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,85 +3,67 @@ cargo-raze crate build file.
33

44
DO NOT EDIT! Replaced on runs of cargo-raze
55
"""
6-
76
package(default_visibility = [
8-
# Public for visibility by "@raze__crate__version//" targets.
9-
#
10-
# Prefer access through "//wasm_bindgen/raze", which limits external
11-
# visibility to explicit Cargo.toml dependencies.
12-
"//visibility:public",
7+
# Public for visibility by "@raze__crate__version//" targets.
8+
#
9+
# Prefer access through "//wasm_bindgen/raze", which limits external
10+
# visibility to explicit Cargo.toml dependencies.
11+
"//visibility:public",
1312
])
1413

1514
licenses([
16-
"notice", # "MIT"
15+
"notice", # MIT from expression "MIT"
1716
])
1817

1918
load(
2019
"@io_bazel_rules_rust//rust:rust.bzl",
21-
"rust_binary",
2220
"rust_library",
21+
"rust_binary",
2322
"rust_test",
2423
)
2524

26-
rust_binary(
25+
load(
26+
"@io_bazel_rules_rust//cargo:cargo_build_script.bzl",
27+
"cargo_build_script",
28+
)
29+
30+
cargo_build_script(
2731
name = "mime_guess_build_script",
2832
srcs = glob(["**/*.rs"]),
29-
crate_features = [
30-
],
3133
crate_root = "build.rs",
32-
data = glob(["*"]),
3334
edition = "2015",
35+
deps = [
36+
"@raze__phf_codegen__0_7_24//:phf_codegen",
37+
"@raze__unicase__1_4_2//:unicase",
38+
],
3439
rustc_flags = [
3540
"--cap-lints=allow",
3641
],
42+
crate_features = [
43+
],
44+
data = glob(["**"]),
3745
version = "1.8.7",
3846
visibility = ["//visibility:private"],
39-
deps = [
40-
"@raze__phf_codegen__0_7_24//:phf_codegen",
41-
"@raze__unicase__1_4_2//:unicase",
42-
],
4347
)
4448

45-
genrule(
46-
name = "mime_guess_build_script_executor",
47-
srcs = glob([
48-
"*",
49-
"**/*.rs",
50-
]),
51-
outs = ["mime_guess_out_dir_outputs.tar.gz"],
52-
cmd = "mkdir -p $$(dirname $@)/mime_guess_out_dir_outputs/;" +
53-
" (export CARGO_MANIFEST_DIR=\"$$PWD/$$(dirname $(location :Cargo.toml))\";" +
54-
# TODO(acmcarther): This needs to be revisited as part of the cross compilation story.
55-
# See also: https://github.com/google/cargo-raze/pull/54
56-
" export TARGET='x86_64-unknown-linux-gnu';" +
57-
" export RUST_BACKTRACE=1;" +
58-
" export OUT_DIR=$$PWD/$$(dirname $@)/mime_guess_out_dir_outputs;" +
59-
" export BINARY_PATH=\"$$PWD/$(location :mime_guess_build_script)\";" +
60-
" export OUT_TAR=$$PWD/$@;" +
61-
" cd $$(dirname $(location :Cargo.toml)) && $$BINARY_PATH && tar -czf $$OUT_TAR -C $$OUT_DIR .)",
62-
tags = ["no-sandbox"],
63-
tools = [
64-
":mime_guess_build_script",
65-
],
66-
)
6749

6850
rust_library(
6951
name = "mime_guess",
70-
srcs = glob(["**/*.rs"]),
71-
crate_features = [
52+
crate_type = "lib",
53+
deps = [
54+
":mime_guess_build_script",
55+
"@raze__mime__0_2_6//:mime",
56+
"@raze__phf__0_7_24//:phf",
57+
"@raze__unicase__1_4_2//:unicase",
7258
],
59+
srcs = glob(["**/*.rs"]),
7360
crate_root = "src/lib.rs",
74-
crate_type = "lib",
7561
edition = "2015",
76-
out_dir_tar = ":mime_guess_build_script_executor",
7762
rustc_flags = [
7863
"--cap-lints=allow",
7964
],
8065
version = "1.8.7",
81-
deps = [
82-
"@raze__mime__0_2_6//:mime",
83-
"@raze__phf__0_7_24//:phf",
84-
"@raze__unicase__1_4_2//:unicase",
66+
crate_features = [
8567
],
8668
)
8769

wasm_bindgen/raze/remote/syn-0.15.43.BUILD

Lines changed: 42 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -3,91 +3,75 @@ cargo-raze crate build file.
33

44
DO NOT EDIT! Replaced on runs of cargo-raze
55
"""
6-
76
package(default_visibility = [
8-
# Public for visibility by "@raze__crate__version//" targets.
9-
#
10-
# Prefer access through "//wasm_bindgen/raze", which limits external
11-
# visibility to explicit Cargo.toml dependencies.
12-
"//visibility:public",
7+
# Public for visibility by "@raze__crate__version//" targets.
8+
#
9+
# Prefer access through "//wasm_bindgen/raze", which limits external
10+
# visibility to explicit Cargo.toml dependencies.
11+
"//visibility:public",
1312
])
1413

1514
licenses([
16-
"restricted", # "MIT OR Apache-2.0"
15+
"notice", # MIT from expression "MIT OR Apache-2.0"
1716
])
1817

1918
load(
2019
"@io_bazel_rules_rust//rust:rust.bzl",
21-
"rust_binary",
2220
"rust_library",
21+
"rust_binary",
2322
"rust_test",
2423
)
2524

26-
rust_binary(
25+
load(
26+
"@io_bazel_rules_rust//cargo:cargo_build_script.bzl",
27+
"cargo_build_script",
28+
)
29+
30+
cargo_build_script(
2731
name = "syn_build_script",
2832
srcs = glob(["**/*.rs"]),
29-
crate_features = [
30-
"clone-impls",
31-
"default",
32-
"derive",
33-
"extra-traits",
34-
"full",
35-
"parsing",
36-
"printing",
37-
"proc-macro",
38-
"proc-macro2",
39-
"quote",
40-
"visit",
41-
],
4233
crate_root = "build.rs",
43-
data = glob(["*"]),
4434
edition = "2015",
35+
deps = [
36+
],
4537
rustc_flags = [
4638
"--cap-lints=allow",
4739
],
40+
crate_features = [
41+
"clone-impls",
42+
"default",
43+
"derive",
44+
"extra-traits",
45+
"full",
46+
"parsing",
47+
"printing",
48+
"proc-macro",
49+
"quote",
50+
"visit",
51+
],
52+
data = glob(["**"]),
4853
version = "0.15.43",
4954
visibility = ["//visibility:private"],
50-
deps = [
51-
],
5255
)
5356

54-
genrule(
55-
name = "syn_build_script_executor",
56-
srcs = glob([
57-
"*",
58-
"**/*.rs",
59-
]),
60-
outs = ["syn_out_dir_outputs.tar.gz"],
61-
cmd = "mkdir -p $$(dirname $@)/syn_out_dir_outputs/;" +
62-
" (export CARGO_MANIFEST_DIR=\"$$PWD/$$(dirname $(location :Cargo.toml))\";" +
63-
# TODO(acmcarther): This needs to be revisited as part of the cross compilation story.
64-
# See also: https://github.com/google/cargo-raze/pull/54
65-
" export TARGET='x86_64-unknown-linux-gnu';" +
66-
" export RUST_BACKTRACE=1;" +
67-
" export CARGO_FEATURE_CLONE_IMPLS=1;" +
68-
" export CARGO_FEATURE_DEFAULT=1;" +
69-
" export CARGO_FEATURE_DERIVE=1;" +
70-
" export CARGO_FEATURE_EXTRA_TRAITS=1;" +
71-
" export CARGO_FEATURE_FULL=1;" +
72-
" export CARGO_FEATURE_PARSING=1;" +
73-
" export CARGO_FEATURE_PRINTING=1;" +
74-
" export CARGO_FEATURE_PROC_MACRO=1;" +
75-
" export CARGO_FEATURE_PROC_MACRO2=1;" +
76-
" export CARGO_FEATURE_QUOTE=1;" +
77-
" export CARGO_FEATURE_VISIT=1;" +
78-
" export OUT_DIR=$$PWD/$$(dirname $@)/syn_out_dir_outputs;" +
79-
" export BINARY_PATH=\"$$PWD/$(location :syn_build_script)\";" +
80-
" export OUT_TAR=$$PWD/$@;" +
81-
" cd $$(dirname $(location :Cargo.toml)) && $$BINARY_PATH && tar -czf $$OUT_TAR -C $$OUT_DIR .)",
82-
tags = ["no-sandbox"],
83-
tools = [
84-
":syn_build_script",
85-
],
86-
)
8757

8858
rust_library(
8959
name = "syn",
60+
crate_type = "lib",
61+
deps = [
62+
":syn_build_script",
63+
"@raze__proc_macro2__0_4_30//:proc_macro2",
64+
"@raze__quote__0_6_12//:quote",
65+
"@raze__unicode_xid__0_1_0//:unicode_xid",
66+
],
9067
srcs = glob(["**/*.rs"]),
68+
crate_root = "src/lib.rs",
69+
edition = "2015",
70+
rustc_flags = [
71+
"--cap-lints=allow",
72+
"--cfg=syn_can_call_macro_by_path",
73+
],
74+
version = "0.15.43",
9175
crate_features = [
9276
"clone-impls",
9377
"default",
@@ -97,24 +81,9 @@ rust_library(
9781
"parsing",
9882
"printing",
9983
"proc-macro",
100-
"proc-macro2",
10184
"quote",
10285
"visit",
10386
],
104-
crate_root = "src/lib.rs",
105-
crate_type = "lib",
106-
edition = "2015",
107-
out_dir_tar = ":syn_build_script_executor",
108-
rustc_flags = [
109-
"--cap-lints=allow",
110-
"--cfg=syn_can_call_macro_by_path",
111-
],
112-
version = "0.15.43",
113-
deps = [
114-
"@raze__proc_macro2__0_4_30//:proc_macro2",
115-
"@raze__quote__0_6_12//:quote",
116-
"@raze__unicode_xid__0_1_0//:unicode_xid",
117-
],
11887
)
11988

12089
# Unsupported target "test_asyncness" with type "test" omitted

0 commit comments

Comments
 (0)