Skip to content

fix: Update cargo-raze -> crate_universe #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"

- name: Format (addlicense)
run: addlicense -check .
run: addlicense -ignore "bazel/cargo/*/remote/**" -check .

buildifier:
name: check format with buildifier
Expand All @@ -78,29 +78,23 @@ jobs:
- name: Format (buildifier)
run: find . -name "WORKSPACE" -o -name "*BUILD*" -o -name "*.bzl" | xargs -n1 buildifier -mode=check

cargo_raze:
name: check format with cargo-raze
rules_rust:
name: check format with rules_rust

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install dependencies
run: cargo install cargo-raze --version 0.14.1

- name: Format (bazel query)
run: |
bazel query 'deps(//bazel/cargo/...)'

- name: Format (cargo raze)
working-directory: bazel/cargo
- name: Format (rules_rust)
run: |
cd wasmsign && cargo raze && cd ..
cd wasmtime && cargo raze && cd ..
# Ignore manual changes in "errno" and "rustix" crates until fixed in cargo-raze.
# See: https://github.com/google/cargo-raze/issues/451
git diff --exit-code -- ':!wasmtime/remote/BUILD.errno-0.*.bazel' ':!wasmtime/remote/BUILD.rustix-0.*.bazel'
bazel run //bazel/cargo/wasmsign:crates_vendor
bazel run //bazel/cargo/wasmtime:crates_vendor
git diff --exit-code

clang_format:
name: check format with clang-format
Expand Down Expand Up @@ -134,7 +128,7 @@ jobs:
with:
path: |
~/.cache/bazel
key: clang_tidy-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/dependencies.bzl', 'bazel/repositories.bzl', 'bazel/cargo/wasmsign/crates.bzl') }}
key: clang_tidy-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/dependencies.bzl', 'bazel/repositories.bzl', 'bazel/cargo/wasmsign/remote/crates.bzl') }}

- name: Bazel build
run: >
Expand Down
63 changes: 30 additions & 33 deletions bazel/cargo/wasmsign/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,39 +1,36 @@
"""
@generated
cargo-raze generated Bazel file.
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

DO NOT EDIT! Replaced on runs of cargo-raze
"""
load("@rules_rust//crate_universe:defs.bzl", "crates_vendor")

package(default_visibility = ["//visibility:public"])

licenses([
"notice", # See individual crates for specific licenses
])

# Aliased targets
alias(
name = "cargo_bin_wasmsign",
actual = "@wasmsign__wasmsign__0_1_2//:cargo_bin_wasmsign",
tags = [
"cargo-raze",
"manual",
],
)

alias(
name = "wasmsign",
actual = "@wasmsign__wasmsign__0_1_2//:wasmsign",
tags = [
"cargo-raze",
"manual",
],
)

# Export file for Stardoc support
exports_files(
[
"crates.bzl",
"Cargo.toml",
"Cargo.Bazel.lock",
],
visibility = ["//visibility:public"],
)

# Run this target to regenerate cargo_lockfile and vendor_path/*.
# $ bazelisk run bazel/cargo/wasmsign:crates_vendor -- --repin
crates_vendor(
name = "crates_vendor",
cargo_lockfile = ":Cargo.Bazel.lock",
generate_binaries = True,
generate_target_compatible_with = False,
manifests = [":Cargo.toml"],
mode = "remote",
repository_name = "cu", # shorten generated paths for Windows...
tags = ["manual"],
vendor_path = "remote",
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3

[[package]]
name = "ansi_term"
version = "0.12.1"
Expand All @@ -11,9 +13,9 @@ dependencies = [

[[package]]
name = "anyhow"
version = "1.0.53"
version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0"
checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"

[[package]]
name = "atty"
Expand All @@ -34,9 +36,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"

[[package]]
name = "byteorder"
version = "1.4.3"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"

[[package]]
name = "cfg-if"
Expand All @@ -59,20 +61,27 @@ dependencies = [
"vec_map",
]

[[package]]
name = "ct-codecs"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3b7eb4404b8195a9abb6356f4ac07d8ba267045c8d6d220ac4dc992e6cc75df"

[[package]]
name = "ed25519-compact"
version = "1.0.8"
version = "1.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "302ea73924517e9952bf08b505536f757e28dca8372cbf8b20723a0e2bab6c01"
checksum = "e18997d4604542d0736fae2c5ad6de987f0a50530cbcc14a7ce5a685328a252d"
dependencies = [
"ct-codecs",
"getrandom",
]

[[package]]
name = "getrandom"
version = "0.2.4"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c"
checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
dependencies = [
"cfg-if",
"libc",
Expand All @@ -90,15 +99,15 @@ dependencies = [

[[package]]
name = "hmac-sha512"
version = "1.1.1"
version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b2ce076d8070f292037093a825343f6341fe0ce873268c2477e2f49abd57b10"
checksum = "e4ce1f4656bae589a3fab938f9f09bf58645b7ed01a2c5f8a3c238e01a4ef78a"

[[package]]
name = "libc"
version = "0.2.114"
version = "0.2.155"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0005d08a8f7b65fb8073cb697aa0b12b631ed251ce73d862ce50eeb52ce3b50"
checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"

[[package]]
name = "parity-wasm"
Expand All @@ -108,18 +117,18 @@ checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92"

[[package]]
name = "proc-macro2"
version = "1.0.36"
version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029"
checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
dependencies = [
"unicode-xid",
"unicode-ident",
]

[[package]]
name = "quote"
version = "1.0.15"
version = "1.0.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145"
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
dependencies = [
"proc-macro2",
]
Expand All @@ -132,13 +141,13 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"

[[package]]
name = "syn"
version = "1.0.86"
version = "2.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b"
checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
dependencies = [
"proc-macro2",
"quote",
"unicode-xid",
"unicode-ident",
]

[[package]]
Expand All @@ -152,35 +161,35 @@ dependencies = [

[[package]]
name = "thiserror"
version = "1.0.30"
version = "1.0.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417"
checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
dependencies = [
"thiserror-impl",
]

[[package]]
name = "thiserror-impl"
version = "1.0.30"
version = "1.0.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
dependencies = [
"proc-macro2",
"quote",
"syn",
]

[[package]]
name = "unicode-width"
version = "0.1.9"
name = "unicode-ident"
version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"

[[package]]
name = "unicode-xid"
version = "0.2.2"
name = "unicode-width"
version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d"

[[package]]
name = "vec_map"
Expand All @@ -190,14 +199,14 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"

[[package]]
name = "wasi"
version = "0.10.2+wasi-snapshot-preview1"
version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"

[[package]]
name = "wasmsign"
version = "0.1.2"
source = "git+https://github.com/jedisct1/wasmsign#dfbc0aabe81885d59e88e667aa9c1e6a62dfe9cc"
source = "git+https://github.com/jedisct1/wasmsign#6a6ef1c6f99063a5bd4ef9efc2ee41c5ea8f4f96"
dependencies = [
"anyhow",
"byteorder",
Expand Down
12 changes: 3 additions & 9 deletions bazel/cargo/wasmsign/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ path = "fake_lib.rs"
[dependencies]
wasmsign = {git = "https://github.com/jedisct1/wasmsign", revision = "fa4d5598f778390df09be94232972b5b865a56b8"}

[package.metadata.raze]
rust_rules_workspace_name = "rules_rust"
gen_workspace_prefix = "wasmsign"
genmode = "Remote"
package_aliases_dir = "."
workspace_path = "//bazel/cargo/wasmsign"

[package.metadata.raze.crates.wasmsign.'*']
extra_aliased_targets = ["cargo_bin_wasmsign"]
# Ready to upgrade to wasmsign2:
# Which generates: //bazel/cargo/wasmsign/remote:wasmsign2-cli__wasmsign2
#wasmsign2-cli = {git = "https://github.com/wasm-signatures/wasmsign2", revision = "07c60eee7f4c655d5a91404f5a9ffd97316d01f1"}
Loading
Loading