colcon / colcon-ros

Extension for colcon to support ROS packages
http://colcon.readthedocs.io
Apache License 2.0
13 stars 26 forks source link

colcon --symlink-install fails to symlink versioned (catkin) libraries #147

Open rhaschke opened 10 months ago

rhaschke commented 10 months ago

I'm building ROS1 packages, e.g. moveit_calibration with colcon build --symlink-install. There we use versioned libraries: set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")

However, this causes colcon to symlink libs into the wrong folder (package instead of package/lib) and w/o symlinking .so:

> find . -iname "moveit_handeye_calibration_rviz_plugin.so*"
./install/moveit_handeye_calibration_rviz_plugin/moveit_handeye_calibration_rviz_plugin.so.0.1.0
./build/moveit_handeye_calibration_rviz_plugin/devel/lib/moveit_handeye_calibration_rviz_plugin.so.0.1.0
./build/moveit_handeye_calibration_rviz_plugin/devel/lib/moveit_handeye_calibration_rviz_plugin.so

When dropping the VERSION setting, but still performing a symlink install, it works:

> find . -iname "moveit_handeye_calibration_rviz_plugin.so*"
./install/moveit_handeye_calibration_rviz_plugin/lib/libmoveit_handeye_calibration_rviz_plugin.so
./build/moveit_handeye_calibration_rviz_plugin/devel/lib/libmoveit_handeye_calibration_rviz_plugin.so

A --merge-install with versioned libs works as expected as well:

> find . -iname "libmoveit_handeye_calibration_rviz_plugin*" | xargs ls -1la
lrwxrwxrwx 1 rhaschke nistaff      29 Nov  7 16:00 ./build/moveit_handeye_calibration_rviz_plugin/devel/lib/libmoveit_handeye_calibration_rviz_plugin.so -> libmoveit_handeye_calibration_rviz_plugin.so.0.1.0
-rwxr-x--x 1 rhaschke nistaff 2763456 Nov  7 16:00 ./build/moveit_handeye_calibration_rviz_plugin/devel/lib/libmoveit_handeye_calibration_rviz_plugin.so.0.1.0
lrwxrwxrwx 1 rhaschke nistaff      29 Nov  7 16:00 ./install/lib/libmoveit_handeye_calibration_rviz_plugin.so -> libmoveit_handeye_calibration_rviz_plugin.so.0.1.0
-rw-r--r-- 1 rhaschke nistaff 2763456 Nov  7 16:00 ./install/lib/libmoveit_handeye_calibration_rviz_plugin.so.0.1.0

So, it seems the only missing use case is versioned libs and a symlinked install.

cottsay commented 2 months ago

I can't transfer issues cross-organization, but this ticket belongs on ros/catkin. While colcon does tell catkin that it should use symlinks, the actual symlinking logic is implemented there.

Should be fixed by ros/catkin#1197.