Skip to content

Add build-time-fixed RMW implementation selection - #430

Open
apojomovsky-tri-ctr wants to merge 7 commits into
RobotLocomotion:mainfrom
apojomovsky-tri-ctr:feat/explicit-rmw-implementation
Open

apojomovsky-tri-ctr wants to merge 7 commits into
RobotLocomotion:mainfrom
apojomovsky-tri-ctr:feat/explicit-rmw-implementation

Conversation

@apojomovsky-tri-ctr

@apojomovsky-tri-ctr apojomovsky-tri-ctr commented Aug 31, 2026 •

Copy link
Copy Markdown

Problem

ros_cc_binary targets select their RMW middleware at runtime: RMW_IMPLEMENTATION is set as an env var, and rmw_implementation's dispatch library resolves the real backend via dlopen(). That runtime indirection is invisible in the binary itself (nothing in the ELF says which backend it uses) and is exactly the kind of thing that breaks under tools that don't transparently follow execve()/re-exec.

What this adds

A new rmw_implementation_explicit flag on ros_cc_binary (default False, no change to existing targets). When True, the chosen backend is renamed to librmw_implementation.so and linked in directly at build time, satisfying librcl.so's existing dependency on that name through ordinary dynamic linking, no dlopen(), no RMW_IMPLEMENTATION env var needed at runtime.

Testing

  • Unit test (configure_package_rmw_implementation_override_test.py) covering both cases: a package that ships lib<name>.so and one that doesn't.
  • Verified end to end against a real downstream ros_cc_binary target: with RMW_IMPLEMENTATION unset entirely, strace shows zero dlopen() calls for RMW selection, and the binary runs correctly.

Scope / compatibility

Opt-in only, rmw_implementation_explicit defaults to False and every existing target is unaffected. Only wired through ros_cc_binary so far, not ros_cc_test or ros_py_binary/ros_py_test.


This change is Reviewable

@apojomovsky-tri-ctr

Copy link
Copy Markdown
Author

FYI @julianadrianheine @calderpg-tri

(my user is pending being invited as a collaborator, so I cannot add reviewers)

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