Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake warnings about cycle with release archive underlay #29

Open
jacobperron opened this issue May 6, 2020 · 6 comments
Open

CMake warnings about cycle with release archive underlay #29

jacobperron opened this issue May 6, 2020 · 6 comments
Labels
backlog bug Something isn't working

Comments

@jacobperron
Copy link
Member

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 jacobperron added the bug Something isn't working label May 6, 2020
@jacobperron
Copy link
Member Author

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

@Karsten1987
Copy link
Contributor

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
Copy link
Member Author

jacobperron commented May 6, 2020

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
Copy link

Mavahu commented Jul 28, 2020

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 to class_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 to class_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 to class_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 to class_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
Copy link

KenYN commented Aug 20, 2020

Same problem as @Mavahu but with foxy and noetic.

@KenYN
Copy link

KenYN commented Aug 21, 2020

@Mavahu I have fixed that problem - see #32

@jacobperron jacobperron removed their assignment May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants