Building ROS2 master on Ubuntu 16 fails

Trying to build master of ROS2 on my ubuntu box as of this morning and I’m getting a following failure. Any idea what might be wrong and how to fix it?

+++ Building ‘rosidl_generator_py’
==> ‘. /home/breh/ros2_wsx/build/rosidl_generator_py/cmake__build.sh && /usr/bin/make cmake_check_build_system’ in ‘/home/breh/ros2_wsx/build/rosidl_generator_py’
==> ‘. /home/breh/ros2_wsx/build/rosidl_generator_py/cmake__build.sh && /usr/bin/make -j2 -l2’ in ‘/home/breh/ros2_wsx/build/rosidl_generator_py’
[ 2%] Generating Python code for ROS interfaces
[ 18%] Built target rosidl_generator_py__rosidl_generator_c
[ 20%] Built target rosidl_generator_py__cpp
[ 36%] Built target rosidl_generator_py__rosidl_typesupport_introspection_c
[ 52%] Built target rosidl_generator_py__rosidl_typesupport_introspection_cpp
[ 68%] Built target rosidl_generator_py__rosidl_typesupport_c
[ 68%] Built target rosidl_generator_py
[ 68%] Built target rosidl_generator_py__py
Scanning dependencies of target rosidl_generator_py__rosidl_typesupport_c__pyext
make[2]: *** No rule to make target ‘rosidl_generator_py/rosidl_generator_py/_rosidl_generator_py_s.ep.rosidl_typesupport_c.c’, needed by ‘CMakeFiles/rosidl_generator_py__rosidl_typesupport_c__pyext.dir/rosidl_generator_py/rosidl_generator_py/_rosidl_generator_py_s.ep.rosidl_typesupport_c.c.o’. Stop.
CMakeFiles/Makefile2:1134: recipe for target ‘CMakeFiles/rosidl_generator_py__rosidl_typesupport_c__pyext.dir/all’ failed
make[1]: *** [CMakeFiles/rosidl_generator_py__rosidl_typesupport_c__pyext.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
Scanning dependencies of target rosidl_generator_py__rosidl_typesupport_introspection_c__pyext
make[2]: *** No rule to make target ‘rosidl_generator_py/rosidl_generator_py/_rosidl_generator_py_s.ep.rosidl_typesupport_introspection_c.c’, needed by ‘CMakeFiles/rosidl_generator_py__rosidl_typesupport_introspection_c__pyext.dir/rosidl_generator_py/rosidl_generator_py/_rosidl_generator_py_s.ep.rosidl_typesupport_introspection_c.c.o’. Stop.
CMakeFiles/Makefile2:71: recipe for target ‘CMakeFiles/rosidl_generator_py__rosidl_typesupport_introspection_c__pyext.dir/all’ failed
make[1]: *** [CMakeFiles/rosidl_generator_py__rosidl_typesupport_introspection_c__pyext.dir/all] Error 2
Makefile:138: recipe for target ‘all’ failed
make: *** [all] Error 2

Hi,
I can’t reproduce your bug on my debian testing. How do you keep your workspace up to date? Switched to the master branches on all repositories and calling vcs pull src on a regular base? This can lead to problems if a repository was renamed or moved.

I’m attaching my repos list to this post.
Did you already try deleting the build an install folder and rebuilding ros2 afterwards?

My repos list:

repositories:
ament/ament_cmake:
type: git
url: https://github.com/ament/ament_cmake.git
version: master
ament/ament_cmake_ros:
type: git
url: https://github.com/ros2/ament_cmake_ros
version: master
ament/ament_index:
type: git
url: https://github.com/ament/ament_index.git
version: master
ament/ament_lint:
type: git
url: https://github.com/ament/ament_lint.git
version: master
ament/ament_package:
type: git
url: https://github.com/ament/ament_package.git
version: master
ament/ament_tools:
type: git
url: https://github.com/ament/ament_tools.git
version: master
ament/gmock_vendor:
type: git
url: https://github.com/ament/gmock_vendor.git
version: master
ament/gtest_vendor:
type: git
url: https://github.com/ament/gtest_vendor.git
version: master
ament/osrf_pycommon:
type: git
url: https://github.com/osrf/osrf_pycommon.git
version: master
ament/uncrustify:
type: git
url: https://github.com/ament/uncrustify.git
version: master
eProsima/Fast-CDR:
type: git
url: https://github.com/eProsima/Fast-CDR.git
version: master
eProsima/Fast-RTPS:
type: git
url: https://github.com/eProsima/Fast-RTPS.git
version: master
ros/class_loader:
type: git
url: https://github.com/ros/class_loader.git
version: ros2
ros/geometry2:
type: git
url: https://github.com/ros2/geometry2.git
version: ros2
ros/orocos_kinematics_dynamics:
type: git
url: https://github.com/ros2/orocos_kinematics_dynamics
version: ros2
ros/poco_vendor:
type: git
url: https://github.com/ros2/poco_vendor.git
version: master
ros2/c_utilities:
type: git
url: https://github.com/ros2/c_utilities
version: master
ros2/cli_tools:
type: git
url: https://github.com/ros2/cli_tools
version: master
ros2/common_interfaces:
type: git
url: https://github.com/ros2/common_interfaces.git
version: master
ros2/demos:
type: git
url: https://github.com/ros2/demos.git
version: master
ros2/example_interfaces:
type: git
url: https://github.com/ros2/example_interfaces
version: master
ros2/examples:
type: git
url: https://github.com/ros2/examples.git
version: master
ros2/launch:
type: git
url: https://github.com/ros2/launch.git
version: master
ros2/rcl:
type: git
url: https://github.com/ros2/rcl.git
version: master
ros2/rcl_interfaces:
type: git
url: https://github.com/ros2/rcl_interfaces.git
version: master
ros2/rclcpp:
type: git
url: https://github.com/ros2/rclcpp.git
version: master
ros2/rclpy:
type: git
url: https://github.com/ros2/rclpy.git
version: master
ros2/realtime_support:
type: git
url: https://github.com/ros2/realtime_support.git
version: master
ros2/rmw:
type: git
url: https://github.com/ros2/rmw.git
version: master
ros2/rmw_connext:
type: git
url: https://github.com/ros2/rmw_connext.git
version: master
ros2/rmw_fastrtps:
type: git
url: https://github.com/ros2/rmw_fastrtps.git
version: master
ros2/rmw_implementation:
type: git
url: https://github.com/ros2/rmw_implementation.git
version: master
ros2/rmw_opensplice:
type: git
url: https://github.com/ros2/rmw_opensplice.git
version: master
ros2/ros1_bridge:
type: git
url: https://github.com/ros2/ros1_bridge.git
version: master
ros2/rosidl:
type: git
url: https://github.com/ros2/rosidl.git
version: master
ros2/rosidl_dds:
type: git
url: https://github.com/ros2/rosidl_dds.git
version: master
ros2/rosidl_typesupport:
type: git
url: https://github.com/ros2/rosidl_typesupport.git
version: master
ros2/system_tests:
type: git
url: https://github.com/ros2/system_tests.git
version: master
ros2/tlsf:
type: git
url: https://github.com/ros2/tlsf.git
version: master
vendor/console_bridge:
type: git
url: https://github.com/ros/console_bridge.git
version: master

Well, I did a fresh checkout and got a list of repositories from here: https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos as recommended in this document: https://github.com/ros2/ros2/wiki/Maintaining-a-Source-Checkout

What is interesting, the list on the link above is different from the list you sent. Where did you get yours from?

Also tried your repo list, unfortunately the build fails for me with the same problem. Have you tried a fresh workspace build?

I tried a fresh build in a container yesterday evening and could not reproduce this issue.
Just to clarify, did you try to remove your build folder before recompiling ?
Do you have the exact same error after your fresh checkout ?
If you run vcs status --hide in your source directory, do you have any outstanding changes on this packages or its dependencies?

Hmm, really weird. It was a complete fresh checkout. Created a new directory, new src, imported the repositories and ran ament. When I do the same thing with beta1 (different workspace, but clean checkout as well), everything compiles fine. However master fails with the error above.

I’m using cmake version 3.5.1
python: Python 2.7.12
python3: Python 3.5.2

vcs status --hide shows nothing …

My repos.list is just taken with vcs export src > ros2.txt from a working setup. Perhaps recheck the dependencies. I might be that the depedencies have changed since you did your original setup.

Just to make sure: you did the following steps:

delete your old workspace,
create new one either with my repos.list or the one from the wiki,
build the workspace with the commands from the wiki?

Did you get any different error with my repos.list ?

I’m repeating again - it is a complete fresh checkout and repos are taken from https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos as recommended in this document: https://github.com/ros2/ros2/wiki/Maintaining-a-Source-Checkout

Is there any other document describing how to build master of ros2? Perhaps the list maintained in https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos is not correct?

Hmm that’s really weird.
I just did the exact same thing:

  1. create a new workspace: mkdir -p test_master_repos_ws/src && cd test_master_repos_ws
  2. wget https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos
  3. vcs import src < ros2.repos
  4. run ament: src/ament/ament_tools/scripts/ament.py build --build-tests -s
    and everything built fine

This repo files is the one used by the buildfarm and it looks like all jobs built fine last night (nightly [Jenkins]) so I doubt this is the problem.

The only thing I can see would be missing dependencies. Can you try to install all the packages listed in GitHub - ros2/ros2: The Robot Operating System, is a meta operating system for robots. ? there were a few changes since beta1.

Sorry I know you are repeating yourself, if installing all the dependencies don’t fix it, could you provide the list of commands you ran with the exact arguments rather than a description, that would make it easier to reproduce

Thanks!

Thanks for helping :). After going back and forth and trying all sorts of stuff, the problem turned out to be the shell I used - it was setup to ros2-beta1 workspace, i.e. it had AMENT_PREFIX_PATH, LD_LIBRARY_PATH and all sorts of other variables pointing to the previously built beta1 workspace.

The way to fix it was very simple - just opened a fresh shell without any ROS2 setup and the build from there works just fine.

Thanks again for all your assistance, I’m back in the game :slight_smile:

:slight_smile: glad you figured it out

Out of my own intellectual curiosity, I’d love to hear your approach to building and developing within containers. (In a new thread, or feel free to message me directly.)