ros-tooling / action-ros-ci

Github Action to build and test ROS 2 packages using colcon
Apache License 2.0
145 stars 53 forks source link

Rolling CI fails #844

Closed Flova closed 4 months ago

Flova commented 8 months ago

Description

The build step in the rolling ci fails with what looks like a missing source command. The same CI setup passes the build step just fine for iron and humble. The failing package only contains some message descriptions.

Expected Behavior

The build of the messages should pass.

Actual Behavior

The build results in this error, which seems like ros isn't sourced correctly.

Starting >>> ipm_interfaces
  --- output: ipm_interfaces
  -- The C compiler identification is GNU 11.4.0
  -- The CXX compiler identification is GNU 11.4.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  CMake Error at CMakeLists.txt:9 (find_package):
    By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project
    has asked CMake to find a package configuration file provided by
    "ament_cmake", but CMake did not find one.

    Could not find a package configuration file provided by "ament_cmake" with
    any of the following names:

      ament_cmakeConfig.cmake
      ament_cmake-config.cmake

    Add the installation prefix of "ament_cmake" to CMAKE_PREFIX_PATH or set
    "ament_cmake_DIR" to a directory containing one of the above files.  If
    "ament_cmake" provides a separate development package or SDK, be sure it
    has been installed.

  -- Configuring incomplete, errors occurred!
  See also "/__w/ipm/ipm/ros_ws/build/ipm_interfaces/CMakeFiles/CMakeOutput.log".
  ---
  --- stderr: ipm_interfaces
  CMake Error at CMakeLists.txt:9 (find_package):
    By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project
    has asked CMake to find a package configuration file provided by
    "ament_cmake", but CMake did not find one.

    Could not find a package configuration file provided by "ament_cmake" with
    any of the following names:

      ament_cmakeConfig.cmake
      ament_cmake-config.cmake

    Add the installation prefix of "ament_cmake" to CMAKE_PREFIX_PATH or set
    "ament_cmake_DIR" to a directory containing one of the above files.  If
    "ament_cmake" provides a separate development package or SDK, be sure it
    has been installed.

  ---
  Failed   <<< ipm_interfaces [0.31s, exited with code 1]

  Summary: 0 packages finished [0.62s]
    1 package failed: ipm_interfaces
    1 package had stderr output: ipm_interfaces
    3 packages not processed

the error is from https://github.com/ros-sports/ipm but is also happening in other repos https://github.com/ros-sports/humanoid_base_footprint/pull/51 and doesn't seem to be package specific.

To Reproduce

** Steps to reproduce the behavior, e.g.

  1. Add a ros-action-ci targeting ROS rolling to your GitHub actions
  2. Run the CI
  3. See failed CI

System (please complete the following information)

Additional context

Used workflow definition:

# This is a basic workflow to help you get started with Actions

name: Build and Test (humble)

# Controls when the action will run. 
on:
  # Triggers the workflow on push
  push:
    branches: [ rolling ]

  # Triggers the workflow on pull requests
  pull_request:
    branches: [ rolling ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
    container:
      image: ubuntu:jammy

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      - uses: ros-tooling/setup-ros@v0.7
        with:
          use-ros2-testing: true
      - uses: ros-tooling/action-ros-ci@v0.3
        with:
          target-ros2-distro: humble
MichaelOrlov commented 8 months ago

@clalancette, @nuclearsandwich Any thoughts, why ament_cmake package not found on the Rolling ros-action-ci scripts?

christophebedard commented 8 months ago

This is probably related to the move to Ubuntu 24.04. There's an open PR on standby for that, but it might still need some adjustments. I won't have access to a computer until this upcoming Monday, though.

berndpfrommer commented 8 months ago

I have similar issues (only on rolling, works with iron and humble). For rolling it finds some ament stuff, but doesn't find the ament_clang_format_cmake package. Using setup-ros@0.7.1 and action-ros-ci@0.3.5. I'm confused what to use as the build image. I use ubuntu-latest, but since noble has not been release yet, wouldn't that default to jammy, an OS that rolling already has transitioned away from?

  -- Found ament_cmake_copyright: 0.16.3 (/opt/ros/rolling/share/ament_cmake_copyright/cmake)
  -- Found ament_cmake_cppcheck: 0.16.3 (/opt/ros/rolling/share/ament_cmake_cppcheck/cmake)
  -- Found ament_cmake_cpplint: 0.16.3 (/opt/ros/rolling/share/ament_cmake_cpplint/cmake)
  CMake Error at CMakeLists.txt:64 (find_package):
    By not providing "Findament_cmake_clang_format.cmake" in CMAKE_MODULE_PATH
    this project has asked CMake to find a package configuration file provided
    by "ament_cmake_clang_format", but CMake did not find one.

    Could not find a package configuration file provided by
    "ament_cmake_clang_format" with any of the following names:

      ament_cmake_clang_formatConfig.cmake
      ament_cmake_clang_format-config.cmake
berndpfrommer commented 8 months ago

In the case of ament_cmake_clang_format not found, this is due to ros-rolling-ament-cmake-clang-format not being installed during the setup phase. That package should be installed though because there is a dependency on it in package.xml, and there is also a rosdep db entry for ament_cmake_clang_format. The package also exists under rolling.

christophebedard commented 8 months ago

Yeah, you can see here that rosdep doesn't really install any ROS packages: https://github.com/ros-sports/humanoid_base_footprint/actions/runs/8342223887/job/22829915596#step:5:86. From what I understand, that workflow is configured not to install ROS 2 Rolling in setup-ros and rely on rosdep in action-ros-ci to install required dependencies. However, for example, it can't find sensor_msgs or ament_lint_common for Jammy.

This is due to the switch to Ubuntu 24.04 Noble*. rosdep now can only resolve Rolling packages on Ubuntu Noble, not Jammy. For example, I haven't run rosdep update on my system for quite a while, so it does correctly resolve ament_cmake for Ubuntu Jammy and Rolling (but not Ubuntu Noble and Rolling):

$ rosdep resolve ament_cmake --os=ubuntu:jammy --rosdistro=rolling
#apt
ros-rolling-ament-cmake
$ rosdep resolve ament_cmake --os=ubuntu:noble --rosdistro=rolling

ERROR: No definition of [ament_cmake] for OS version [noble]

No definition of [ament_cmake] for OS version [noble]
        rosdep key : ament_cmake
        OS name    : ubuntu
        OS version : noble
        Data:
_is_ros: true
                debian:
                  bullseye:
                    apt:
                      packages:
                      - ros-rolling-ament-cmake
                osx:
                  homebrew:
                    packages:
                    - ros/rolling/ament_cmake
                rhel:
                  '9':
                    dnf:
                      packages:
                      - ros-rolling-ament-cmake
                ubuntu:
                  jammy:
                    apt:
                      packages:
                      - ros-rolling-ament-cmake

After running rosdep update, it can resolve ament_cmake for Ubuntu Noble and Rolling, but not Ubuntu Jammy and Rolling:

$ rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
Skip end-of-life distro "ardent"
Skip end-of-life distro "bouncy"
Skip end-of-life distro "crystal"
Skip end-of-life distro "dashing"
Skip end-of-life distro "eloquent"
Skip end-of-life distro "foxy"
Skip end-of-life distro "galactic"
Skip end-of-life distro "groovy"
Add distro "humble"
Skip end-of-life distro "hydro"
Skip end-of-life distro "indigo"
Add distro "iron"
Skip end-of-life distro "jade"
Skip end-of-life distro "kinetic"
Skip end-of-life distro "lunar"
Skip end-of-life distro "melodic"
Add distro "noetic"
Add distro "rolling"
updated cache in /home/christophe.bedard/.ros/rosdep/sources.cache
$ rosdep resolve ament_cmake --os=ubuntu:jammy --rosdistro=rolling

ERROR: No definition of [ament_cmake] for OS version [jammy]

No definition of [ament_cmake] for OS version [jammy]
        rosdep key : ament_cmake
        OS name    : ubuntu
        OS version : jammy
        Data:
_is_ros: true
                debian:
                  bookworm:
                    apt:
                      packages:
                      - ros-rolling-ament-cmake
                osx:
                  homebrew:
                    packages:
                    - ros/rolling/ament_cmake
                rhel:
                  '9':
                    dnf:
                      packages:
                      - ros-rolling-ament-cmake
                ubuntu:
                  noble:
                    apt:
                      packages:
                      - ros-rolling-ament-cmake

$ rosdep resolve ament_cmake --os=ubuntu:noble --rosdistro=rolling
#apt
ros-rolling-ament-cmake

We need https://github.com/ros-tooling/setup-ros/pull/658 and https://github.com/ros-tooling/action-ros-ci/pull/842 to be able to use Noble with setup-ros and action-ros-ci.

(*) assuming this kind of disruption is intended; see also https://discourse.ros.org/t/preparing-ros-2-rolling-for-the-transition-to-ubuntu-24-04/35673/10

sea-bass commented 4 months ago

Have there been any updates on this? I've had contributions to several repos be blocked on Ubuntu 24.04 tests that use this action.

christophebedard commented 4 months ago

This should work fine if you're using Rolling on Ubuntu 24.04.

sea-bass commented 4 months ago

It indeed does... after your suggestion to update!

For those reading this issue, you should bump your version of this setup-ros action to the latest (0.7.7 or v0.7 at the time of writing).