From 7c96bc2b925e3519ef7e6cd6b9c978105dc9c970 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Sat, 6 Mar 2021 02:36:00 +0000 Subject: [PATCH 1/2] Update cargo-raze to v0.11.0. While there, add support for generating BUILD files with Bazel using @cargo_raze//:raze. Signed-off-by: Piotr Sikora --- .github/workflows/rust.yml | 8 +++----- Cargo.toml | 1 - README.md | 4 ++-- WORKSPACE | 6 +++++- bazel/cargo/remote/BUILD.ahash-0.4.7.bazel | 6 +++--- bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel | 6 +++--- bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel | 6 +++--- bazel/cargo/remote/BUILD.chrono-0.4.19.bazel | 6 +++--- .../cargo/remote/BUILD.getrandom-0.2.2.bazel | 7 ++++--- .../cargo/remote/BUILD.hashbrown-0.9.1.bazel | 6 +++--- bazel/cargo/remote/BUILD.libc-0.2.88.bazel | 7 ++++--- bazel/cargo/remote/BUILD.log-0.4.14.bazel | 7 ++++--- .../remote/BUILD.num-integer-0.1.44.bazel | 7 ++++--- .../remote/BUILD.num-traits-0.2.14.bazel | 7 ++++--- bazel/cargo/remote/BUILD.time-0.1.43.bazel | 6 +++--- ...D.wasi-0.10.2+wasi-snapshot-preview1.bazel | 6 +++--- bazel/cargo/remote/BUILD.winapi-0.3.9.bazel | 7 ++++--- ...ILD.winapi-i686-pc-windows-gnu-0.4.0.bazel | 7 ++++--- ...D.winapi-x86_64-pc-windows-gnu-0.4.0.bazel | 7 ++++--- bazel/dependencies.bzl | 8 ++++++++ bazel/repositories.bzl | 20 ++++++++++++++++++- 21 files changed, 90 insertions(+), 55 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 89e5164d..33ac6797 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -60,10 +60,10 @@ jobs: 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=@rules_rust//rust/platform:wasm //... + run: bazelisk --noworkspace_rc build --platforms=@rules_rust//rust/platform:wasm //... - name: Build (wasm32-wasi) - run: bazelisk --bazelrc=/dev/null build --platforms=@rules_rust//rust/platform:wasi //... + run: bazelisk --noworkspace_rc build --platforms=@rules_rust//rust/platform:wasi //... - name: Format (buildifier) run: | @@ -76,9 +76,7 @@ jobs: - name: Format (cargo raze) run: | mv bazel/cargo/Cargo.raze.lock Cargo.lock - rm -rf bazel/cargo/ - cargo install cargo-raze --version 0.9.2 - cargo raze --output=bazel/cargo + bazelisk --noworkspace_rc run @cargo_raze//:raze -- --manifest-path=$(pwd)/Cargo.toml mv Cargo.lock bazel/cargo/Cargo.raze.lock git diff --exit-code diff --git a/Cargo.toml b/Cargo.toml index 0790cc5f..dd0937ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,6 @@ opt-level = 3 panic = "abort" [package.metadata.raze] -rust_rules_workspace_name = "rules_rust" package_aliases_dir = "bazel/cargo" workspace_path = "//bazel/cargo" genmode = "Remote" diff --git a/README.md b/README.md index bb9b5a32..bbe3a5d1 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,6 @@ When updating dependencies, you need to regenerate Bazel `BUILD` files to match updated `Cargo.toml`: ``` -cargo install cargo-raze --version 0.9.2 -cargo raze --generate-lockfile --output=bazel/cargo +cargo install cargo-raze --version 0.11.0 +cargo raze --generate-lockfile ``` diff --git a/WORKSPACE b/WORKSPACE index 4261aeed..62705f86 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -4,6 +4,10 @@ load("@proxy_wasm_rust_sdk//bazel:repositories.bzl", "proxy_wasm_rust_sdk_reposi proxy_wasm_rust_sdk_repositories() -load("@proxy_wasm_rust_sdk//bazel:dependencies.bzl", "proxy_wasm_rust_sdk_dependencies") +load("@proxy_wasm_rust_sdk//bazel:dependencies.bzl", "proxy_wasm_rust_sdk_cargo_raze_dependencies", "proxy_wasm_rust_sdk_dependencies") proxy_wasm_rust_sdk_dependencies() + +# Needed only when using @cargo_raze//:raze to generate BUILD files in //bazel/cargo. + +proxy_wasm_rust_sdk_cargo_raze_dependencies() diff --git a/bazel/cargo/remote/BUILD.ahash-0.4.7.bazel b/bazel/cargo/remote/BUILD.ahash-0.4.7.bazel index 3646eb2d..656cc999 100644 --- a/bazel/cargo/remote/BUILD.ahash-0.4.7.bazel +++ b/bazel/cargo/remote/BUILD.ahash-0.4.7.bazel @@ -5,6 +5,9 @@ cargo-raze crate build file. DO NOT EDIT! Replaced on runs of cargo-raze """ +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + # buildifier: disable=load load( "@rules_rust//rust:rust.bzl", @@ -13,9 +16,6 @@ load( "rust_test", ) -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - package(default_visibility = [ # Public for visibility by "@raze__crate__version//" targets. # diff --git a/bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel b/bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel index d348f9b4..22a819b6 100644 --- a/bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel +++ b/bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel @@ -5,6 +5,9 @@ cargo-raze crate build file. DO NOT EDIT! Replaced on runs of cargo-raze """ +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + # buildifier: disable=load load( "@rules_rust//rust:rust.bzl", @@ -13,9 +16,6 @@ load( "rust_test", ) -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - package(default_visibility = [ # Public for visibility by "@raze__crate__version//" targets. # diff --git a/bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel b/bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel index f3bd70dd..c921ef91 100644 --- a/bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel +++ b/bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel @@ -5,6 +5,9 @@ cargo-raze crate build file. DO NOT EDIT! Replaced on runs of cargo-raze """ +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + # buildifier: disable=load load( "@rules_rust//rust:rust.bzl", @@ -13,9 +16,6 @@ load( "rust_test", ) -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - package(default_visibility = [ # Public for visibility by "@raze__crate__version//" targets. # diff --git a/bazel/cargo/remote/BUILD.chrono-0.4.19.bazel b/bazel/cargo/remote/BUILD.chrono-0.4.19.bazel index f97ea46b..feaf5c56 100644 --- a/bazel/cargo/remote/BUILD.chrono-0.4.19.bazel +++ b/bazel/cargo/remote/BUILD.chrono-0.4.19.bazel @@ -5,6 +5,9 @@ cargo-raze crate build file. DO NOT EDIT! Replaced on runs of cargo-raze """ +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + # buildifier: disable=load load( "@rules_rust//rust:rust.bzl", @@ -13,9 +16,6 @@ load( "rust_test", ) -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - package(default_visibility = [ # Public for visibility by "@raze__crate__version//" targets. # diff --git a/bazel/cargo/remote/BUILD.getrandom-0.2.2.bazel b/bazel/cargo/remote/BUILD.getrandom-0.2.2.bazel index 58298e89..85c2a10e 100644 --- a/bazel/cargo/remote/BUILD.getrandom-0.2.2.bazel +++ b/bazel/cargo/remote/BUILD.getrandom-0.2.2.bazel @@ -5,6 +5,9 @@ cargo-raze crate build file. DO NOT EDIT! Replaced on runs of cargo-raze """ +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + # buildifier: disable=load load( "@rules_rust//rust:rust.bzl", @@ -13,9 +16,6 @@ load( "rust_test", ) -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - package(default_visibility = [ # Public for visibility by "@raze__crate__version//" targets. # @@ -29,6 +29,7 @@ licenses([ ]) # Generated Targets +# buildifier: disable=out-of-order-load # buildifier: disable=load-on-top load( "@rules_rust//cargo:cargo_build_script.bzl", diff --git a/bazel/cargo/remote/BUILD.hashbrown-0.9.1.bazel b/bazel/cargo/remote/BUILD.hashbrown-0.9.1.bazel index 72fbe248..348c8f38 100644 --- a/bazel/cargo/remote/BUILD.hashbrown-0.9.1.bazel +++ b/bazel/cargo/remote/BUILD.hashbrown-0.9.1.bazel @@ -5,6 +5,9 @@ cargo-raze crate build file. DO NOT EDIT! Replaced on runs of cargo-raze """ +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + # buildifier: disable=load load( "@rules_rust//rust:rust.bzl", @@ -13,9 +16,6 @@ load( "rust_test", ) -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - package(default_visibility = [ # Public for visibility by "@raze__crate__version//" targets. # diff --git a/bazel/cargo/remote/BUILD.libc-0.2.88.bazel b/bazel/cargo/remote/BUILD.libc-0.2.88.bazel index 610522e1..ccf1612e 100644 --- a/bazel/cargo/remote/BUILD.libc-0.2.88.bazel +++ b/bazel/cargo/remote/BUILD.libc-0.2.88.bazel @@ -5,6 +5,9 @@ cargo-raze crate build file. DO NOT EDIT! Replaced on runs of cargo-raze """ +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + # buildifier: disable=load load( "@rules_rust//rust:rust.bzl", @@ -13,9 +16,6 @@ load( "rust_test", ) -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - package(default_visibility = [ # Public for visibility by "@raze__crate__version//" targets. # @@ -29,6 +29,7 @@ licenses([ ]) # Generated Targets +# buildifier: disable=out-of-order-load # buildifier: disable=load-on-top load( "@rules_rust//cargo:cargo_build_script.bzl", diff --git a/bazel/cargo/remote/BUILD.log-0.4.14.bazel b/bazel/cargo/remote/BUILD.log-0.4.14.bazel index 2946014f..60912516 100644 --- a/bazel/cargo/remote/BUILD.log-0.4.14.bazel +++ b/bazel/cargo/remote/BUILD.log-0.4.14.bazel @@ -5,6 +5,9 @@ cargo-raze crate build file. DO NOT EDIT! Replaced on runs of cargo-raze """ +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + # buildifier: disable=load load( "@rules_rust//rust:rust.bzl", @@ -13,9 +16,6 @@ load( "rust_test", ) -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - package(default_visibility = [ # Public for visibility by "@raze__crate__version//" targets. # @@ -29,6 +29,7 @@ licenses([ ]) # Generated Targets +# buildifier: disable=out-of-order-load # buildifier: disable=load-on-top load( "@rules_rust//cargo:cargo_build_script.bzl", diff --git a/bazel/cargo/remote/BUILD.num-integer-0.1.44.bazel b/bazel/cargo/remote/BUILD.num-integer-0.1.44.bazel index b2a2a986..26aa4162 100644 --- a/bazel/cargo/remote/BUILD.num-integer-0.1.44.bazel +++ b/bazel/cargo/remote/BUILD.num-integer-0.1.44.bazel @@ -5,6 +5,9 @@ cargo-raze crate build file. DO NOT EDIT! Replaced on runs of cargo-raze """ +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + # buildifier: disable=load load( "@rules_rust//rust:rust.bzl", @@ -13,9 +16,6 @@ load( "rust_test", ) -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - package(default_visibility = [ # Public for visibility by "@raze__crate__version//" targets. # @@ -29,6 +29,7 @@ licenses([ ]) # Generated Targets +# buildifier: disable=out-of-order-load # buildifier: disable=load-on-top load( "@rules_rust//cargo:cargo_build_script.bzl", diff --git a/bazel/cargo/remote/BUILD.num-traits-0.2.14.bazel b/bazel/cargo/remote/BUILD.num-traits-0.2.14.bazel index debef725..f49065f7 100644 --- a/bazel/cargo/remote/BUILD.num-traits-0.2.14.bazel +++ b/bazel/cargo/remote/BUILD.num-traits-0.2.14.bazel @@ -5,6 +5,9 @@ cargo-raze crate build file. DO NOT EDIT! Replaced on runs of cargo-raze """ +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + # buildifier: disable=load load( "@rules_rust//rust:rust.bzl", @@ -13,9 +16,6 @@ load( "rust_test", ) -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - package(default_visibility = [ # Public for visibility by "@raze__crate__version//" targets. # @@ -29,6 +29,7 @@ licenses([ ]) # Generated Targets +# buildifier: disable=out-of-order-load # buildifier: disable=load-on-top load( "@rules_rust//cargo:cargo_build_script.bzl", diff --git a/bazel/cargo/remote/BUILD.time-0.1.43.bazel b/bazel/cargo/remote/BUILD.time-0.1.43.bazel index 703bb9b0..88ee584f 100644 --- a/bazel/cargo/remote/BUILD.time-0.1.43.bazel +++ b/bazel/cargo/remote/BUILD.time-0.1.43.bazel @@ -5,6 +5,9 @@ cargo-raze crate build file. DO NOT EDIT! Replaced on runs of cargo-raze """ +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + # buildifier: disable=load load( "@rules_rust//rust:rust.bzl", @@ -13,9 +16,6 @@ load( "rust_test", ) -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - package(default_visibility = [ # Public for visibility by "@raze__crate__version//" targets. # diff --git a/bazel/cargo/remote/BUILD.wasi-0.10.2+wasi-snapshot-preview1.bazel b/bazel/cargo/remote/BUILD.wasi-0.10.2+wasi-snapshot-preview1.bazel index dc3e3fef..d65930a5 100644 --- a/bazel/cargo/remote/BUILD.wasi-0.10.2+wasi-snapshot-preview1.bazel +++ b/bazel/cargo/remote/BUILD.wasi-0.10.2+wasi-snapshot-preview1.bazel @@ -5,6 +5,9 @@ cargo-raze crate build file. DO NOT EDIT! Replaced on runs of cargo-raze """ +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + # buildifier: disable=load load( "@rules_rust//rust:rust.bzl", @@ -13,9 +16,6 @@ load( "rust_test", ) -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - package(default_visibility = [ # Public for visibility by "@raze__crate__version//" targets. # diff --git a/bazel/cargo/remote/BUILD.winapi-0.3.9.bazel b/bazel/cargo/remote/BUILD.winapi-0.3.9.bazel index f4a8eeed..4c7c4282 100644 --- a/bazel/cargo/remote/BUILD.winapi-0.3.9.bazel +++ b/bazel/cargo/remote/BUILD.winapi-0.3.9.bazel @@ -5,6 +5,9 @@ cargo-raze crate build file. DO NOT EDIT! Replaced on runs of cargo-raze """ +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + # buildifier: disable=load load( "@rules_rust//rust:rust.bzl", @@ -13,9 +16,6 @@ load( "rust_test", ) -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - package(default_visibility = [ # Public for visibility by "@raze__crate__version//" targets. # @@ -29,6 +29,7 @@ licenses([ ]) # Generated Targets +# buildifier: disable=out-of-order-load # buildifier: disable=load-on-top load( "@rules_rust//cargo:cargo_build_script.bzl", diff --git a/bazel/cargo/remote/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel b/bazel/cargo/remote/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel index 7882e51b..e501d339 100644 --- a/bazel/cargo/remote/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel +++ b/bazel/cargo/remote/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel @@ -5,6 +5,9 @@ cargo-raze crate build file. DO NOT EDIT! Replaced on runs of cargo-raze """ +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + # buildifier: disable=load load( "@rules_rust//rust:rust.bzl", @@ -13,9 +16,6 @@ load( "rust_test", ) -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - package(default_visibility = [ # Public for visibility by "@raze__crate__version//" targets. # @@ -29,6 +29,7 @@ licenses([ ]) # Generated Targets +# buildifier: disable=out-of-order-load # buildifier: disable=load-on-top load( "@rules_rust//cargo:cargo_build_script.bzl", diff --git a/bazel/cargo/remote/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel b/bazel/cargo/remote/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel index b061a534..5cf1d6c3 100644 --- a/bazel/cargo/remote/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel +++ b/bazel/cargo/remote/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel @@ -5,6 +5,9 @@ cargo-raze crate build file. DO NOT EDIT! Replaced on runs of cargo-raze """ +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + # buildifier: disable=load load( "@rules_rust//rust:rust.bzl", @@ -13,9 +16,6 @@ load( "rust_test", ) -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - package(default_visibility = [ # Public for visibility by "@raze__crate__version//" targets. # @@ -29,6 +29,7 @@ licenses([ ]) # Generated Targets +# buildifier: disable=out-of-order-load # buildifier: disable=load-on-top load( "@rules_rust//cargo:cargo_build_script.bzl", diff --git a/bazel/dependencies.bzl b/bazel/dependencies.bzl index 3a1d3245..0f06478f 100644 --- a/bazel/dependencies.bzl +++ b/bazel/dependencies.bzl @@ -12,9 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@cargo_raze//:repositories.bzl", "cargo_raze_repositories") +load("@cargo_raze//:transitive_deps.bzl", "cargo_raze_transitive_deps") load("@proxy_wasm_rust_sdk//bazel/cargo:crates.bzl", "raze_fetch_remote_crates") +load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies") load("@rules_rust//rust:repositories.bzl", "rust_repositories") def proxy_wasm_rust_sdk_dependencies(): rust_repositories() raze_fetch_remote_crates() + +def proxy_wasm_rust_sdk_cargo_raze_dependencies(): + rules_foreign_cc_dependencies() + cargo_raze_repositories() + cargo_raze_transitive_deps() diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 2e780b96..708ef275 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -13,9 +13,27 @@ # limitations under the License. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") def proxy_wasm_rust_sdk_repositories(): - http_archive( + maybe( + http_archive, + name = "cargo_raze", + sha256 = "c664e258ea79e7e4ec2f2b57bca8b1c37f11c8d5748e02b8224810da969eb681", + strip_prefix = "cargo-raze-0.11.0", + url = "https://github.com/google/cargo-raze/archive/v0.11.0.tar.gz", + ) + + maybe( + http_archive, + name = "rules_foreign_cc", + sha256 = "c2cdcf55ffaf49366725639e45dedd449b8c3fe22b54e31625eb80ce3a240f1e", + strip_prefix = "rules_foreign_cc-0.1.0", + url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.1.0.zip", + ) + + maybe( + http_archive, name = "rules_rust", sha256 = "f2d9f804e1a8042a41ad41e1aeeca55ad0fc2d294ecd52e34ef8c63f7ce350fd", strip_prefix = "rules_rust-3b02397bde43b1eeee1528227ceb3da6c6bdadd6", From b77636eae44e8aa838419dbb4bd2c0f031213810 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Sat, 6 Mar 2021 23:23:09 +0000 Subject: [PATCH 2/2] review: move @cargo_raze to WORKSPACE. Signed-off-by: Piotr Sikora --- WORKSPACE | 20 ++++++++++++++++++-- bazel/dependencies.bzl | 8 -------- bazel/repositories.bzl | 16 ---------------- 3 files changed, 18 insertions(+), 26 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 62705f86..d409f914 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -4,10 +4,26 @@ load("@proxy_wasm_rust_sdk//bazel:repositories.bzl", "proxy_wasm_rust_sdk_reposi proxy_wasm_rust_sdk_repositories() -load("@proxy_wasm_rust_sdk//bazel:dependencies.bzl", "proxy_wasm_rust_sdk_cargo_raze_dependencies", "proxy_wasm_rust_sdk_dependencies") +load("@proxy_wasm_rust_sdk//bazel:dependencies.bzl", "proxy_wasm_rust_sdk_dependencies") proxy_wasm_rust_sdk_dependencies() # Needed only when using @cargo_raze//:raze to generate BUILD files in //bazel/cargo. -proxy_wasm_rust_sdk_cargo_raze_dependencies() +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +http_archive( + name = "cargo_raze", + sha256 = "73c5cea8ad3f4ef7788116d491070eeb27819fe0f923dbb6f451f69dd5fa752c", + # v0.11.0 with a few Bazel fixes. + strip_prefix = "cargo-raze-7614085d2748e55ad3032c9b1dca78f6011cb40e", + url = "https://github.com/google/cargo-raze/archive/7614085d2748e55ad3032c9b1dca78f6011cb40e.tar.gz", +) + +load("@cargo_raze//:repositories.bzl", "cargo_raze_repositories") + +cargo_raze_repositories() + +load("@cargo_raze//:transitive_deps.bzl", "cargo_raze_transitive_deps") + +cargo_raze_transitive_deps() diff --git a/bazel/dependencies.bzl b/bazel/dependencies.bzl index 0f06478f..3a1d3245 100644 --- a/bazel/dependencies.bzl +++ b/bazel/dependencies.bzl @@ -12,17 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@cargo_raze//:repositories.bzl", "cargo_raze_repositories") -load("@cargo_raze//:transitive_deps.bzl", "cargo_raze_transitive_deps") load("@proxy_wasm_rust_sdk//bazel/cargo:crates.bzl", "raze_fetch_remote_crates") -load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies") load("@rules_rust//rust:repositories.bzl", "rust_repositories") def proxy_wasm_rust_sdk_dependencies(): rust_repositories() raze_fetch_remote_crates() - -def proxy_wasm_rust_sdk_cargo_raze_dependencies(): - rules_foreign_cc_dependencies() - cargo_raze_repositories() - cargo_raze_transitive_deps() diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 708ef275..e616d4a1 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -16,22 +16,6 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") def proxy_wasm_rust_sdk_repositories(): - maybe( - http_archive, - name = "cargo_raze", - sha256 = "c664e258ea79e7e4ec2f2b57bca8b1c37f11c8d5748e02b8224810da969eb681", - strip_prefix = "cargo-raze-0.11.0", - url = "https://github.com/google/cargo-raze/archive/v0.11.0.tar.gz", - ) - - maybe( - http_archive, - name = "rules_foreign_cc", - sha256 = "c2cdcf55ffaf49366725639e45dedd449b8c3fe22b54e31625eb80ce3a240f1e", - strip_prefix = "rules_foreign_cc-0.1.0", - url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.1.0.zip", - ) - maybe( http_archive, name = "rules_rust",