ros2 / rosbag2_bag_v2

rosbag2 plugin for replaying ros1 version2 bag files
Apache License 2.0
24 stars 4 forks source link

CMake warnings about cycle with release archive underlay #29

Open jacobperron opened 4 years ago

jacobperron commented 4 years ago

I'm trying to compile rosbag2_bag_v2 in an overlay on a release archive and getting cmake warnings about cycles.

I'm on Ubuntu 18.04 with a ROS Eloquent installation. I can also reproduce with a pre-Foxy nightly archive.

To reproduce,

  1. Download and extract a release archive (e.g. Eloquent)

  2. Source Melodic installation

    source /opt/ros/melodic/setup.bash
  3. Source Eloquent installation

    source ros2-eloquent/setup.bash
  4. Checkout this repository and try to build

    mkdir -p rosbag2_bag_v2_ws/src && cd rosbag2_bag_v2_ws/src
    git clone https://github.com/ros2/rosbag2_bag_v2.git -b eloquent
    cd ..
    colcon build

Example output:

Starting >>> ros1_rosbag_storage_vendor
Finished <<< ros1_rosbag_storage_vendor [29.9s]                         
Starting >>> rosbag2_bag_v2_plugins
[Processing: rosbag2_bag_v2_plugins]                                 
--- stderr: rosbag2_bag_v2_plugins                                       
CMake Warning at /home/jacob/ws/ros/ros2-eloquent/share/actionlib_msgs/cmake/actionlib_msgsConfig.cmake:29 (message):
  Package 'actionlib_msgs' is deprecated (This package will be removed in a
  future ROS distro, once the ROS 1 bridge supports actions.)
Call Stack (most recent call first):
  CMakeLists.txt:72 (find_package)

CMake Warning at /home/jacob/ws/ros/ros2-eloquent/share/ament_cmake_gmock/cmake/ament_add_gmock.cmake:69 (add_executable):
  Cannot generate a safe runtime search path for target
  test_rosbag_v2_storage because there is a cycle in the constraint graph:

    dir 0 is [/home/jacob/ws/ros/rosbag2_bag_v2/build/rosbag2_bag_v2_plugins]
    dir 1 is [/home/jacob/ws/ros/ros2-eloquent/lib]
      dir 4 must precede it due to runtime library [libclass_loader.so]
    dir 2 is [/home/jacob/ws/ros/rosbag2_bag_v2/install/ros1_rosbag_storage_vendor/lib]
    dir 3 is [/home/jacob/ws/ros/ros2-eloquent/opt/yaml_cpp_vendor/lib]
    dir 4 is [/opt/ros/melodic/lib]
      dir 1 must precede it due to runtime library [libclass_loader.so]

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  /home/jacob/ws/ros/ros2-eloquent/share/ament_cmake_gmock/cmake/ament_add_gmock.cmake:52 (_ament_add_gmock)
  CMakeLists.txt:137 (ament_add_gmock)

CMake Warning at /home/jacob/ws/ros/ros2-eloquent/share/ament_cmake_gmock/cmake/ament_add_gmock.cmake:69 (add_executable):
  Cannot generate a safe runtime search path for target
  test_rosbag_output_stream because there is a cycle in the constraint graph:

    dir 0 is [/home/jacob/ws/ros/rosbag2_bag_v2/build/rosbag2_bag_v2_plugins]
    dir 1 is [/home/jacob/ws/ros/ros2-eloquent/lib]
      dir 4 must precede it due to runtime library [libclass_loader.so]
    dir 2 is [/home/jacob/ws/ros/rosbag2_bag_v2/install/ros1_rosbag_storage_vendor/lib]
    dir 3 is [/home/jacob/ws/ros/ros2-eloquent/opt/yaml_cpp_vendor/lib]
    dir 4 is [/opt/ros/melodic/lib]
      dir 1 must precede it due to runtime library [libclass_loader.so]

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  /home/jacob/ws/ros/ros2-eloquent/share/ament_cmake_gmock/cmake/ament_add_gmock.cmake:52 (_ament_add_gmock)
  CMakeLists.txt:149 (ament_add_gmock)

CMake Warning at CMakeLists.txt:76 (add_library):
  Cannot generate a safe runtime search path for target
  rosbag2_bag_v2_plugins because there is a cycle in the constraint graph:

    dir 0 is [/home/jacob/ws/ros/rosbag2_bag_v2/install/ros1_rosbag_storage_vendor/lib]
    dir 1 is [/home/jacob/ws/ros/ros2-eloquent/lib]
      dir 3 must precede it due to runtime library [libclass_loader.so]
    dir 2 is [/home/jacob/ws/ros/ros2-eloquent/opt/yaml_cpp_vendor/lib]
    dir 3 is [/opt/ros/melodic/lib]
      dir 1 must precede it due to runtime library [libclass_loader.so]

  Some of these libraries may not be found correctly.

---
Finished <<< rosbag2_bag_v2_plugins [52.0s]

Summary: 2 packages finished [1min 23s]
  1 package had stderr output: rosbag2_bag_v2_plugins
jacobperron commented 4 years ago

@Karsten1987 Do you know if this use-case was ever tried?

Karsten1987 commented 4 years ago

can you try inverting the source order? basically swap step 2 and 3

The problem did arise in the past, and I remember there isn't really much we can do about it except taking care what is being sourced and in which order

jacobperron commented 4 years ago

This is the documented order in the readme, and reversing the order fails compilation at ros1_rosbag_storage_vendor.

Edit: I lied, it fails at rosbag2_bag_v2_plugins:

Starting >>> rosbag2_bag_v2_plugins
--- stderr: rosbag2_bag_v2_plugins                           
CMake Error at CMakeLists.txt:115 (pluginlib_export_plugin_description_file):
  Unknown CMake command "pluginlib_export_plugin_description_file".

---
Failed   <<< rosbag2_bag_v2_plugins [ Exited with code 1 ]
Mavahu commented 4 years ago

I am also running into almost the same issue. I'm running ros melodic and eloquent. When trying to build the rosbag2_bag_v2 package i get the following error output: `Starting >>> rosbag2_bag_v2_plugins --- stderr: rosbag2_bag_v2_plugins
CMake Warning at /opt/ros/eloquent/share/actionlib_msgs/cmake/actionlib_msgsConfig.cmake:29 (message): Package 'actionlib_msgs' is deprecated (This package will be removed in a future ROS distro, once the ROS 1 bridge supports actions.) Call Stack (most recent call first): CMakeLists.txt:72 (find_package)

CMake Warning at /opt/ros/eloquent/share/ament_cmake_gmock/cmake/ament_add_gmock.cmake:69 (add_executable): Cannot generate a safe runtime search path for target test_rosbag_v2_storage because files in some directories may conflict with libraries in implicit directories:

runtime library [liburdfdom_sensor.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /opt/ros/eloquent/lib
runtime library [liburdfdom_model_state.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /opt/ros/eloquent/lib
runtime library [liburdfdom_model.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /opt/ros/eloquent/lib
runtime library [liburdfdom_world.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /opt/ros/eloquent/lib
runtime library [libconsole_bridge.so.0.4] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /opt/ros/eloquent/lib

Some of these libraries may not be found correctly. Call Stack (most recent call first): /opt/ros/eloquent/share/ament_cmake_gmock/cmake/ament_add_gmock.cmake:52 (_ament_add_gmock) CMakeLists.txt:137 (ament_add_gmock)

CMake Warning at /opt/ros/eloquent/share/ament_cmake_gmock/cmake/ament_add_gmock.cmake:69 (add_executable): Cannot generate a safe runtime search path for target test_rosbag_v2_storage because there is a cycle in the constraint graph:

dir 0 is [/home/mh/rosbag2_bag_v2_ws/build/rosbag2_bag_v2_plugins]
dir 1 is [/opt/ros/eloquent/lib]
  dir 0 must precede it due to runtime library [librosbag2_bag_v2_plugins.so]
  dir 2 must precede it due to runtime library [libros1_rosbag_storage.so]
  dir 4 must precede it due to runtime library [libimage_transport.so]
dir 2 is [/home/mh/rosbag2_bag_v2_ws/install/ros1_rosbag_storage_vendor/lib]
dir 3 is [/opt/ros/eloquent/opt/yaml_cpp_vendor/lib]
dir 4 is [/opt/ros/melodic/lib]
  dir 1 must precede it due to runtime library [libclass_loader.so]

Some of these libraries may not be found correctly. Call Stack (most recent call first): /opt/ros/eloquent/share/ament_cmake_gmock/cmake/ament_add_gmock.cmake:52 (_ament_add_gmock) CMakeLists.txt:137 (ament_add_gmock)

CMake Warning at /opt/ros/eloquent/share/ament_cmake_gmock/cmake/ament_add_gmock.cmake:69 (add_executable): Cannot generate a safe runtime search path for target test_rosbag_output_stream because files in some directories may conflict with libraries in implicit directories:

runtime library [liburdfdom_sensor.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /opt/ros/eloquent/lib
runtime library [liburdfdom_model_state.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /opt/ros/eloquent/lib
runtime library [liburdfdom_model.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /opt/ros/eloquent/lib
runtime library [liburdfdom_world.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /opt/ros/eloquent/lib
runtime library [libconsole_bridge.so.0.4] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /opt/ros/eloquent/lib

Some of these libraries may not be found correctly. Call Stack (most recent call first): /opt/ros/eloquent/share/ament_cmake_gmock/cmake/ament_add_gmock.cmake:52 (_ament_add_gmock) CMakeLists.txt:149 (ament_add_gmock)

CMake Warning at /opt/ros/eloquent/share/ament_cmake_gmock/cmake/ament_add_gmock.cmake:69 (add_executable): Cannot generate a safe runtime search path for target test_rosbag_output_stream because there is a cycle in the constraint graph:

dir 0 is [/home/mh/rosbag2_bag_v2_ws/build/rosbag2_bag_v2_plugins]
dir 1 is [/opt/ros/eloquent/lib]
  dir 0 must precede it due to runtime library [librosbag2_bag_v2_plugins.so]
  dir 2 must precede it due to runtime library [libros1_rosbag_storage.so]
  dir 4 must precede it due to runtime library [libimage_transport.so]
dir 2 is [/home/mh/rosbag2_bag_v2_ws/install/ros1_rosbag_storage_vendor/lib]
dir 3 is [/opt/ros/eloquent/opt/yaml_cpp_vendor/lib]
dir 4 is [/opt/ros/melodic/lib]
  dir 1 must precede it due to runtime library [libclass_loader.so]

Some of these libraries may not be found correctly. Call Stack (most recent call first): /opt/ros/eloquent/share/ament_cmake_gmock/cmake/ament_add_gmock.cmake:52 (_ament_add_gmock) CMakeLists.txt:149 (ament_add_gmock)

CMake Warning at CMakeLists.txt:76 (add_library): Cannot generate a safe runtime search path for target rosbag2_bag_v2_plugins because files in some directories may conflict with libraries in implicit directories:

runtime library [liburdfdom_sensor.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /opt/ros/eloquent/lib
runtime library [liburdfdom_model_state.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /opt/ros/eloquent/lib
runtime library [liburdfdom_model.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /opt/ros/eloquent/lib
runtime library [liburdfdom_world.so.1.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /opt/ros/eloquent/lib
runtime library [libconsole_bridge.so.0.4] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /opt/ros/eloquent/lib

Some of these libraries may not be found correctly.

CMake Warning at CMakeLists.txt:76 (add_library): Cannot generate a safe runtime search path for target rosbag2_bag_v2_plugins because there is a cycle in the constraint graph:

dir 0 is [/home/mh/rosbag2_bag_v2_ws/install/ros1_rosbag_storage_vendor/lib]
dir 1 is [/opt/ros/eloquent/lib]
  dir 0 must precede it due to runtime library [libros1_rosbag_storage.so]
  dir 3 must precede it due to runtime library [libimage_transport.so]
dir 2 is [/opt/ros/eloquent/opt/yaml_cpp_vendor/lib]
dir 3 is [/opt/ros/melodic/lib]
  dir 1 must precede it due to runtime library [libclass_loader.so]

Some of these libraries may not be found correctly.

/opt/ros/melodic/lib/librviz.so: undefined reference to class_loader::MultiLibraryClassLoader::getAllAvailableClassLoaders()' /opt/ros/melodic/lib/librviz.so: undefined reference toclass_loader::impl::AbstractMetaObjectBase::isOwnedBy(class_loader::ClassLoader const*)' /opt/ros/melodic/lib/librviz.so: undefined reference to class_loader::MultiLibraryClassLoader::getRegisteredLibraries[abi:cxx11]()' /opt/ros/melodic/lib/librviz.so: undefined reference toclass_loader::ClassLoader::isLibraryLoaded()' collect2: error: ld returned 1 exit status make[2]: [test_rosbag_output_stream] Error 1 make[1]: [CMakeFiles/test_rosbag_output_stream.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... /opt/ros/melodic/lib/librviz.so: undefined reference to class_loader::MultiLibraryClassLoader::getAllAvailableClassLoaders()' /opt/ros/melodic/lib/librviz.so: undefined reference toclass_loader::impl::AbstractMetaObjectBase::isOwnedBy(class_loader::ClassLoader const)' /opt/ros/melodic/lib/librviz.so: undefined reference to class_loader::MultiLibraryClassLoader::getRegisteredLibraries[abi:cxx11]()' /opt/ros/melodic/lib/librviz.so: undefined reference toclass_loader::ClassLoader::isLibraryLoaded()' collect2: error: ld returned 1 exit status make[2]: ** [test_rosbag_v2_storage] Error 1 make[1]: [CMakeFiles/test_rosbag_v2_storage.dir/all] Error 2 make: *** [all] Error 2

Failed <<< rosbag2_bag_v2_plugins [10.2s, exited with code 2]

Summary: 1 package finished [10.9s] 1 package failed: rosbag2_bag_v2_plugins 1 package had stderr output: rosbag2_bag_v2_plugins `

@Karsten1987 any update on this issue?

KenYN commented 4 years ago

Same problem as @Mavahu but with foxy and noetic.

KenYN commented 4 years ago

@Mavahu I have fixed that problem - see #32