colcon / colcon-clean

A colcon extension to clean package workspaces
http://colcon.readthedocs.io
Apache License 2.0
46 stars 4 forks source link

`InstallBaseHandler` incorrect/incomplete paths #48

Open MatthijsBurgh opened 6 months ago

MatthijsBurgh commented 6 months ago

The locations a package can be installed can be determined by the package itself. I think this is all defined in the build_base/PKG_NAME/install_manifest.txt. I think deleting the files from file is the most robust solution.

As the current implementation only deletes install_base/PKG_NAME. Though, this directory never exists.

Any solution based on patterns will be incomplete.

Looking forward to your opinion.

ruffsl commented 6 months ago

Ah, it looks like this is something provided by ament_cmake. Thanks! TDIL...

I think this is all defined in the build_base/PKG_NAME/install_manifest.txt.

As a personal anecdote, looking through a workspace with Nav2, most install_manifest.txt files look empty? :thinking:

``` ruffsl@c2970e878568:/opt/overlay_ws$ find ./build/nav2_* -name "install_manifest.txt" -exec sh -c 'echo {}; cat {}' \; ./build/nav2_amcl/install_manifest.txt ./build/nav2_behavior_tree/install_manifest.txt ./build/nav2_behaviors/install_manifest.txt ./build/nav2_bringup/install_manifest.txt ./build/nav2_bt_navigator/install_manifest.txt ./build/nav2_collision_monitor/install_manifest.txt ./build/nav2_common/install_manifest.txt ./build/nav2_constrained_smoother/install_manifest.txt ./build/nav2_controller/install_manifest.txt ./build/nav2_core/install_manifest.txt ./build/nav2_costmap_2d/install_manifest.txt ./build/nav2_dwb_controller/install_manifest.txt ./build/nav2_lifecycle_manager/install_manifest.txt ./build/nav2_map_server/install_manifest.txt ./build/nav2_mppi_controller/install_manifest.txt ./build/nav2_msgs/install_manifest.txt /opt/overlay_ws/install/nav2_msgs/lib/libnav2_msgs__rosidl_generator_c.so /opt/overlay_ws/install/nav2_msgs/lib/libnav2_msgs__rosidl_typesupport_fastrtps_c.so /opt/overlay_ws/install/nav2_msgs/lib/libnav2_msgs__rosidl_typesupport_fastrtps_cpp.so /opt/overlay_ws/install/nav2_msgs/lib/libnav2_msgs__rosidl_typesupport_introspection_c.so /opt/overlay_ws/install/nav2_msgs/lib/libnav2_msgs__rosidl_typesupport_c.so /opt/overlay_ws/install/nav2_msgs/lib/libnav2_msgs__rosidl_typesupport_introspection_cpp.so /opt/overlay_ws/install/nav2_msgs/lib/libnav2_msgs__rosidl_typesupport_cpp.so /opt/overlay_ws/install/nav2_msgs/lib/libnav2_msgs__rosidl_generator_py.so /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/export_nav2_msgs__rosidl_generator_cExport.cmake /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/export_nav2_msgs__rosidl_generator_cExport-release.cmake /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/export_nav2_msgs__rosidl_typesupport_fastrtps_cExport.cmake /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/export_nav2_msgs__rosidl_typesupport_fastrtps_cExport-release.cmake /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/export_nav2_msgs__rosidl_generator_cppExport.cmake /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/export_nav2_msgs__rosidl_typesupport_fastrtps_cppExport.cmake /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/export_nav2_msgs__rosidl_typesupport_fastrtps_cppExport-release.cmake /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/nav2_msgs__rosidl_typesupport_introspection_cExport.cmake /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/nav2_msgs__rosidl_typesupport_introspection_cExport-release.cmake /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/nav2_msgs__rosidl_typesupport_cExport.cmake /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/nav2_msgs__rosidl_typesupport_cExport-release.cmake /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/nav2_msgs__rosidl_typesupport_introspection_cppExport.cmake /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/nav2_msgs__rosidl_typesupport_introspection_cppExport-release.cmake /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/nav2_msgs__rosidl_typesupport_cppExport.cmake /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/nav2_msgs__rosidl_typesupport_cppExport-release.cmake /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/export_nav2_msgs__rosidl_generator_pyExport.cmake /opt/overlay_ws/install/nav2_msgs/share/nav2_msgs/cmake/export_nav2_msgs__rosidl_generator_pyExport-release.cmake./build/nav2_navfn_planner/install_manifest.txt ./build/nav2_planner/install_manifest.txt ./build/nav2_regulated_pure_pursuit_controller/install_manifest.txt ./build/nav2_rotation_shim_controller/install_manifest.txt ./build/nav2_rviz_plugins/install_manifest.txt /opt/overlay_ws/install/nav2_rviz_plugins/lib/libnav2_rviz_plugins.so /opt/overlay_ws/install/nav2_rviz_plugins/share/nav2_rviz_plugins/cmake/nav2_rviz_pluginsExport.cmake /opt/overlay_ws/install/nav2_rviz_plugins/share/nav2_rviz_plugins/cmake/nav2_rviz_pluginsExport-release.cmake./build/nav2_smac_planner/install_manifest.txt ./build/nav2_smoother/install_manifest.txt ./build/nav2_theta_star_planner/install_manifest.txt ./build/nav2_util/install_manifest.txt ./build/nav2_velocity_smoother/install_manifest.txt ./build/nav2_voxel_grid/install_manifest.txt ./build/nav2_waypoint_follower/install_manifest.txt ```

Aside from that, having to check a build base path in order to delete a package's install base path adds a conditional order of operations. E.g. if the build base path was cleaned prior and no longer exists, then we'd have no install_manifest to rely on. Any suggestions on how to handle this? That, and the case where a package provides a install_manifest, but never includes anything, or packages unrelated to cmake?