Skip to content

Add library dependency to node executable in rclcpp_components_register_node#3047

Merged
ahcorde merged 1 commit intoros2:rollingfrom
dbwls99706:fix/components-register-node-dependency
Feb 2, 2026
Merged

Add library dependency to node executable in rclcpp_components_register_node#3047
ahcorde merged 1 commit intoros2:rollingfrom
dbwls99706:fix/components-register-node-dependency

Conversation

@dbwls99706
Copy link
Copy Markdown
Contributor

Fixes #2868

Description

The executable created by rclcpp_components_register_node now depends on the library target, ensuring the library is rebuilt when the executable is rebuilt.

As suggested by @sloretz in #2868, added SKIP_LIBRARY_DEPENDENCY option for cases where the plugin is provided by a different package.

Changes

  • Added add_dependencies(${node} ${target}) after add_executable()
  • Added SKIP_LIBRARY_DEPENDENCY option to opt-out of this behavior

Is this user-facing behavior change?

No

Did you use Generative AI?

Yes, Claude was used to identify the fix location and generate the implementation.

…er_node

Fixes #2868

The executable created by rclcpp_components_register_node now depends on
the library target, ensuring the library is rebuilt when the executable
is rebuilt.

Added SKIP_LIBRARY_DEPENDENCY option for cases where the plugin is
provided by a different package.

Signed-off-by: dbwls99706 <yujinhong3@gmail.com>
@fujitatomoya
Copy link
Copy Markdown
Collaborator

fujitatomoya commented Jan 30, 2026

Pulls: #3047
Gist: https://gist.githubusercontent.com/fujitatomoya/67f7f001712268df03437831ded441c3/raw/25678f9bfd67c3270d5a412e09b42058e07e0d9f/ros2.repos
BUILD args: --packages-above-and-dependencies rclcpp_components
TEST args: --packages-above rclcpp_components
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/18073

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@ahcorde ahcorde merged commit 38cfc4c into ros2:rolling Feb 2, 2026
3 checks passed
@peci1
Copy link
Copy Markdown

peci1 commented Feb 2, 2026

I guess backporting this is a no-go as it changes behavior?

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.

Shouldn't the node from rclcpp_components_register_node depend on the library?

4 participants