Skip to content

Fix jazzy interfaces#82

Open
EugenioCollado wants to merge 2 commits into
jazzyfrom
jazzy_fix_interfaces
Open

Fix jazzy interfaces#82
EugenioCollado wants to merge 2 commits into
jazzyfrom
jazzy_fix_interfaces

Conversation

@EugenioCollado

Copy link
Copy Markdown

This PR fixes two issues in the Micro XRCE-DDS typesupport generators that show up when building recent ROS 2 interface sets inside a micro-ROS firmware workspace.

First, the generated C and C++ Micro XRCE-DDS typesupport libraries could fail to link against dependency typesupport libraries when those dependencies exported non-absolute library names. The previous logic relied on target_link_libraries() receiving names that CMake could resolve as real linkable artifacts, which is not always true in this workflow. This PR keeps the existing exported values when they are already absolute paths, and otherwise resolves them with a small find_library() fallback using the dependency package prefix.

Second, the C service templates were generating event-related service typesupport hooks. That path pulls in service_msgs/msg/ServiceEventInfo, which is currently outside the supported Micro XRCE-DDS service event flow and causes link failures in micro-ROS builds. This PR disables event-specific hooks in the generated Micro XRCE-DDS C service typesupport and leaves those fields unset.

These changes are intentionally small and focused on making the Micro XRCE-DDS generators robust in micro-ROS workspaces without changing the normal successful path when dependencies are already exported correctly.

What changed

Add a safer dependency library resolution fallback in:

  • rosidl_typesupport_microxrcedds_c_generate_interfaces.cmake
  • rosidl_typesupport_microxrcedds_cpp_generate_interfaces.cmake

Stop generating unsupported service event hooks in:

  • srv__type_support_c.c.em
  • srv__rosidl_typesupport_microxrcedds_c.h.em

Why
This fixes firmware workspace build failures affecting action and service-heavy interface packages such as example_interfaces, test_msgs, and std_srvs.

Signed-off-by: Eugenio Collado <eugeniocollado@eprosima.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves robustness of the Micro XRCE-DDS typesupport generators when building newer ROS 2 interface sets in micro-ROS firmware workspaces, by hardening dependency linking and disabling unsupported service event hooks in generated C service typesupport.

Changes:

  • Add find_library()-based fallback to resolve dependency typesupport libraries to absolute paths in the C and C++ generator CMake.
  • Stop generating/using service event message typesupport hooks for C services (leave event-related fields unset / NULL).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
rosidl_typesupport_microxrcedds_cpp/cmake/rosidl_typesupport_microxrcedds_cpp_generate_interfaces.cmake Adds dependency library path resolution fallback before linking dependency typesupport libs.
rosidl_typesupport_microxrcedds_c/cmake/rosidl_typesupport_microxrcedds_c_generate_interfaces.cmake Mirrors the dependency library path resolution fallback for the C generator.
rosidl_typesupport_microxrcedds_c/resource/srv__type_support_c.c.em Removes generation of service event message support and sets event-related service hooks to NULL.
rosidl_typesupport_microxrcedds_c/resource/srv__rosidl_typesupport_microxrcedds_c.h.em Removes emission of event message Micro XRCE-DDS C headers for services.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

2 participants