ros-tooling / action-ros-ci

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

Failed to build repos with msg packages #768

Open fmrico opened 2 years ago

fmrico commented 2 years ago

Description

When a repo includes a package with custom messages and other packages that depends on it to build, I get a CMake error.

From here

CMake Error at /home/runner/work/book_ros2/book_ros2/ros_ws/install/br2_tracking_msgs/share/br2_tracking_msgs/cmake/ament_cmake_export_targets-extras.cmake:18 (message):
2022-08-18T07:53:13.3580260Z   Failed to find exported target names in
2022-08-18T07:53:13.3580853Z   '/home/runner/work/book_ros2/book_ros2/ros_ws/install/br2_tracking_msgs/share/br2_tracking_msgs/cmake/export_br2_tracking_msgs__rosidl_generator_cExport.cmake'
2022-08-18T07:53:13.3581298Z Call Stack (most recent call first):
2022-08-18T07:53:13.3581747Z   /home/runner/work/book_ros2/book_ros2/ros_ws/install/br2_tracking_msgs/share/br2_tracking_msgs/cmake/br2_tracking_msgsConfig.cmake:41 (include)
2022-08-18T07:53:13.3582160Z   CMakeLists.txt:10 (find_package)

This bug is happening in CI in two of our repos:

It is like the msg files are not correctly generated in CI, not in local

Expected Behavior

Successfully build

Actual Behavior

Error in building

To Reproduce

Check specified repos

System (please complete the following information)

Additional context

christophebedard commented 2 years ago

I think I might also be getting the same error: https://github.com/ros2/ros2_tracing/runs/7892425175?check_suite_focus=true#step:5:745. This was fine before, but it started failing a few days or a week ago, so I think this is due to an upstream change (that doesn't happen when building locally). I haven't really had time to look into this.

I'm guessing you're relying on ROS 2 binaries, right? I think this doesn't happen if you make action-ros-ci build everything from source.

clalancette commented 2 years ago

We are currently in the middle of doing some revamps on the ROSIDL pipeline in Rolling. Everything currently works if you are building from source, but we've been holding off on doing a series of binary package releases since we have a bunch of more changes coming. That might explain what is going on here, a mismatch in the binary packages.

christophebedard commented 2 years ago

Thanks for the info @clalancette. My initial reaction was to use the pre-release APT repository, but that didn't seem to help.

fmrico commented 2 years ago

As @christophebedard said, building everything from sources does the trick, but it takes a lot of time (>45 minutes) build anything.

Please @clalancette, keep us informed on this issue as soon as we could use binaries again :pleading_face:

christophebedard commented 2 years ago

Not being able to use the binary packages for a whole month(-ish) is a bit weird :/

I haven't tried reproducing locally; I wonder if this is in part due to the actions themselves.

fmrico commented 2 years ago

Hi @christophebedard

I have just fixed it, using binaries, using osrf dockers instead of ros-tooling/setup-ros

[...]
jobs:
  build-and-test:
    runs-on: ${{ matrix.os }}
    container:
      image: osrf/ros:humble-desktop
    strategy:
      matrix:
        os: [ubuntu-22.04]
      fail-fast: false
    steps:
      - name: Install deps
        run: sudo apt-get update && sudo apt-get install -y wget python3-vcstool python3-colcon-coveragepy-result
      - name: Create custom repos
        run: wget -O /tmp/all.repos https://raw.githubusercontent.com/fmrico/book_ros2/main/third_parties.repos
      - name: build and test
        uses: ros-tooling/action-ros-ci@0.2.6
        with:
          package-name: br2_basics br2_bt_bumpgo br2_bt_patrolling br2_fsm_bumpgo_cpp br2_fsm_bumpgo_py br2_navigation br2_tf2_detector br2_tiago br2_tracking br2_tracking_msgs br2_vff_avoidance
[...]

Check this: https://github.com/fmrico/book_ros2/blob/main/.github/workflows/main.yaml

I hope it helps

christophebedard commented 2 years ago

Thanks for the info @fmrico. I'll have to look into it and try to identify the difference(s) between setup-ros and that Docker image.

orensbruli commented 1 year ago

I have found the same problem in one action in RMF:

As you can see looking into the workflow files, I'm not sure it's related with ros-tooling actions (which are not used at all): https://github.com/orensbruli/rmf/actions/runs/3014667747/workflow https://github.com/orensbruli/rmf/actions/runs/3014305754/workflow

christophebedard commented 1 year ago

I haven't had time to look into it, but it looks like this is starting to work again for me: https://github.com/ros2/ros2_tracing/actions/runs/3095525905