Skip to content

Commit

Permalink
Update cargo-raze to v0.9.2. (#75)
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
  • Loading branch information
PiotrSikora authored Feb 5, 2021
1 parent 57c0051 commit c565a11
Show file tree
Hide file tree
Showing 20 changed files with 188 additions and 35 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
~/.cargo/.crates2.json
~/.cargo/bin
~/.cargo/registry
key: ${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}
key: ${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.raze.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}

- name: Build (wasm32-unknown-unknown)
run: bazelisk --bazelrc=/dev/null build --platforms=@io_bazel_rules_rust//rust/platform:wasm //...
Expand All @@ -75,11 +75,9 @@ jobs:
- name: Format (cargo raze)
run: |
cargo install cargo-raze --version 0.7.0
cp -p bazel/cargo/Cargo.lock .
rm -rf bazel/cargo/
cargo raze --output=bazel/cargo
mv Cargo.lock bazel/cargo/
cargo install cargo-raze --version 0.9.2
cargo raze --generate-lockfile --output=bazel/cargo
git diff --exit-code
stable:
Expand Down Expand Up @@ -200,12 +198,6 @@ jobs:
- name: Run cargo outdated
run: cargo outdated --root-deps-only --exit-code 1

- name: Check freshness of bazel/cargo/Cargo.lock
run: |
cargo generate-lockfile
mv Cargo.lock bazel/cargo/
git diff --exit-code
audit:
runs-on: ubuntu-latest

Expand All @@ -214,5 +206,5 @@ jobs:

- name: Run cargo audit
run: |
cp -p bazel/cargo/Cargo.lock .
cp -p bazel/cargo/Cargo.raze.lock .
cargo audit
10 changes: 1 addition & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,10 @@ opt-level = 3
panic = "abort"

[package.metadata.raze]
package_aliases_dir = "bazel/cargo"
workspace_path = "//bazel/cargo"
genmode = "Remote"

[package.metadata.raze.crates.getrandom.'=0.2.2']
gen_buildrs = true

[package.metadata.raze.crates.libc.'=0.2.85']
gen_buildrs = true

[package.metadata.raze.crates.log.'=0.4.14']
gen_buildrs = true

[[example]]
name = "hello_world"
path = "examples/hello_world.rs"
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@

When updating dependencies, you need to regenerate Bazel `BUILD` files to match updated `Cargo.toml`:
```
cargo install cargo-raze --version 0.7.0
rm -rf bazel/cargo/
cargo generate-lockfile
cargo raze --output=bazel/cargo
mv Cargo.lock bazel/cargo/
cargo install cargo-raze --version 0.9.2
cargo raze --generate-lockfile --output=bazel/cargo
```
8 changes: 8 additions & 0 deletions bazel/cargo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,11 @@ alias(
"manual",
],
)

# Export file for Stardoc support
exports_files(
[
"crates.bzl",
],
visibility = ["//visibility:public"],
)
File renamed without changes.
1 change: 1 addition & 0 deletions bazel/cargo/remote/BUILD.ahash-0.4.7.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ rust_library(
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2018",
rustc_flags = [
"--cap-lints=allow",
Expand Down
1 change: 1 addition & 0 deletions bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ rust_library(
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2015",
rustc_flags = [
"--cap-lints=allow",
Expand Down
1 change: 1 addition & 0 deletions bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ rust_library(
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2018",
rustc_flags = [
"--cap-lints=allow",
Expand Down
1 change: 1 addition & 0 deletions bazel/cargo/remote/BUILD.chrono-0.4.19.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ rust_library(
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2015",
rustc_flags = [
"--cap-lints=allow",
Expand Down
6 changes: 5 additions & 1 deletion bazel/cargo/remote/BUILD.getrandom-0.2.2.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ licenses([
"notice", # MIT from expression "MIT OR Apache-2.0"
])

# Generated Targets# buildifier: disable=load-on-top
# Generated Targets
# buildifier: disable=load-on-top
load(
"@io_bazel_rules_rust//cargo:cargo_build_script.bzl",
"cargo_build_script",
Expand Down Expand Up @@ -71,6 +72,7 @@ cargo_build_script(
}) + selects.with_or({
# cfg(unix)
(
"@io_bazel_rules_rust//rust/platform:aarch64-apple-darwin",
"@io_bazel_rules_rust//rust/platform:aarch64-apple-ios",
"@io_bazel_rules_rust//rust/platform:aarch64-linux-android",
"@io_bazel_rules_rust//rust/platform:aarch64-unknown-linux-gnu",
Expand Down Expand Up @@ -103,6 +105,7 @@ rust_library(
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2018",
rustc_flags = [
"--cap-lints=allow",
Expand Down Expand Up @@ -134,6 +137,7 @@ rust_library(
}) + selects.with_or({
# cfg(unix)
(
"@io_bazel_rules_rust//rust/platform:aarch64-apple-darwin",
"@io_bazel_rules_rust//rust/platform:aarch64-apple-ios",
"@io_bazel_rules_rust//rust/platform:aarch64-linux-android",
"@io_bazel_rules_rust//rust/platform:aarch64-unknown-linux-gnu",
Expand Down
1 change: 1 addition & 0 deletions bazel/cargo/remote/BUILD.hashbrown-0.9.1.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ rust_library(
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2018",
rustc_flags = [
"--cap-lints=allow",
Expand Down
4 changes: 3 additions & 1 deletion bazel/cargo/remote/BUILD.libc-0.2.85.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ licenses([
"notice", # MIT from expression "MIT OR Apache-2.0"
])

# Generated Targets# buildifier: disable=load-on-top
# Generated Targets
# buildifier: disable=load-on-top
load(
"@io_bazel_rules_rust//cargo:cargo_build_script.bzl",
"cargo_build_script",
Expand Down Expand Up @@ -68,6 +69,7 @@ rust_library(
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2015",
rustc_flags = [
"--cap-lints=allow",
Expand Down
4 changes: 3 additions & 1 deletion bazel/cargo/remote/BUILD.log-0.4.14.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ licenses([
"notice", # MIT from expression "MIT OR Apache-2.0"
])

# Generated Targets# buildifier: disable=load-on-top
# Generated Targets
# buildifier: disable=load-on-top
load(
"@io_bazel_rules_rust//cargo:cargo_build_script.bzl",
"cargo_build_script",
Expand Down Expand Up @@ -66,6 +67,7 @@ rust_library(
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2015",
rustc_flags = [
"--cap-lints=allow",
Expand Down
33 changes: 31 additions & 2 deletions bazel/cargo/remote/BUILD.num-integer-0.1.44.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,50 @@ licenses([
])

# Generated Targets
# buildifier: disable=load-on-top
load(
"@io_bazel_rules_rust//cargo:cargo_build_script.bzl",
"cargo_build_script",
)

cargo_build_script(
name = "num_integer_build_script",
srcs = glob(["**/*.rs"]),
build_script_env = {
},
crate_features = [
],
crate_root = "build.rs",
data = glob(["**"]),
edition = "2015",
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"cargo-raze",
"manual",
],
version = "0.1.44",
visibility = ["//visibility:private"],
deps = [
"@raze__autocfg__1_0_1//:autocfg",
],
)

# Unsupported target "average" with type "bench" omitted

# Unsupported target "gcd" with type "bench" omitted

# Unsupported target "roots" with type "bench" omitted

# Unsupported target "build-script-build" with type "custom-build" omitted

rust_library(
name = "num_integer",
srcs = glob(["**/*.rs"]),
crate_features = [
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2015",
rustc_flags = [
"--cap-lints=allow",
Expand All @@ -56,6 +84,7 @@ rust_library(
version = "0.1.44",
# buildifier: leave-alone
deps = [
":num_integer_build_script",
"@raze__num_traits__0_2_14//:num_traits",
],
)
Expand Down
31 changes: 30 additions & 1 deletion bazel/cargo/remote/BUILD.num-traits-0.2.14.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,35 @@ licenses([
])

# Generated Targets
# buildifier: disable=load-on-top
load(
"@io_bazel_rules_rust//cargo:cargo_build_script.bzl",
"cargo_build_script",
)

# Unsupported target "build-script-build" with type "custom-build" omitted
cargo_build_script(
name = "num_traits_build_script",
srcs = glob(["**/*.rs"]),
build_script_env = {
},
crate_features = [
],
crate_root = "build.rs",
data = glob(["**"]),
edition = "2015",
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"cargo-raze",
"manual",
],
version = "0.2.14",
visibility = ["//visibility:private"],
deps = [
"@raze__autocfg__1_0_1//:autocfg",
],
)

rust_library(
name = "num_traits",
Expand All @@ -39,6 +66,7 @@ rust_library(
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2015",
rustc_flags = [
"--cap-lints=allow",
Expand All @@ -50,6 +78,7 @@ rust_library(
version = "0.2.14",
# buildifier: leave-alone
deps = [
":num_traits_build_script",
],
)

Expand Down
1 change: 1 addition & 0 deletions bazel/cargo/remote/BUILD.time-0.1.43.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ rust_library(
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2015",
rustc_flags = [
"--cap-lints=allow",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ rust_library(
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2018",
rustc_flags = [
"--cap-lints=allow",
Expand Down
37 changes: 36 additions & 1 deletion bazel/cargo/remote/BUILD.winapi-0.3.9.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,41 @@ licenses([
])

# Generated Targets
# buildifier: disable=load-on-top
load(
"@io_bazel_rules_rust//cargo:cargo_build_script.bzl",
"cargo_build_script",
)

# Unsupported target "build-script-build" with type "custom-build" omitted
cargo_build_script(
name = "winapi_build_script",
srcs = glob(["**/*.rs"]),
build_script_env = {
},
crate_features = [
"minwinbase",
"minwindef",
"ntdef",
"profileapi",
"std",
"sysinfoapi",
"timezoneapi",
],
crate_root = "build.rs",
data = glob(["**"]),
edition = "2015",
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"cargo-raze",
"manual",
],
version = "0.3.9",
visibility = ["//visibility:private"],
deps = [
],
)

rust_library(
name = "winapi",
Expand All @@ -46,6 +79,7 @@ rust_library(
],
crate_root = "src/lib.rs",
crate_type = "lib",
data = [],
edition = "2015",
rustc_flags = [
"--cap-lints=allow",
Expand All @@ -57,5 +91,6 @@ rust_library(
version = "0.3.9",
# buildifier: leave-alone
deps = [
":winapi_build_script",
],
)
Loading

0 comments on commit c565a11

Please sign in to comment.