diff --git a/.bazelrc b/.bazelrc index 38ca0fbf..d1dc477e 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,2 +1,2 @@ # Force Bazel to use --target=wasm32-wasi -build --platforms=@io_bazel_rules_rust//rust/platform:wasi +build --platforms=@rules_rust//rust/platform:wasi diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 51138d63..8a1189cf 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=@io_bazel_rules_rust//rust/platform:wasm //... + run: bazelisk --bazelrc=/dev/null build --platforms=@rules_rust//rust/platform:wasm //... - name: Build (wasm32-wasi) - run: bazelisk --bazelrc=/dev/null build --platforms=@io_bazel_rules_rust//rust/platform:wasi //... + run: bazelisk --bazelrc=/dev/null build --platforms=@rules_rust//rust/platform:wasi //... - name: Format (buildifier) run: | diff --git a/BUILD b/BUILD index 53d433f6..d905fbbf 100644 --- a/BUILD +++ b/BUILD @@ -1,4 +1,4 @@ -load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") +load("@rules_rust//rust:rust.bzl", "rust_library") rust_library( name = "proxy_wasm", diff --git a/Cargo.toml b/Cargo.toml index dd0937ac..0790cc5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,7 @@ 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/bazel/cargo/remote/BUILD.ahash-0.4.7.bazel b/bazel/cargo/remote/BUILD.ahash-0.4.7.bazel index da28b8d0..3646eb2d 100644 --- a/bazel/cargo/remote/BUILD.ahash-0.4.7.bazel +++ b/bazel/cargo/remote/BUILD.ahash-0.4.7.bazel @@ -7,7 +7,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze # buildifier: disable=load load( - "@io_bazel_rules_rust//rust:rust.bzl", + "@rules_rust//rust:rust.bzl", "rust_binary", "rust_library", "rust_test", diff --git a/bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel b/bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel index 7d390016..d348f9b4 100644 --- a/bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel +++ b/bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel @@ -7,7 +7,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze # buildifier: disable=load load( - "@io_bazel_rules_rust//rust:rust.bzl", + "@rules_rust//rust:rust.bzl", "rust_binary", "rust_library", "rust_test", 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 57545ac7..f3bd70dd 100644 --- a/bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel +++ b/bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel @@ -7,7 +7,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze # buildifier: disable=load load( - "@io_bazel_rules_rust//rust:rust.bzl", + "@rules_rust//rust:rust.bzl", "rust_binary", "rust_library", "rust_test", diff --git a/bazel/cargo/remote/BUILD.chrono-0.4.19.bazel b/bazel/cargo/remote/BUILD.chrono-0.4.19.bazel index 199b0697..4d47bf24 100644 --- a/bazel/cargo/remote/BUILD.chrono-0.4.19.bazel +++ b/bazel/cargo/remote/BUILD.chrono-0.4.19.bazel @@ -7,7 +7,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze # buildifier: disable=load load( - "@io_bazel_rules_rust//rust:rust.bzl", + "@rules_rust//rust:rust.bzl", "rust_binary", "rust_library", "rust_test", @@ -69,15 +69,15 @@ rust_library( ] + selects.with_or({ # cfg(all(target_arch = "wasm32", not(any(target_os = "emscripten", target_os = "wasi")))) ( - "@io_bazel_rules_rust//rust/platform:wasm32-unknown-unknown", + "@rules_rust//rust/platform:wasm32-unknown-unknown", ): [ ], "//conditions:default": [], }) + selects.with_or({ # cfg(windows) ( - "@io_bazel_rules_rust//rust/platform:i686-pc-windows-msvc", - "@io_bazel_rules_rust//rust/platform:x86_64-pc-windows-msvc", + "@rules_rust//rust/platform:i686-pc-windows-msvc", + "@rules_rust//rust/platform:x86_64-pc-windows-msvc", ): [ "@raze__winapi__0_3_9//:winapi", ], diff --git a/bazel/cargo/remote/BUILD.getrandom-0.2.2.bazel b/bazel/cargo/remote/BUILD.getrandom-0.2.2.bazel index 04465d5f..534340ff 100644 --- a/bazel/cargo/remote/BUILD.getrandom-0.2.2.bazel +++ b/bazel/cargo/remote/BUILD.getrandom-0.2.2.bazel @@ -7,7 +7,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze # buildifier: disable=load load( - "@io_bazel_rules_rust//rust:rust.bzl", + "@rules_rust//rust:rust.bzl", "rust_binary", "rust_library", "rust_test", @@ -31,7 +31,7 @@ licenses([ # Generated Targets # buildifier: disable=load-on-top load( - "@io_bazel_rules_rust//cargo:cargo_build_script.bzl", + "@rules_rust//cargo:cargo_build_script.bzl", "cargo_build_script", ) @@ -58,36 +58,36 @@ cargo_build_script( ] + selects.with_or({ # cfg(all(target_arch = "wasm32", target_os = "unknown")) ( - "@io_bazel_rules_rust//rust/platform:wasm32-unknown-unknown", + "@rules_rust//rust/platform:wasm32-unknown-unknown", ): [ ], "//conditions:default": [], }) + selects.with_or({ # cfg(target_os = "wasi") ( - "@io_bazel_rules_rust//rust/platform:wasm32-wasi", + "@rules_rust//rust/platform:wasm32-wasi", ): [ ], "//conditions:default": [], }) + 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", - "@io_bazel_rules_rust//rust/platform:arm-unknown-linux-gnueabi", - "@io_bazel_rules_rust//rust/platform:i686-apple-darwin", - "@io_bazel_rules_rust//rust/platform:i686-linux-android", - "@io_bazel_rules_rust//rust/platform:i686-unknown-freebsd", - "@io_bazel_rules_rust//rust/platform:i686-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:powerpc-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:s390x-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:x86_64-apple-darwin", - "@io_bazel_rules_rust//rust/platform:x86_64-apple-ios", - "@io_bazel_rules_rust//rust/platform:x86_64-linux-android", - "@io_bazel_rules_rust//rust/platform:x86_64-unknown-freebsd", - "@io_bazel_rules_rust//rust/platform:x86_64-unknown-linux-gnu", + "@rules_rust//rust/platform:aarch64-apple-darwin", + "@rules_rust//rust/platform:aarch64-apple-ios", + "@rules_rust//rust/platform:aarch64-linux-android", + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", + "@rules_rust//rust/platform:i686-apple-darwin", + "@rules_rust//rust/platform:i686-linux-android", + "@rules_rust//rust/platform:i686-unknown-freebsd", + "@rules_rust//rust/platform:i686-unknown-linux-gnu", + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", + "@rules_rust//rust/platform:s390x-unknown-linux-gnu", + "@rules_rust//rust/platform:x86_64-apple-darwin", + "@rules_rust//rust/platform:x86_64-apple-ios", + "@rules_rust//rust/platform:x86_64-linux-android", + "@rules_rust//rust/platform:x86_64-unknown-freebsd", + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", ): [ ], "//conditions:default": [], @@ -122,14 +122,14 @@ rust_library( ] + selects.with_or({ # cfg(all(target_arch = "wasm32", target_os = "unknown")) ( - "@io_bazel_rules_rust//rust/platform:wasm32-unknown-unknown", + "@rules_rust//rust/platform:wasm32-unknown-unknown", ): [ ], "//conditions:default": [], }) + selects.with_or({ # cfg(target_os = "wasi") ( - "@io_bazel_rules_rust//rust/platform:wasm32-wasi", + "@rules_rust//rust/platform:wasm32-wasi", ): [ "@raze__wasi__0_10_2_wasi_snapshot_preview1//:wasi", ], @@ -137,22 +137,22 @@ 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", - "@io_bazel_rules_rust//rust/platform:arm-unknown-linux-gnueabi", - "@io_bazel_rules_rust//rust/platform:i686-apple-darwin", - "@io_bazel_rules_rust//rust/platform:i686-linux-android", - "@io_bazel_rules_rust//rust/platform:i686-unknown-freebsd", - "@io_bazel_rules_rust//rust/platform:i686-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:powerpc-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:s390x-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:x86_64-apple-darwin", - "@io_bazel_rules_rust//rust/platform:x86_64-apple-ios", - "@io_bazel_rules_rust//rust/platform:x86_64-linux-android", - "@io_bazel_rules_rust//rust/platform:x86_64-unknown-freebsd", - "@io_bazel_rules_rust//rust/platform:x86_64-unknown-linux-gnu", + "@rules_rust//rust/platform:aarch64-apple-darwin", + "@rules_rust//rust/platform:aarch64-apple-ios", + "@rules_rust//rust/platform:aarch64-linux-android", + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", + "@rules_rust//rust/platform:i686-apple-darwin", + "@rules_rust//rust/platform:i686-linux-android", + "@rules_rust//rust/platform:i686-unknown-freebsd", + "@rules_rust//rust/platform:i686-unknown-linux-gnu", + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", + "@rules_rust//rust/platform:s390x-unknown-linux-gnu", + "@rules_rust//rust/platform:x86_64-apple-darwin", + "@rules_rust//rust/platform:x86_64-apple-ios", + "@rules_rust//rust/platform:x86_64-linux-android", + "@rules_rust//rust/platform:x86_64-unknown-freebsd", + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", ): [ "@raze__libc__0_2_85//:libc", ], diff --git a/bazel/cargo/remote/BUILD.hashbrown-0.9.1.bazel b/bazel/cargo/remote/BUILD.hashbrown-0.9.1.bazel index 4034269b..72fbe248 100644 --- a/bazel/cargo/remote/BUILD.hashbrown-0.9.1.bazel +++ b/bazel/cargo/remote/BUILD.hashbrown-0.9.1.bazel @@ -7,7 +7,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze # buildifier: disable=load load( - "@io_bazel_rules_rust//rust:rust.bzl", + "@rules_rust//rust:rust.bzl", "rust_binary", "rust_library", "rust_test", diff --git a/bazel/cargo/remote/BUILD.libc-0.2.85.bazel b/bazel/cargo/remote/BUILD.libc-0.2.85.bazel index a9543d07..f1d26d66 100644 --- a/bazel/cargo/remote/BUILD.libc-0.2.85.bazel +++ b/bazel/cargo/remote/BUILD.libc-0.2.85.bazel @@ -7,7 +7,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze # buildifier: disable=load load( - "@io_bazel_rules_rust//rust:rust.bzl", + "@rules_rust//rust:rust.bzl", "rust_binary", "rust_library", "rust_test", @@ -31,7 +31,7 @@ licenses([ # Generated Targets # buildifier: disable=load-on-top load( - "@io_bazel_rules_rust//cargo:cargo_build_script.bzl", + "@rules_rust//cargo:cargo_build_script.bzl", "cargo_build_script", ) diff --git a/bazel/cargo/remote/BUILD.log-0.4.14.bazel b/bazel/cargo/remote/BUILD.log-0.4.14.bazel index b66616ec..2946014f 100644 --- a/bazel/cargo/remote/BUILD.log-0.4.14.bazel +++ b/bazel/cargo/remote/BUILD.log-0.4.14.bazel @@ -7,7 +7,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze # buildifier: disable=load load( - "@io_bazel_rules_rust//rust:rust.bzl", + "@rules_rust//rust:rust.bzl", "rust_binary", "rust_library", "rust_test", @@ -31,7 +31,7 @@ licenses([ # Generated Targets # buildifier: disable=load-on-top load( - "@io_bazel_rules_rust//cargo:cargo_build_script.bzl", + "@rules_rust//cargo:cargo_build_script.bzl", "cargo_build_script", ) 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 dce7b65a..b2a2a986 100644 --- a/bazel/cargo/remote/BUILD.num-integer-0.1.44.bazel +++ b/bazel/cargo/remote/BUILD.num-integer-0.1.44.bazel @@ -7,7 +7,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze # buildifier: disable=load load( - "@io_bazel_rules_rust//rust:rust.bzl", + "@rules_rust//rust:rust.bzl", "rust_binary", "rust_library", "rust_test", @@ -31,7 +31,7 @@ licenses([ # Generated Targets # buildifier: disable=load-on-top load( - "@io_bazel_rules_rust//cargo:cargo_build_script.bzl", + "@rules_rust//cargo:cargo_build_script.bzl", "cargo_build_script", ) 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 b8e710d7..debef725 100644 --- a/bazel/cargo/remote/BUILD.num-traits-0.2.14.bazel +++ b/bazel/cargo/remote/BUILD.num-traits-0.2.14.bazel @@ -7,7 +7,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze # buildifier: disable=load load( - "@io_bazel_rules_rust//rust:rust.bzl", + "@rules_rust//rust:rust.bzl", "rust_binary", "rust_library", "rust_test", @@ -31,7 +31,7 @@ licenses([ # Generated Targets # buildifier: disable=load-on-top load( - "@io_bazel_rules_rust//cargo:cargo_build_script.bzl", + "@rules_rust//cargo:cargo_build_script.bzl", "cargo_build_script", ) diff --git a/bazel/cargo/remote/BUILD.time-0.1.43.bazel b/bazel/cargo/remote/BUILD.time-0.1.43.bazel index cf14a2dd..fe99563b 100644 --- a/bazel/cargo/remote/BUILD.time-0.1.43.bazel +++ b/bazel/cargo/remote/BUILD.time-0.1.43.bazel @@ -7,7 +7,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze # buildifier: disable=load load( - "@io_bazel_rules_rust//rust:rust.bzl", + "@rules_rust//rust:rust.bzl", "rust_binary", "rust_library", "rust_test", @@ -55,8 +55,8 @@ rust_library( ] + selects.with_or({ # cfg(windows) ( - "@io_bazel_rules_rust//rust/platform:i686-pc-windows-msvc", - "@io_bazel_rules_rust//rust/platform:x86_64-pc-windows-msvc", + "@rules_rust//rust/platform:i686-pc-windows-msvc", + "@rules_rust//rust/platform:x86_64-pc-windows-msvc", ): [ "@raze__winapi__0_3_9//:winapi", ], 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 ea01ebc3..dc3e3fef 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 @@ -7,7 +7,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze # buildifier: disable=load load( - "@io_bazel_rules_rust//rust:rust.bzl", + "@rules_rust//rust:rust.bzl", "rust_binary", "rust_library", "rust_test", diff --git a/bazel/cargo/remote/BUILD.winapi-0.3.9.bazel b/bazel/cargo/remote/BUILD.winapi-0.3.9.bazel index 49e0160e..f4a8eeed 100644 --- a/bazel/cargo/remote/BUILD.winapi-0.3.9.bazel +++ b/bazel/cargo/remote/BUILD.winapi-0.3.9.bazel @@ -7,7 +7,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze # buildifier: disable=load load( - "@io_bazel_rules_rust//rust:rust.bzl", + "@rules_rust//rust:rust.bzl", "rust_binary", "rust_library", "rust_test", @@ -31,7 +31,7 @@ licenses([ # Generated Targets # buildifier: disable=load-on-top load( - "@io_bazel_rules_rust//cargo:cargo_build_script.bzl", + "@rules_rust//cargo:cargo_build_script.bzl", "cargo_build_script", ) 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 68773fbd..7882e51b 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 @@ -7,7 +7,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze # buildifier: disable=load load( - "@io_bazel_rules_rust//rust:rust.bzl", + "@rules_rust//rust:rust.bzl", "rust_binary", "rust_library", "rust_test", @@ -31,7 +31,7 @@ licenses([ # Generated Targets # buildifier: disable=load-on-top load( - "@io_bazel_rules_rust//cargo:cargo_build_script.bzl", + "@rules_rust//cargo:cargo_build_script.bzl", "cargo_build_script", ) 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 5155a8ee..b061a534 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 @@ -7,7 +7,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze # buildifier: disable=load load( - "@io_bazel_rules_rust//rust:rust.bzl", + "@rules_rust//rust:rust.bzl", "rust_binary", "rust_library", "rust_test", @@ -31,7 +31,7 @@ licenses([ # Generated Targets # buildifier: disable=load-on-top load( - "@io_bazel_rules_rust//cargo:cargo_build_script.bzl", + "@rules_rust//cargo:cargo_build_script.bzl", "cargo_build_script", ) diff --git a/bazel/dependencies.bzl b/bazel/dependencies.bzl index b8f2b84d..3a1d3245 100644 --- a/bazel/dependencies.bzl +++ b/bazel/dependencies.bzl @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories") load("@proxy_wasm_rust_sdk//bazel/cargo:crates.bzl", "raze_fetch_remote_crates") +load("@rules_rust//rust:repositories.bzl", "rust_repositories") def proxy_wasm_rust_sdk_dependencies(): rust_repositories() diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 6ddf170f..2e780b96 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -16,8 +16,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def proxy_wasm_rust_sdk_repositories(): http_archive( - name = "io_bazel_rules_rust", - sha256 = "5cb2fbcc3debebc7b68f5f66c1b7ef741bdcca87c70594de688d4518538c36c8", - strip_prefix = "rules_rust-aa7c6938cf1cc2973bc065c7532f89874bf09818", - url = "https://github.com/bazelbuild/rules_rust/archive/aa7c6938cf1cc2973bc065c7532f89874bf09818.tar.gz", + name = "rules_rust", + sha256 = "f2d9f804e1a8042a41ad41e1aeeca55ad0fc2d294ecd52e34ef8c63f7ce350fd", + strip_prefix = "rules_rust-3b02397bde43b1eeee1528227ceb3da6c6bdadd6", + url = "https://github.com/bazelbuild/rules_rust/archive/3b02397bde43b1eeee1528227ceb3da6c6bdadd6.tar.gz", ) diff --git a/examples/BUILD b/examples/BUILD index ba5935dd..a5aec0a4 100644 --- a/examples/BUILD +++ b/examples/BUILD @@ -1,4 +1,4 @@ -load("@io_bazel_rules_rust//rust:rust.bzl", "rust_binary") +load("@rules_rust//rust:rust.bzl", "rust_binary") rust_binary( name = "hello_world", @@ -12,7 +12,7 @@ rust_binary( "//bazel/cargo:chrono", "//bazel/cargo:log", ] + select({ - "@io_bazel_rules_rust//rust/platform:wasm32-unknown-unknown": [], + "@rules_rust//rust/platform:wasm32-unknown-unknown": [], "//conditions:default": ["//bazel/cargo:getrandom"], }), )