Skip to content

Pip version of colcon unable to build ROS2 on Jammy #503

@mjcarroll

Description

@mjcarroll

There is an issue with the pip3 installed version of colcon which causes it to be unable to build ROS2 rolling on ubuntu jammy.

I have narrowed the issue to failing on ament_cmake_core with a particular set of colcon versions.

An example with a dockerfile that fails

https://gist.github.com/mjcarroll/a63c422fa8578a0999b5d8b20be76c96#file-dockerfile-bad

An example of a dockerfile pinned to specific colcon versions that works:

https://gist.github.com/mjcarroll/a63c422fa8578a0999b5d8b20be76c96#file-dockerfile-good

To test:

docker build -t ros-rolling:jammy .
docker run -it ros-rolling:jammy /bin/bash
cd ~/ros2_rolling
colcon build --packages-up-to ament_cmake_core

Error output:

--- stderr: ament_cmake_core                         
Traceback (most recent call last):
  File "/root/ros2_rolling/src/ament/ament_cmake/ament_cmake_core/cmake/package_templates/templates_2_cmake.py", line 21, in <module>
    from ament_package.templates import get_environment_hook_template_path
ModuleNotFoundError: No module named 'ament_package'
CMake Error at ament_cmake_package_templates-extras.cmake:41 (message):
  execute_process(/usr/bin/python3.10
  /root/ros2_rolling/src/ament/ament_cmake/ament_cmake_core/cmake/package_templates/templates_2_cmake.py
  /root/ros2_rolling/build/ament_cmake_core/ament_cmake_package_templates/templates.cmake)
  returned error code 1
Call Stack (most recent call first):
  CMakeLists.txt:19 (include)


---
Failed   <<< ament_cmake_core [0.22s, exited with code 1]
$ colcon version-check
colcon-argcomplete 0.3.3: up-to-date
colcon-bash 0.4.2: up-to-date
colcon-cd 0.1.1: up-to-date
colcon-cmake 0.2.26: up-to-date
colcon-core 0.8.1: up-to-date
colcon-defaults 0.2.6: up-to-date
colcon-devtools 0.2.3: up-to-date
colcon-library-path 0.2.1: up-to-date
colcon-metadata 0.2.5: up-to-date
colcon-notification 0.2.13: up-to-date
colcon-output 0.2.12: up-to-date
colcon-package-information 0.3.3: up-to-date
colcon-package-selection 0.2.10: up-to-date
colcon-parallel-executor 0.2.4: up-to-date
colcon-pkg-config 0.1.0: up-to-date
colcon-powershell 0.3.7: up-to-date
colcon-python-setup-py 0.2.7: up-to-date
colcon-recursive-crawl 0.2.1: up-to-date
colcon-ros 0.3.23: up-to-date
colcon-test-result 0.3.8: up-to-date
colcon-zsh 0.4.0: up-to-date

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions