rcpputils icon indicating copy to clipboard operation
rcpputils copied to clipboard

add load_library: Return actual library object, rather than file path as find_library

Open EricCousineau-TRI opened this issue 5 years ago • 2 comments

find_library shouldn't really return a path, but instead a loaded library.

This would permit things like https://github.com/ros2/rcutils/issues/143 to not have to worry about paths, and could possibly reduce any possibility of ODR by returning currently loaded libraries rather than loading a new one.

EricCousineau-TRI avatar Apr 02 '19 00:04 EricCousineau-TRI

find_library shouldn't really return a path, but instead a loaded library.

The current behavior of only finding the library makes sense for the existing function. That being said introducing another function like load_library would be an option.

dirk-thomas avatar Sep 10 '19 15:09 dirk-thomas

Aye, I didn't mean necessarily that find_library would keep it's name, so yeah, load_library would be good.

But I also wanted to imply that, at some point, it would be nice to fully encapsulate the path of a library and the only suggested workflow for handling libraries in ROS2 would be solely through load_library; then that could admit using already-loaded libraries. Then find_library would become deprecated (or at least discouraged...).

EricCousineau-TRI avatar Sep 25 '19 22:09 EricCousineau-TRI