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 build silent package.xml parse errors #153

Closed LeroyR closed 7 months ago

LeroyR commented 10 months ago

When using "broken" package.xml (missing maintainer field) e.g.:

<package format="2">
  <name>package_2</name>
  <version>0.0.0</version>
  <description>
  This package provides foo capability.
  </description>
  <license>TODO</license>

  <buildtool_depend>catkin</buildtool_depend>
  <depend>package_1</depend>

</package>

while using ros1-style find_package(catkin REQUIRED package_1), colcon is not able to parse the dependencies from CMakeLists and silently fails to parse them from package.xml. colcon will thus build both packages simultaneously:

Starting >>> package_1
Starting >>> package_2                  
--- stderr: package_2                                                              
  ...
  Could not find a package configuration file provided by "package_1"
  ...
---
Failed   <<< package_2 [0.95s, exited with code 1]
Aborted  <<< package_1 [1.30s]    

Adding the maintainer, colcon is able to parse the dependencies from package.xml and build packages in the correct order.

We found the parsing error (from catkin) only by manually building the packages:

colcon build --packages-select package_1
source install/setup.bash 
colcon build --packages-select package_2
Starting >>> package_2
--- stderr: package_2           
...
catkin_pkg.package.InvalidPackage: Error(s) in package '/home/robocup-adm/tmp/colcon_test/package_2/package.xml':
Package 'package_2' must declare at least one maintainer  
...      

I think colcon should print a warning if package.xml is found but fails to parse.

cottsay commented 7 months ago

Duplicate of #146