ros2_rust icon indicating copy to clipboard operation
ros2_rust copied to clipboard

Prevent message packages from crates.io to be included during the build

Open esteve opened this issue 1 year ago • 15 comments

As a side effect of https://github.com/ros2-rust/ros2_rust/pull/392, a set of message packages are now published on crates.io (see https://crates.io/crates/builtin_interfaces for example), although they've been yanked, this exposes an issue in our build system that anyone could register a crate named like a message package and potentially cause issues.

I've thought of something like this:

  • rosidl_generator_rs stays the same
  • a new base ros2_messages crate
  • the ros2_messages crate can accept a list of features, each feature is the name of a message package
  • the ros2_messages crate uses ament_rs to find the paths of the generated Rust files for each message package and uses include!() on those files
  • downstream packages can access the messages via ros2_messages::buildin_interfaces, ros2_messages::std_msgs, etc.

I'm going to work on this urgently as the current situation needs to be fixed before it causes any breakage.

@jhdcs @maspe36 @mxgrey @luca-della-vedova thought?

esteve avatar Apr 19 '24 10:04 esteve