canonical / snapcraft

Package, distribute, and update any app for Linux and IoT.
https://snapcraft.io
GNU General Public License v3.0
1.18k stars 440 forks source link

ROS2 Jazzy plugins fails with `rosdep` 0.25 #4998

Closed mr-cal closed 2 weeks ago

mr-cal commented 3 weeks ago

Bug Description

rosdep 0.25 prints a deprecation notice about pkg_resources which causes the ROS2 Jazzy plugin to fail.

To Reproduce

Build any of the snaps in tests/spread/extensions/ros2-jazzy-hello

Relevant log output

:: + colcon build --base-paths /snapcraft/tests/spread/extensions/snaps/ros2-jazzy-hello/parts/hello/src --build-base /snapcraft/tests/spread/extensions/snaps/ros2-jazzy-hello/parts/hello/build --merge-install --install-base /snapcraft/tests/spread/extensions/snaps/ros2-jazzy-hello/parts/hello/install/opt/ros/snap --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_PREFIX_PATH=/snap/ros-jazzy-desktop-dev/current/usr --parallel-workers 1
:: Starting >>> colcon_ros2_rlcpp_hello
:: Finished <<< colcon_ros2_rlcpp_hello [11.2s]
::
:: Summary: 1 package finished [11.5s]
:: + '[' -f /snapcraft/tests/spread/extensions/snaps/ros2-jazzy-hello/parts/hello/install/opt/ros/snap/COLCON_IGNORE ']'
:: + rm /snapcraft/tests/spread/extensions/snaps/ros2-jazzy-hello/parts/hello/install/opt/ros/snap/COLCON_IGNORE
:: + env -i LANG=C.UTF-8 LC_ALL=C.UTF-8 PATH=/snap/snapcraft/x1/libexec/snapcraft:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin SNAP=/snap/snapcraft/x1 SNAP_ARCH=amd64 SNAP_NAME=snapcraft SNAP_VERSION=8.3.2.post62+git8cf2021d /snap/snapcraft/x1/bin/python -I /snap/snapcraft/x1/lib/python3.10/site-packages/snapcraft/parts/plugins/_ros.py stage-runtime-dependencies --part-src /snapcraft/tests/spread/extensions/snaps/ros2-jazzy-hello/parts/hello/src --part-install /snapcraft/tests/spread/extensions/snaps/ros2-jazzy-hello/parts/hello/install --ros-version 2 --ros-distro jazzy --target-arch amd64 --stage-cache-dir /root/.cache/snapcraft --base core24
:: Staging runtime dependencies...
:: Running ['rosdep', 'resolve', 'rclcpp', '--rosdistro', 'jazzy']
:: Traceback (most recent call last):
::   File "/snap/snapcraft/x1/lib/python3.10/site-packages/snapcraft/parts/plugins/_ros.py", line 423, in <module>
::     plugin_cli()
::   File "/snap/snapcraft/x1/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
::     return self.main(*args, **kwargs)
::   File "/snap/snapcraft/x1/lib/python3.10/site-packages/click/core.py", line 1078, in main
::     rv = self.invoke(ctx)
::   File "/snap/snapcraft/x1/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
::     return _process_result(sub_ctx.command.invoke(sub_ctx))
::   File "/snap/snapcraft/x1/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
::     return ctx.invoke(self.callback, **ctx.params)
::   File "/snap/snapcraft/x1/lib/python3.10/site-packages/click/core.py", line 783, in invoke
::     return __callback(*args, **kwargs)
::   File "/snap/snapcraft/x1/lib/python3.10/site-packages/snapcraft/parts/plugins/_ros.py", line 387, in stage_runtime_dependencies
::     parsed = _parse_rosdep_resolve_dependencies(
::   File "/snap/snapcraft/x1/lib/python3.10/site-packages/snapcraft/parts/plugins/_ros.py", line 78, in _parse_rosdep_resolve_dependencies
::     raise RosdepUnexpectedResultError(dependency_name, output)
:: __main__.RosdepUnexpectedResultError: Received unexpected result from rosdep when trying to resolve Dependency(name='rclcpp', condition='$ROS_VERSION == 2', evaluated_condition=True):
:: /usr/bin/rosdep:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
::   from pkg_resources import load_entry_point
:: #apt
:: ros-jazzy-rclcpp
Failed to run the build script for part 'hello'.
Recommended resolution: Check the build output and verify the project can work with the 'colcon' plugin.
For more information, check out: https://canonical-snapcraft.readthedocs-hosted.com/en/latest/reference/plugins.html
Full execution log: '/root/.local/state/snapcraft/log/snapcraft-20240822-001348.625993.log'

What needs to get done

Wait for the upstream issue reported by @artivis to be resolved: https://github.com/ros-infrastructure/rosdep/issues/982

syncronize-issues-to-jira[bot] commented 3 weeks ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3290.

This message was autogenerated

mr-cal commented 2 weeks ago

Fixed in rosdep 0.25.1: https://github.com/ros-infrastructure/rosdep/pull/984