ros2 / rosidl

Packages which provide the ROS IDL (.msg) definition and code generation.
Apache License 2.0
76 stars 125 forks source link

rosidl_generator_cpp build fails on humble #822

Open christophfroehlich opened 2 months ago

christophfroehlich commented 2 months ago

Bug report

(Since yesterday?) the source build of the humble branch fails.

Starting >>> rosidl_generator_cpp
--- stderr: rosidl_generator_cpp                               
In file included from /workspaces/ros2_humble_ws/src/rosidl/rosidl_generator_cpp/test/test_msg_initialization.cpp:21:
/workspaces/ros2_humble_ws/build/rosidl_generator_cpp/rosidl_generator_cpp/rosidl_generator_cpp/msg/defaults.hpp:10:10: fatal error: rosidl_generator_cpp/msg/detail/defaults__type_support.hpp: No such file or directory
   10 | #include "rosidl_generator_cpp/msg/detail/defaults__type_support.hpp"

Required Info:

Steps to reproduce issue

Checkout humble branch, rosdep, colcon build

clalancette commented 2 months ago

Yeah, we merged in #778 , which also requires https://github.com/ros2/rosidl_typesupport/pull/149 .

christophfroehlich commented 2 months ago

Hm, it still fails with the same error today? (everything built from source: https://github.com/ros-controls/ros2_controllers/actions/runs/10519339357/job/29146541748#step:9:9906) Maybe a wrong branch in a repos file? Was there any involved repo branched for humble recently?

clalancette commented 2 months ago

All of the CI jobs are happy: https://build.ros2.org/view/Hci/

And it built locally just fine for me. Without looking at it closer, my best guess is that not everything is built from source in those GitHub actions.

christophfroehlich commented 2 months ago

Thanks for having a look, maybe this is just an issue with caching of build artifacts in the workflow.

christophfroehlich commented 2 months ago

I crawled through the logs, the correct branches are checked out:

2024-08-24T03:16:23.9787714Z === src/ros2/rosidl (git) ===
2024-08-24T03:16:23.9788657Z commit 6a18bbfa1fe80bc5474b19bbda50991f1ac9546b (HEAD -> humble, origin/humble)
2024-08-24T03:16:23.9790114Z Author: Stefan Fabian <fabian@sim.tu-darmstadt.de>
2024-08-24T03:16:23.9791056Z 
2024-08-24T03:16:23.9791439Z     Generate typesupport getter declarations for actions, messages and services. (#778)
2024-08-24T03:16:23.9801901Z     0.9.3
2024-08-24T03:16:23.9802289Z === src/ros2/rosidl_typesupport (git) ===
2024-08-24T03:16:23.9802961Z commit a702c179351b251403b2b188007535dac56fb33a (HEAD -> humble, origin/humble)
2024-08-24T03:16:23.9803654Z Author: Stefan Fabian <fabian@sim.tu-darmstadt.de>
2024-08-24T03:16:23.9804054Z 
2024-08-24T03:16:23.9804329Z     Added C interfaces to obtain service and action type support. (#149)

but I think there is an issue with rosdep. rosdep install -r --from-paths src/ros2/rosidl/rosidl_adapter src/ros2/rosidl/rosidl_cli src/ros2/rosidl/rosidl_cmake src/ros2/rosidl/rosidl_generator_c src/ros2/rosidl/rosidl_generator_cpp src/ros2/rosidl/rosidl_parser src/ros2/rosidl/rosidl_runtime_c src/ros2/rosidl/rosidl_runtime_cpp src/ros2/rosidl/rosidl_typesupport_interface src/ros2/rosidl/rosidl_typesupport_introspection_c src/ros2/rosidl/rosidl_typesupport_introspection_cpp src/ros2/rosidl_defaults/rosidl_default_generators src/ros2/rosidl_defaults/rosidl_default_runtime src/ros2/rosidl_python/rosidl_generator_py src/ros2/rosidl_typesupport/rosidl_typesupport_c src/ros2/rosidl_typesupport/rosidl_typesupport_cpp src/ros2/rosidl_typesupport_fastrtps/fastrtps_cmake_module src/ros2/rosidl_typesupport_fastrtps/rosidl_typesupport_fastrtps_c src/ros2/rosidl_typesupport_fastrtps/rosidl_typesupport_fastrtps_cpp --ignore-src --skip-keys 'rti-connext-dds-5.3.1 rti-connext-dds-6.0.1 ' --rosdistro humble -y

installs ros-humble-rosidl-typesupport-cpp and others, and colcon does not build it despite being in the source folder?

May it be that there is a dependency missing in the manifest? Checking out rosidl_typesupport and rosidl in my humble docker and running colcon build --packages-up-to rosidl_generator_cpp does not build rosidl_typesupport_cpp. Building it manually colcon build --packages-up-to $(colcon list --paths --names-only | grep rosidl) does not change anything, maybe the overlay of installed binaries does not work here?

It will solve itself with the next humble sync, but strange that the source build does not work here. https://build.ros2.org/job/Hbin_uJ64__rosidl_generator_cpp__ubuntu_jammy_amd64__binary/ was not built with the latest commit, but https://ci.ros2.org/job/ci_linux/21675/consoleText seemed to be ok, I don't know why I can't compile it with the same commits.

sloretz commented 2 months ago

https://github.com/ros-controls/ros2_controllers/actions/runs/10713321493/job/29705162169#step:9:9696

  In file included from /home/runner/work/ros2_controllers/ros2_controllers/ros_ws/src/ros2/rosidl/rosidl_generator_cpp/test/test_srv_initialization.cpp:17:
  /home/runner/work/ros2_controllers/ros2_controllers/ros_ws/build/rosidl_generator_cpp/rosidl_generator_cpp/rosidl_generator_cpp/srv/basic_types.hpp:10:10: fatal error: rosidl_generator_cpp/srv/detail/basic_types__type_support.hpp: No such file or directory
     10 | #include "rosidl_generator_cpp/srv/detail/basic_types__type_support.hpp"
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  gmake[2]: *** [CMakeFiles/test_srv_initialization.dir/build.make:76: CMakeFiles/test_srv_initialization.dir/test/test_srv_initialization.cpp.o] Error 1
  gmake[1]: *** [CMakeFiles/Makefile2:363: CMakeFiles/test_srv_initialization.dir/all] Error 2
  gmake: *** [Makefile:146: all] Error 2
  ---
  --- stderr: rosidl_generator_cpp
  In file included from /home/runner/work/ros2_controllers/ros2_controllers/ros_ws/src/ros2/rosidl/rosidl_generator_cpp/test/test_srv_initialization.cpp:17:
  /home/runner/work/ros2_controllers/ros2_controllers/ros_ws/build/rosidl_generator_cpp/rosidl_generator_cpp/rosidl_generator_cpp/srv/basic_types.hpp:10:10: fatal error: rosidl_generator_cpp/srv/detail/basic_types__type_support.hpp: No such file or directory
     10 | #include "rosidl_generator_cpp/srv/detail/basic_types__type_support.hpp"
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  gmake[2]: *** [CMakeFiles/test_srv_initialization.dir/build.make:76: CMakeFiles/test_srv_initialization.dir/test/test_srv_initialization.cpp.o] Error 1
  gmake[1]: *** [CMakeFiles/Makefile2:363: CMakeFiles/test_srv_initialization.dir/all] Error 2
  gmake: *** [Makefile:146: all] Error 2
  ---
  Failed   <<< rosidl_generator_cpp [13.7s, exited with code 2]

The tests that are failing to build were later moved to another package: https://github.com/ros2/rosidl/pull/701 , which might offer a clue as to why the action in ros-controls/ros2_controllers is failing.

Since the messages are generated in the same package, it seems strange to me that the test targets are not using rosidl_get_typesupport_target to depend on the in-package generated messages. If that was the problem though, I'd expect that to be failing in all builds.

Juliaj commented 1 month ago

Hit the same build errors when following tutorial "ros2_tracing to trace and analyze an application" on humble. Is there a workaround ?

Ali-AliAli-Ali commented 1 month ago

Faced the same errors when trying to build ROS2 Humble on Ubuntu 22.04 via the guide. Any guesses how to fix this, please?

MikeWrock commented 4 weeks ago

The source build seems broken but if you cherry pick the changes in the rosidl package that broke the build you can still get it to work:

cd ros2/rosidl
git cherry-pick 654d6f5658b59009147b9fad9b724919633f38fe