Skip to content
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

Update vendored interface packages #423

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nwn
Copy link
Contributor

@nwn nwn commented Oct 27, 2024

In preparation for rclrs supporting actions (#410), it will need new dependencies on certain interface packages: specifically, action_msgs and its dependency unique_identifier_msgs. Since rclrs is a crate on crates.io and the interface packages are not, they need to be vendored into the rclrs code. This PR does so.

In the first commit, the rclrs/vendor_interfaces.py script is updated to vendor the above message packages in addition to the existing ones. In the process, the set of vendored packages is collapsed into a single list rather than being repeated throughout the script. Support is also added for packages with an action.rs file, though this is not currently used.

The second commit silences the clippy::derive_partial_eq_without_eq and clippy::upper_case_acronyms lints in the generated code for interface packages. This was already being done by the vendored packages in rclrs, but was moved to rosidl_generator_rs for the sake of downstream users who may also enforce clippy on them.

The third commit is the result of running the updated script on the install output of the desired packages with the latest version of the rosidl_generator_rs generator. In addition to introducing the new vendored packages, this resulted in some trivial changes to the existing ones: replacing std::os::raw::c_void with its alias std::ffi::c_void and a whitespace change.

This updates the vendor_interfaces.py script to also vendor in the
action_msgs and unique_identifier_msgs packages. The script is modified
to always use a list of package names rather than hard-coding the
package names everywhere.
In case a user enforces clippy linting on these generated packages,
silence expected warnings. This is already the case in rclrs, but should
be applied directly to the generated packages for the sake of downstream
users.

The `clippy::derive_partial_eq_without_eq` lint was already being
disabled for the packages vendored by rclrs, but is now moved to the
rosidl_generator_rs template instead. This is necessary since we always
derive the PartialEq trait, but can't necessary derive Eq, and so don't.

The `clippy::upper_case_acronyms` is new and was added to account for
message type names being upper-case acrynyms, like
unique_identifier_msgs::msg::UUID.
This updates the message packages vendored under the rclrs `vendor`
module. The vendor_interfaces.py script was used for reproducibility.

The existing packages – rcl_interfaces, rosgraph_msgs, and
builtin_interfaces – are only modified in that they now use the
std::ffi::c_void naming for c_void instead of the std::os::raw::c_void
alias and disable certain clippy lints.

The action_msgs and unique_identifier_msgs packages are newly added to
enable adding action support to rclrs. action_msgs is needed for
interaction with action goal info and statuses, and has a dependency on
unique_identifier_msgs.
@nwn nwn force-pushed the nwn-update-vendor-packages branch from f5ed817 to 7eaf213 Compare October 27, 2024 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant