ros-infrastructure / superflore

An extended platform release manager for Robot Operating System
Apache License 2.0
52 stars 33 forks source link

catkin_pkg.package.InvalidPackage: Only one <build_type> element is permitted #289

Open brothermechanic opened 2 years ago

brothermechanic commented 2 years ago

Hello I got rhis error when try to generate packages for gentoo.

...
>>>> 7.6%: Successfully generated ebuild for package 'asio_cmake_module'.
>>>> Successfully generated ebuild for package 'async_web_server_cpp'.
>>>> 7.8%: Successfully generated ebuild for package 'async_web_server_cpp'.
!!!! Failed to generate ebuild for package automotive_autonomy_msgs!
>>>> Cleaning up temporary directory /tmp/tmpezhxksv7
Traceback (most recent call last):
  File "/usr/bin/superflore-gen-ebuilds", line 33, in <module>
    sys.exit(load_entry_point('superflore==0.3.3', 'console_scripts', 'superflore-gen-ebuilds')())
  File "/usr/lib/python3.10/site-packages/superflore-0.3.3-py3.10.egg/superflore/generators/ebuild/run.py", line 173, in main
  File "/usr/lib/python3.10/site-packages/superflore-0.3.3-py3.10.egg/superflore/generate_installers.py", line 51, in generate_installers
  File "/usr/lib/python3.10/site-packages/superflore-0.3.3-py3.10.egg/superflore/generators/ebuild/gen_packages.py", line 84, in regenerate_pkg
  File "/usr/lib/python3.10/site-packages/superflore-0.3.3-py3.10.egg/superflore/generators/ebuild/gen_packages.py", line 78, in regenerate_pkg
  File "/usr/lib/python3.10/site-packages/superflore-0.3.3-py3.10.egg/superflore/generators/ebuild/gen_packages.py", line 203, in __init__
  File "/usr/lib/python3.10/site-packages/superflore-0.3.3-py3.10.egg/superflore/generators/ebuild/gen_packages.py", line 132, in _gen_metadata_for_package
  File "/usr/lib/python3.10/site-packages/superflore-0.3.3-py3.10.egg/superflore/PackageMetadata.py", line 52, in __init__
  File "/usr/lib/python3.10/site-packages/catkin_pkg/package.py", line 166, in get_build_type
    raise InvalidPackage('Only one <build_type> element is permitted.', self.filename)
catkin_pkg.package.InvalidPackage: Only one <build_type> element is permitted.

I try to edit automotive_autonomy_msgs repo, but can't change repo path for superflore https://github.com/brothermechanic/automotive_autonomy_msgs/commit/3ef795c6864c22b2bcdbe4ad8df1da1f983d9439 Can someone help me? Thank you.

nuclearsandwich commented 2 years ago

catkin_pkg.package.InvalidPackage: Only one <build_type> element is permitted.

This indicates that one of the package.xml files in your distribution is malformed. In general multiple build types are invalid however this could also indicate that package.xml format 3 conditions are not being handled completely by superflore.

Can you provide a reproducible example of the superflore command you're running as well as a list of the current superflore, rosdep, and catkin_pkg versions?

brothermechanic commented 2 years ago

Hello superflore, rosdep and catkin_pkg was installed from latest git I think this package (it's failed for generation) have problem with catkin_pkg https://github.com/astuff/automotive_autonomy_msgs/blob/master/automotive_autonomy_msgs/package.xml#L25

Maybe we need some scripts for workaround

nuclearsandwich commented 2 years ago

superflore, rosdep and catkin_pkg was installed from latest git

This is, of course, possible but it is worth noting that we do not fully test or guarantee inter-operation of unreleased versions for ros-infrastructure packages and recommend instead using the latest release versions (with the current exception of ros_buildfarm where we always use the latest master).

I expect that superflore needs to handle evaluating package conditions in the current rosdistro context as the package linked appears to be using conditional build types correctly.

tomkimsour commented 2 years ago

I am not sure to understand how to solve this is issue. I have been running superflore-gen-ebuilds --ros-distro foxy --dry-run in order to update the ebuild files. As I understand, there is a file somewhere in catkin_package that is not formatted correctly. If I clone this package from source, how do I make superflore target this package instead of the one installed using apt ?

ros-discourse commented 2 years ago

This issue has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/ros-overlay-dead/28174/3

nuclearsandwich commented 2 years ago

I expect that superflore needs to handle evaluating package conditions in the current rosdistro context as the package linked appears to be using conditional build types correctly.

This is indeed the problem. automotive_autonomy_msgs uses conditional build types which Superflore doesn't currently support.

As I understand, there is a file somewhere in catkin_package that is not formatted correctly.

The problem is not in the catkin_pkg library but in superflore which does not correctly handle conditionals in the build type.

If I clone this package from source, how do I make superflore target this package instead of the one installed using apt ?

superflore reads distribution data from the rosdistro index. To modify what superflore is generating you would need to create your own forked rosdistro index and distribution.yaml for your target distributions and set the ROSIDSTRO_INDEX_URL environment variable when running superflore.