Repository navigation
Add build-time-fixed RMW implementation selection - #430
Open
apojomovsky-tri-ctr wants to merge 7 commits into
Open
apojomovsky-tri-ctr wants to merge 7 commits into
apojomovsky-tri-ctr wants to merge 7 commits into
Conversation
Author
|
FYI @julianadrianheine @calderpg-tri (my user is pending being invited as a collaborator, so I cannot add reviewers) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ros_cc_binarytargets select their RMW middleware at runtime:RMW_IMPLEMENTATIONis set as an env var, andrmw_implementation's dispatch library resolves the real backend viadlopen(). 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 followexecve()/re-exec.What this adds
A new
rmw_implementation_explicitflag onros_cc_binary(defaultFalse, no change to existing targets). WhenTrue, the chosen backend is renamed tolibrmw_implementation.soand linked in directly at build time, satisfyinglibrcl.so's existing dependency on that name through ordinary dynamic linking, nodlopen(), noRMW_IMPLEMENTATIONenv var needed at runtime.Testing
configure_package_rmw_implementation_override_test.py) covering both cases: a package that shipslib<name>.soand one that doesn't.ros_cc_binarytarget: withRMW_IMPLEMENTATIONunset entirely,straceshows zerodlopen()calls for RMW selection, and the binary runs correctly.Scope / compatibility
Opt-in only,
rmw_implementation_explicitdefaults toFalseand every existing target is unaffected. Only wired throughros_cc_binaryso far, notros_cc_testorros_py_binary/ros_py_test.This change is