Skip to content

Commit f61a142

Browse files
authored
Update cargo-raze to latest and regenerate artifacts. (#47)
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
1 parent adb8fdb commit f61a142

22 files changed

+620
-400
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
7373
- name: Format (cargo raze)
7474
run: |
75-
cargo install cargo-raze --version 0.3.8
75+
cargo install cargo-raze --git https://github.com/google/cargo-raze --rev cb9f85d22b1c81cceb9acaf1fa4336c5fc4e6bff
7676
cp -p bazel/cargo/Cargo.lock .
7777
rm -rf bazel/cargo/
7878
cargo raze --output=bazel/cargo

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ lto = true
2424
opt-level = 3
2525
panic = "abort"
2626

27-
[raze]
27+
[package.metadata.raze]
2828
workspace_path = "//bazel/cargo"
29-
target = "wasm32-unknown-unknown"
3029
genmode = "Remote"
3130

32-
[raze.crates.log.'0.4.11']
31+
[package.metadata.raze.crates.log.'0.4.11']
3332
additional_flags = ["--cfg=atomic_cas"]
3433

3534
[[example]]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030

3131
When updating dependencies, you need to regenerate `BUILD` files to match updated `Cargo.toml`:
3232
```
33-
cargo install cargo-raze --version 0.3.8
33+
cargo install cargo-raze --git https://github.com/google/cargo-raze --rev cb9f85d22b1c81cceb9acaf1fa4336c5fc4e6bff
3434
rm -rf bazel/cargo/
3535
cargo generate-lockfile
3636
cargo raze --output=bazel/cargo
3737
mv Cargo.lock bazel/cargo/
38-
```
38+
```
Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,40 @@
11
"""
2-
cargo-raze workspace build file.
2+
@generated
3+
cargo-raze generated Bazel file.
34
45
DO NOT EDIT! Replaced on runs of cargo-raze
56
"""
7+
68
package(default_visibility = ["//visibility:public"])
79

810
licenses([
9-
"notice" # See individual crates for specific licenses
11+
"notice", # See individual crates for specific licenses
1012
])
13+
14+
# Aliased targets
1115
alias(
1216
name = "chrono",
1317
actual = "@raze__chrono__0_4_19//:chrono",
14-
tags = ["cargo-raze"],
18+
tags = [
19+
"cargo-raze",
20+
"manual",
21+
],
1522
)
23+
1624
alias(
1725
name = "hashbrown",
1826
actual = "@raze__hashbrown__0_9_1//:hashbrown",
19-
tags = ["cargo-raze"],
27+
tags = [
28+
"cargo-raze",
29+
"manual",
30+
],
2031
)
32+
2133
alias(
2234
name = "log",
2335
actual = "@raze__log__0_4_11//:log",
24-
tags = ["cargo-raze"],
36+
tags = [
37+
"cargo-raze",
38+
"manual",
39+
],
2540
)

bazel/cargo/crates.bzl

Lines changed: 62 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,152 @@
11
"""
2-
cargo-raze crate workspace functions
2+
@generated
3+
cargo-raze generated Bazel file.
34
45
DO NOT EDIT! Replaced on runs of cargo-raze
56
"""
6-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
7-
load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
87

9-
def _new_http_archive(name, **kwargs):
10-
if not native.existing_rule(name):
11-
http_archive(name=name, **kwargs)
12-
13-
def _new_git_repository(name, **kwargs):
14-
if not native.existing_rule(name):
15-
new_git_repository(name=name, **kwargs)
8+
load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") # buildifier: disable=load
9+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # buildifier: disable=load
10+
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") # buildifier: disable=load
1611

1712
def raze_fetch_remote_crates():
18-
19-
_new_http_archive(
13+
"""This function defines a collection of repos and should be called in a WORKSPACE file"""
14+
maybe(
15+
http_archive,
2016
name = "raze__ahash__0_4_6",
21-
url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/ahash/ahash-0.4.6.crate",
17+
url = "https://crates.io/api/v1/crates/ahash/0.4.6/download",
2218
type = "tar.gz",
2319
sha256 = "f6789e291be47ace86a60303502173d84af8327e3627ecf334356ee0f87a164c",
2420
strip_prefix = "ahash-0.4.6",
25-
build_file = Label("//bazel/cargo/remote:ahash-0.4.6.BUILD"),
21+
build_file = Label("//bazel/cargo/remote:BUILD.ahash-0.4.6.bazel"),
2622
)
2723

28-
_new_http_archive(
24+
maybe(
25+
http_archive,
2926
name = "raze__autocfg__1_0_1",
30-
url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/autocfg/autocfg-1.0.1.crate",
27+
url = "https://crates.io/api/v1/crates/autocfg/1.0.1/download",
3128
type = "tar.gz",
3229
sha256 = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a",
3330
strip_prefix = "autocfg-1.0.1",
34-
build_file = Label("//bazel/cargo/remote:autocfg-1.0.1.BUILD"),
31+
build_file = Label("//bazel/cargo/remote:BUILD.autocfg-1.0.1.bazel"),
3532
)
3633

37-
_new_http_archive(
34+
maybe(
35+
http_archive,
3836
name = "raze__cfg_if__0_1_10",
39-
url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/cfg-if/cfg-if-0.1.10.crate",
37+
url = "https://crates.io/api/v1/crates/cfg-if/0.1.10/download",
4038
type = "tar.gz",
4139
sha256 = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822",
4240
strip_prefix = "cfg-if-0.1.10",
43-
build_file = Label("//bazel/cargo/remote:cfg-if-0.1.10.BUILD"),
41+
build_file = Label("//bazel/cargo/remote:BUILD.cfg-if-0.1.10.bazel"),
4442
)
4543

46-
_new_http_archive(
44+
maybe(
45+
http_archive,
4746
name = "raze__chrono__0_4_19",
48-
url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/chrono/chrono-0.4.19.crate",
47+
url = "https://crates.io/api/v1/crates/chrono/0.4.19/download",
4948
type = "tar.gz",
5049
sha256 = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73",
5150
strip_prefix = "chrono-0.4.19",
52-
build_file = Label("//bazel/cargo/remote:chrono-0.4.19.BUILD"),
51+
build_file = Label("//bazel/cargo/remote:BUILD.chrono-0.4.19.bazel"),
5352
)
5453

55-
_new_http_archive(
54+
maybe(
55+
http_archive,
5656
name = "raze__hashbrown__0_9_1",
57-
url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/hashbrown/hashbrown-0.9.1.crate",
57+
url = "https://crates.io/api/v1/crates/hashbrown/0.9.1/download",
5858
type = "tar.gz",
5959
sha256 = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04",
6060
strip_prefix = "hashbrown-0.9.1",
61-
build_file = Label("//bazel/cargo/remote:hashbrown-0.9.1.BUILD"),
61+
build_file = Label("//bazel/cargo/remote:BUILD.hashbrown-0.9.1.bazel"),
6262
)
6363

64-
_new_http_archive(
64+
maybe(
65+
http_archive,
6566
name = "raze__libc__0_2_80",
66-
url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/libc/libc-0.2.80.crate",
67+
url = "https://crates.io/api/v1/crates/libc/0.2.80/download",
6768
type = "tar.gz",
6869
sha256 = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614",
6970
strip_prefix = "libc-0.2.80",
70-
build_file = Label("//bazel/cargo/remote:libc-0.2.80.BUILD"),
71+
build_file = Label("//bazel/cargo/remote:BUILD.libc-0.2.80.bazel"),
7172
)
7273

73-
_new_http_archive(
74+
maybe(
75+
http_archive,
7476
name = "raze__log__0_4_11",
75-
url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/log/log-0.4.11.crate",
77+
url = "https://crates.io/api/v1/crates/log/0.4.11/download",
7678
type = "tar.gz",
7779
sha256 = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b",
7880
strip_prefix = "log-0.4.11",
79-
build_file = Label("//bazel/cargo/remote:log-0.4.11.BUILD"),
81+
build_file = Label("//bazel/cargo/remote:BUILD.log-0.4.11.bazel"),
8082
)
8183

82-
_new_http_archive(
84+
maybe(
85+
http_archive,
8386
name = "raze__num_integer__0_1_44",
84-
url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/num-integer/num-integer-0.1.44.crate",
87+
url = "https://crates.io/api/v1/crates/num-integer/0.1.44/download",
8588
type = "tar.gz",
8689
sha256 = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db",
8790
strip_prefix = "num-integer-0.1.44",
88-
build_file = Label("//bazel/cargo/remote:num-integer-0.1.44.BUILD"),
91+
build_file = Label("//bazel/cargo/remote:BUILD.num-integer-0.1.44.bazel"),
8992
)
9093

91-
_new_http_archive(
94+
maybe(
95+
http_archive,
9296
name = "raze__num_traits__0_2_14",
93-
url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/num-traits/num-traits-0.2.14.crate",
97+
url = "https://crates.io/api/v1/crates/num-traits/0.2.14/download",
9498
type = "tar.gz",
9599
sha256 = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290",
96100
strip_prefix = "num-traits-0.2.14",
97-
build_file = Label("//bazel/cargo/remote:num-traits-0.2.14.BUILD"),
101+
build_file = Label("//bazel/cargo/remote:BUILD.num-traits-0.2.14.bazel"),
98102
)
99103

100-
_new_http_archive(
104+
maybe(
105+
http_archive,
101106
name = "raze__time__0_1_44",
102-
url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/time/time-0.1.44.crate",
107+
url = "https://crates.io/api/v1/crates/time/0.1.44/download",
103108
type = "tar.gz",
104109
sha256 = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255",
105110
strip_prefix = "time-0.1.44",
106-
build_file = Label("//bazel/cargo/remote:time-0.1.44.BUILD"),
111+
build_file = Label("//bazel/cargo/remote:BUILD.time-0.1.44.bazel"),
107112
)
108113

109-
_new_http_archive(
114+
maybe(
115+
http_archive,
110116
name = "raze__wasi__0_10_0_wasi_snapshot_preview1",
111-
url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/wasi/wasi-0.10.0+wasi-snapshot-preview1.crate",
117+
url = "https://crates.io/api/v1/crates/wasi/0.10.0+wasi-snapshot-preview1/download",
112118
type = "tar.gz",
113119
sha256 = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f",
114120
strip_prefix = "wasi-0.10.0+wasi-snapshot-preview1",
115-
build_file = Label("//bazel/cargo/remote:wasi-0.10.0+wasi-snapshot-preview1.BUILD"),
121+
build_file = Label("//bazel/cargo/remote:BUILD.wasi-0.10.0+wasi-snapshot-preview1.bazel"),
116122
)
117123

118-
_new_http_archive(
124+
maybe(
125+
http_archive,
119126
name = "raze__winapi__0_3_9",
120-
url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/winapi/winapi-0.3.9.crate",
127+
url = "https://crates.io/api/v1/crates/winapi/0.3.9/download",
121128
type = "tar.gz",
122129
sha256 = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419",
123130
strip_prefix = "winapi-0.3.9",
124-
build_file = Label("//bazel/cargo/remote:winapi-0.3.9.BUILD"),
131+
build_file = Label("//bazel/cargo/remote:BUILD.winapi-0.3.9.bazel"),
125132
)
126133

127-
_new_http_archive(
134+
maybe(
135+
http_archive,
128136
name = "raze__winapi_i686_pc_windows_gnu__0_4_0",
129-
url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/winapi-i686-pc-windows-gnu/winapi-i686-pc-windows-gnu-0.4.0.crate",
137+
url = "https://crates.io/api/v1/crates/winapi-i686-pc-windows-gnu/0.4.0/download",
130138
type = "tar.gz",
131139
sha256 = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6",
132140
strip_prefix = "winapi-i686-pc-windows-gnu-0.4.0",
133-
build_file = Label("//bazel/cargo/remote:winapi-i686-pc-windows-gnu-0.4.0.BUILD"),
141+
build_file = Label("//bazel/cargo/remote:BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel"),
134142
)
135143

136-
_new_http_archive(
144+
maybe(
145+
http_archive,
137146
name = "raze__winapi_x86_64_pc_windows_gnu__0_4_0",
138-
url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/winapi-x86_64-pc-windows-gnu/winapi-x86_64-pc-windows-gnu-0.4.0.crate",
147+
url = "https://crates.io/api/v1/crates/winapi-x86_64-pc-windows-gnu/0.4.0/download",
139148
type = "tar.gz",
140149
sha256 = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f",
141150
strip_prefix = "winapi-x86_64-pc-windows-gnu-0.4.0",
142-
build_file = Label("//bazel/cargo/remote:winapi-x86_64-pc-windows-gnu-0.4.0.BUILD"),
151+
build_file = Label("//bazel/cargo/remote:BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel"),
143152
)
144-
Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,62 @@
11
"""
2+
@generated
23
cargo-raze crate build file.
34

45
DO NOT EDIT! Replaced on runs of cargo-raze
56
"""
6-
package(default_visibility = [
7-
# Public for visibility by "@raze__crate__version//" targets.
8-
#
9-
# Prefer access through "//bazel/cargo", which limits external
10-
# visibility to explicit Cargo.toml dependencies.
11-
"//visibility:public",
12-
])
13-
14-
licenses([
15-
"notice", # MIT from expression "MIT OR Apache-2.0"
16-
])
177

8+
# buildifier: disable=load
189
load(
1910
"@io_bazel_rules_rust//rust:rust.bzl",
20-
"rust_library",
2111
"rust_binary",
12+
"rust_library",
2213
"rust_test",
2314
)
2415

16+
# buildifier: disable=load
17+
load("@bazel_skylib//lib:selects.bzl", "selects")
18+
19+
package(default_visibility = [
20+
# Public for visibility by "@raze__crate__version//" targets.
21+
#
22+
# Prefer access through "//bazel/cargo", which limits external
23+
# visibility to explicit Cargo.toml dependencies.
24+
"//visibility:public",
25+
])
26+
27+
licenses([
28+
"notice", # MIT from expression "MIT OR Apache-2.0"
29+
])
30+
31+
# Generated Targets
2532

2633
# Unsupported target "ahash" with type "bench" omitted
2734

35+
# Unsupported target "map" with type "bench" omitted
36+
2837
rust_library(
2938
name = "ahash",
30-
crate_type = "lib",
31-
deps = [
32-
],
3339
srcs = glob(["**/*.rs"]),
40+
crate_features = [
41+
],
3442
crate_root = "src/lib.rs",
43+
crate_type = "lib",
3544
edition = "2018",
3645
rustc_flags = [
3746
"--cap-lints=allow",
3847
],
48+
tags = [
49+
"cargo-raze",
50+
"manual",
51+
],
3952
version = "0.4.6",
40-
tags = ["cargo-raze"],
41-
crate_features = [
53+
# buildifier: leave-alone
54+
deps = [
4255
],
4356
)
4457

4558
# Unsupported target "bench" with type "test" omitted
46-
# Unsupported target "map" with type "bench" omitted
59+
4760
# Unsupported target "map_tests" with type "test" omitted
61+
4862
# Unsupported target "nopanic" with type "test" omitted

0 commit comments

Comments
 (0)