Closed sloretz closed 5 years ago
so maybe a different package is adding
/opt/ros/dashing/lib
When building binary packages the ros_workspace package, which provides the /opt/ros/$ROSDISTRO/
root setup files also sets some "sane defaults" like adding bin to PATH, lib to LD_LIBRARY_PATH, and the python module directory to PYTHONPATH. So the buildfarm does indeed mask this problem.
@nuclearsandwich OK if I merge this? I'd like to get it into the dashing patch release.
@nuclearsandwich OK if I merge this? I'd like to get it into the dashing patch release.
Yes please do. I assumed that you would since you have the power. I will be clearer next time.
This fixes a bug that prevents building composable nodes using the ROS 2 dashing debian packages.
Before this PR
ament_export_libraries(class_loader)
is called before the libraryclass_loader
is created. This causes a check in ament_export_libraries to determine that the name is not a target, and so it callsament_export_library_names(class_loader)
. That causes the nameclass_loader
to be stored in_exported_library_names
instead of_exported_libraries
. Plain library names are searched usingfind_library()
without any PATHS. This fails.Packages that
find_package(rclcpp_components)
emit a cmake warning like:and fail to build composable nodes with linker errors
This PR fixes it by moving the call to
ament_export_libraries()
to after where the target is created. That changes the logic downstream packages use tofind_library(class_loader)
to be one that specifies paths toclass_loader
's lib directory.I have no idea why the build farm didn't catch this. I think I would have expected this job to be failing but it's not. Something is causing
find_library(class_loader)
to succeed in the build farm, but not when I as a user dofind_package(rclcpp_components)
. The library path is/opt/ros/dashing/lib/libclass_loader.so
, so maye a different package is adding/opt/ros/dashing/lib
toCMAKE_LIBRARY_PATH
in it's<project>Config.cmake
?Also, the logic in
ament_export_libraries()
should probably be moved to the package hook. I'll make a separate PR for that.I think it might also be the cause of https://answers.ros.org/question/327691/building-components-from-clion-doesnt-work/