From cddcb7eb71478f65c642384429aa0c4f1aeca324 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 20:24:23 +0000 Subject: [PATCH 1/6] chore(deps): update dependency rules_rust to v0.54.1 --- repositories/rust_setup_stage_1.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repositories/rust_setup_stage_1.bzl b/repositories/rust_setup_stage_1.bzl index af6d88f8..df8407d6 100644 --- a/repositories/rust_setup_stage_1.bzl +++ b/repositories/rust_setup_stage_1.bzl @@ -5,8 +5,8 @@ def rust_setup_stage_1(): maybe( http_archive, name = "rules_rust", - sha256 = "7931e7b544107b62029bf2fc72e79f9d77523ad650d442d93c3fcce9ad5ec1eb", - url = "https://github.com/bazelbuild/rules_rust/releases/download/0.52.0/rules_rust-v0.52.0.tar.gz", + sha256 = "af4f56caae50a99a68bfce39b141b509dd68548c8204b98ab7a1cafc94d5bb02", + url = "https://github.com/bazelbuild/rules_rust/releases/download/0.54.1/rules_rust-v0.54.1.tar.gz", ) maybe( From 11de353e99e4ae5f495624a68bcf29ff9f2119a1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 20:37:46 +0000 Subject: [PATCH 2/6] chore(deps): update dependency rules_rust to v0.54.1 --- repositories/rust_setup_stage_1.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repositories/rust_setup_stage_1.bzl b/repositories/rust_setup_stage_1.bzl index af6d88f8..df8407d6 100644 --- a/repositories/rust_setup_stage_1.bzl +++ b/repositories/rust_setup_stage_1.bzl @@ -5,8 +5,8 @@ def rust_setup_stage_1(): maybe( http_archive, name = "rules_rust", - sha256 = "7931e7b544107b62029bf2fc72e79f9d77523ad650d442d93c3fcce9ad5ec1eb", - url = "https://github.com/bazelbuild/rules_rust/releases/download/0.52.0/rules_rust-v0.52.0.tar.gz", + sha256 = "af4f56caae50a99a68bfce39b141b509dd68548c8204b98ab7a1cafc94d5bb02", + url = "https://github.com/bazelbuild/rules_rust/releases/download/0.54.1/rules_rust-v0.54.1.tar.gz", ) maybe( From 400e3257b5087bb98eecd71e26849cff7045e15c Mon Sep 17 00:00:00 2001 From: Milan Vukov Date: Tue, 3 Dec 2024 21:42:41 +0100 Subject: [PATCH 3/6] Update Cargo.Bazel.lock --- WORKSPACE | 2 +- repositories/rust/Cargo.Bazel.lock | 35 ++++++++++++++++++++++++------ 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 0d79e0f1..0e75c524 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -49,7 +49,7 @@ load("//repositories:rust_setup_stage_3.bzl", "rust_setup_stage_3") rust_setup_stage_3( # Only needed for CI here, see https://github.com/bazelbuild/rules_rust/pull/2698. - generator = "@com_github_mvukov_rules_ros2_cargo_bazel//:cargo-bazel", + # generator = "@com_github_mvukov_rules_ros2_cargo_bazel//:cargo-bazel", ) load("//repositories:rust_setup_stage_4.bzl", "rust_setup_stage_4") diff --git a/repositories/rust/Cargo.Bazel.lock b/repositories/rust/Cargo.Bazel.lock index ec8ec32f..8364f914 100644 --- a/repositories/rust/Cargo.Bazel.lock +++ b/repositories/rust/Cargo.Bazel.lock @@ -1,5 +1,5 @@ { - "checksum": "56b4467eddf4d24526b75eca004ff68d26b3c2b156e82846a78e508cf67c8ec2", + "checksum": "f362c91be67a18a41b33c6c1292d19ab634ed392b591e497234365e246deffa1", "crates": { "autocfg 1.3.0": { "name": "autocfg", @@ -748,6 +748,9 @@ "version": "0.2.155" }, "build_script_attrs": { + "compile_data_glob": [ + "**" + ], "data_glob": [ "**" ] @@ -949,6 +952,9 @@ "version": "1.0.81" }, "build_script_attrs": { + "compile_data_glob": [ + "**" + ], "data_glob": [ "**" ] @@ -1126,6 +1132,9 @@ "version": "1.0.201" }, "build_script_attrs": { + "compile_data_glob": [ + "**" + ], "data_glob": [ "**" ] @@ -1324,6 +1333,9 @@ "version": "1.0.128" }, "build_script_attrs": { + "compile_data_glob": [ + "**" + ], "data_glob": [ "**" ] @@ -1405,6 +1417,9 @@ "version": "0.3.17" }, "build_script_attrs": { + "compile_data_glob": [ + "**" + ], "data_glob": [ "**" ] @@ -1525,6 +1540,9 @@ "version": "0.4.9" }, "build_script_attrs": { + "compile_data_glob": [ + "**" + ], "data_glob": [ "**" ], @@ -1667,15 +1685,15 @@ "aarch64-apple-ios-sim": [ "aarch64-apple-ios-sim" ], - "aarch64-fuchsia": [ - "aarch64-fuchsia" - ], "aarch64-linux-android": [ "aarch64-linux-android" ], "aarch64-pc-windows-msvc": [ "aarch64-pc-windows-msvc" ], + "aarch64-unknown-fuchsia": [ + "aarch64-unknown-fuchsia" + ], "aarch64-unknown-linux-gnu": [ "aarch64-unknown-linux-gnu" ], @@ -1733,15 +1751,15 @@ "wasm32-wasi": [ "wasm32-wasi" ], + "wasm32-wasip1": [ + "wasm32-wasip1" + ], "x86_64-apple-darwin": [ "x86_64-apple-darwin" ], "x86_64-apple-ios": [ "x86_64-apple-ios" ], - "x86_64-fuchsia": [ - "x86_64-fuchsia" - ], "x86_64-linux-android": [ "x86_64-linux-android" ], @@ -1751,6 +1769,9 @@ "x86_64-unknown-freebsd": [ "x86_64-unknown-freebsd" ], + "x86_64-unknown-fuchsia": [ + "x86_64-unknown-fuchsia" + ], "x86_64-unknown-linux-gnu": [ "x86_64-unknown-linux-gnu" ], From 46ad99e5b1287562785400ab81b267cd30ac0ae0 Mon Sep 17 00:00:00 2001 From: Milan Vukov Date: Tue, 3 Dec 2024 21:55:26 +0100 Subject: [PATCH 4/6] rm obsolete rust config --- WORKSPACE | 5 +---- examples/WORKSPACE | 5 +---- rustfmt.toml | 4 ++++ rustfmt.txt | 1 + 4 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 rustfmt.toml create mode 100644 rustfmt.txt diff --git a/WORKSPACE b/WORKSPACE index 0e75c524..397f8224 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -47,10 +47,7 @@ rust_setup_stage_2() load("//repositories:rust_setup_stage_3.bzl", "rust_setup_stage_3") -rust_setup_stage_3( - # Only needed for CI here, see https://github.com/bazelbuild/rules_rust/pull/2698. - # generator = "@com_github_mvukov_rules_ros2_cargo_bazel//:cargo-bazel", -) +rust_setup_stage_3() load("//repositories:rust_setup_stage_4.bzl", "rust_setup_stage_4") diff --git a/examples/WORKSPACE b/examples/WORKSPACE index 8df584a2..cff546cb 100644 --- a/examples/WORKSPACE +++ b/examples/WORKSPACE @@ -63,10 +63,7 @@ rust_setup_stage_2() load("@com_github_mvukov_rules_ros2//repositories:rust_setup_stage_3.bzl", "rust_setup_stage_3") -rust_setup_stage_3( - # Only needed for CI here, see https://github.com/bazelbuild/rules_rust/pull/2698. - generator = "@com_github_mvukov_rules_ros2_cargo_bazel//:cargo-bazel", -) +rust_setup_stage_3() load("@com_github_mvukov_rules_ros2//repositories:rust_setup_stage_4.bzl", "rust_setup_stage_4") diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 00000000..2d50e46e --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,4 @@ +error_on_line_overflow = true +wrap_comments = true +comment_width = 100 +group_imports = "StdExternalCrate" diff --git a/rustfmt.txt b/rustfmt.txt new file mode 100644 index 00000000..f29126e7 --- /dev/null +++ b/rustfmt.txt @@ -0,0 +1 @@ +@rules_rust//tools/upstream_wrapper:rustfmt From 687b46cbbc7a2486d2535b9b73e858d2f34a7e0d Mon Sep 17 00:00:00 2001 From: Milan Vukov Date: Sun, 8 Dec 2024 15:04:14 +0100 Subject: [PATCH 5/6] Update to rules_rust 0.55.1 --- examples/zero_copy/listener.rs | 3 ++- repositories/ros2_rust.BUILD.bazel | 2 +- repositories/rust/BUILD.bazel | 6 +++--- repositories/rust/Cargo.Bazel.lock | 8 +++----- repositories/rust_setup_stage_1.bzl | 24 +++++++++--------------- repositories/rust_setup_stage_2.bzl | 2 +- 6 files changed, 19 insertions(+), 26 deletions(-) diff --git a/examples/zero_copy/listener.rs b/examples/zero_copy/listener.rs index 0c667371..ea4b283d 100644 --- a/examples/zero_copy/listener.rs +++ b/examples/zero_copy/listener.rs @@ -13,6 +13,7 @@ fn main() -> Result<(), Box> { let node = rclrs::create_node(&context, "minimal_subscriber")?; + let subscription_node = node.clone(); let _subscription = node.create_subscription::( "topic", rclrs::QOS_PROFILE_DEFAULT, @@ -23,7 +24,7 @@ fn main() -> Result<(), Box> { .as_micros() as u64; let delay_us = now - msg.timestamp; let data_length = msg.data_length as usize; - rclrs::log_info!(node.logger_name(), + rclrs::log_info!(subscription_node.logger_name(), "Delay {} us, I heard: '{:?}'", delay_us, String::from_utf8(msg.data[..data_length].to_vec()).unwrap() diff --git a/repositories/ros2_rust.BUILD.bazel b/repositories/ros2_rust.BUILD.bazel index bce3159c..e3be9fb6 100644 --- a/repositories/ros2_rust.BUILD.bazel +++ b/repositories/ros2_rust.BUILD.bazel @@ -6,8 +6,8 @@ load("@com_github_mvukov_rules_ros2//ros2:rust_interfaces.bzl", "rust_ros2_inter load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_python//python:defs.bzl", "py_binary") load("@rules_ros2_pip_deps//:requirements.bzl", "requirement") -load("@rules_rust//bindgen:defs.bzl", "rust_bindgen") load("@rules_rust//rust:defs.bzl", "rust_library") +load("@rules_rust_bindgen//:defs.bzl", "rust_bindgen") rust_library( name = "rosidl_runtime_rs", diff --git a/repositories/rust/BUILD.bazel b/repositories/rust/BUILD.bazel index 39886053..378b0530 100644 --- a/repositories/rust/BUILD.bazel +++ b/repositories/rust/BUILD.bazel @@ -1,4 +1,4 @@ -load("@rules_rust//bindgen:defs.bzl", "rust_bindgen_toolchain") +load("@rules_rust_bindgen//:defs.bzl", "rust_bindgen_toolchain") exports_files([ "Cargo.Bazel.lock", @@ -7,7 +7,7 @@ exports_files([ rust_bindgen_toolchain( name = "bindgen_toolchain_impl", - bindgen = "@rules_rust//bindgen/3rdparty:bindgen", + bindgen = "@rules_rust_bindgen//3rdparty:bindgen", clang = "@rules_ros2_config_clang//:clang", libclang = "@rules_ros2_config_clang//:libclang", ) @@ -15,5 +15,5 @@ rust_bindgen_toolchain( toolchain( name = "bindgen_toolchain", toolchain = "bindgen_toolchain_impl", - toolchain_type = "@rules_rust//bindgen:toolchain_type", + toolchain_type = "@rules_rust_bindgen//:toolchain_type", ) diff --git a/repositories/rust/Cargo.Bazel.lock b/repositories/rust/Cargo.Bazel.lock index 8364f914..3e0adae8 100644 --- a/repositories/rust/Cargo.Bazel.lock +++ b/repositories/rust/Cargo.Bazel.lock @@ -1,5 +1,5 @@ { - "checksum": "f362c91be67a18a41b33c6c1292d19ab634ed392b591e497234365e246deffa1", + "checksum": "f8788f084d097ba7b0199b9a7d416c14f5df9c03b2fc49f422506f01b2b56597", "crates": { "autocfg 1.3.0": { "name": "autocfg", @@ -1748,9 +1748,6 @@ "wasm32-unknown-unknown": [ "wasm32-unknown-unknown" ], - "wasm32-wasi": [ - "wasm32-wasi" - ], "wasm32-wasip1": [ "wasm32-wasip1" ], @@ -1789,5 +1786,6 @@ "serde_json 1.0.128", "signal-hook 0.3.17" ], - "direct_dev_deps": [] + "direct_dev_deps": [], + "unused_patches": [] } diff --git a/repositories/rust_setup_stage_1.bzl b/repositories/rust_setup_stage_1.bzl index df8407d6..168468cd 100644 --- a/repositories/rust_setup_stage_1.bzl +++ b/repositories/rust_setup_stage_1.bzl @@ -5,8 +5,15 @@ def rust_setup_stage_1(): maybe( http_archive, name = "rules_rust", - sha256 = "af4f56caae50a99a68bfce39b141b509dd68548c8204b98ab7a1cafc94d5bb02", - url = "https://github.com/bazelbuild/rules_rust/releases/download/0.54.1/rules_rust-v0.54.1.tar.gz", + sha256 = "b191375028448a69532046e901d8e6e627a6b00d58bec79027a05c1d3e090d00", + url = "https://github.com/bazelbuild/rules_rust/releases/download/0.55.1/rules_rust-0.55.1.tar.gz", + ) + + maybe( + http_archive, + name = "rules_rust_bindgen", + sha256 = "866c67cb176971cde5d935dc2c4c21e877718ca78f1fbc30b9699f41205f5815", + urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.55.1/rules_rust_bindgen-0.55.1.tar.gz"], ) maybe( @@ -24,16 +31,3 @@ def rust_setup_stage_1(): "@com_github_mvukov_rules_ros2//repositories/patches:ros2_rust_logging.patch", ], ) - - # Only needed for CI, see https://github.com/bazelbuild/rules_rust/pull/2698. - maybe( - http_archive, - name = "com_github_mvukov_rules_ros2_cargo_bazel", - build_file_content = """ -exports_files([ - "cargo-bazel", -]) -""", - sha256 = "6d6d68b898b38cb58d3c29e2e54d5795e2f652ebcac1ecf3bb0ac99fc86480e7", - url = "https://github.com/mvukov/rules_rust/releases/download/0.46.0-mvukov-cargo-bazel/cargo-bazel.zip", - ) diff --git a/repositories/rust_setup_stage_2.bzl b/repositories/rust_setup_stage_2.bzl index 573c4657..de1e4e3d 100644 --- a/repositories/rust_setup_stage_2.bzl +++ b/repositories/rust_setup_stage_2.bzl @@ -1,6 +1,6 @@ -load("@rules_rust//bindgen:repositories.bzl", "rust_bindgen_dependencies") load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies") load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains") +load("@rules_rust_bindgen//:repositories.bzl", "rust_bindgen_dependencies") load("//repositories:clang_configure.bzl", "clang_configure") def rust_setup_stage_2(): From 9b23deef390fefe5e0741a48d273bcebcd5cd264 Mon Sep 17 00:00:00 2001 From: Milan Vukov Date: Sun, 8 Dec 2024 15:06:40 +0100 Subject: [PATCH 6/6] rm accidentally added rustfmt files --- rustfmt.toml | 4 ---- rustfmt.txt | 1 - 2 files changed, 5 deletions(-) delete mode 100644 rustfmt.toml delete mode 100644 rustfmt.txt diff --git a/rustfmt.toml b/rustfmt.toml deleted file mode 100644 index 2d50e46e..00000000 --- a/rustfmt.toml +++ /dev/null @@ -1,4 +0,0 @@ -error_on_line_overflow = true -wrap_comments = true -comment_width = 100 -group_imports = "StdExternalCrate" diff --git a/rustfmt.txt b/rustfmt.txt deleted file mode 100644 index f29126e7..00000000 --- a/rustfmt.txt +++ /dev/null @@ -1 +0,0 @@ -@rules_rust//tools/upstream_wrapper:rustfmt