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

[Build fails] rosapi: targets with same name #581

Closed
ShivamPR21 opened this issue Aug 8, 2021 · 3 comments · Fixed by #665
Closed

[Build fails] rosapi: targets with same name #581

ShivamPR21 opened this issue Aug 8, 2021 · 3 comments · Fixed by #665
Assignees
Labels
ros2 ros2

Comments

@ShivamPR21
Copy link

Hi! all,
I am facing some problems with the build of rosapi with colcon.

Command used

cd <rosbridge_suite_ws>
colcon build

Errors

--- stderr: rosapi
CMake Error at /home/shivam/ros2_galactic/install/ament_cmake_python/share/ament_cmake_python/cmake/ament_python_install_package.cmake:108 (add_custom_target):
  add_custom_target cannot create target "ament_cmake_python_symlink_rosapi"
  because another target with the same name already exists.  The existing
  target is a custom target created in source directory
  "/home/shivam/autoware/tmp/src/rosbridge_suite/rosapi".  See documentation
  for policy CMP0002 for more details.
Call Stack (most recent call first):
  /home/shivam/ros2_galactic/install/ament_cmake_python/share/ament_cmake_python/cmake/ament_python_install_package.cmake:39 (_ament_cmake_python_install_package)
  /home/shivam/ros2_galactic/install/rosidl_generator_py/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:124 (ament_python_install_package)
  /home/shivam/ros2_galactic/install/ament_cmake_core/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /home/shivam/ros2_galactic/install/rosidl_cmake/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:292 (ament_execute_extensions)
  CMakeLists.txt:15 (rosidl_generate_interfaces)


---
Failed   <<< rosapi [8.45s, exited with code 1]

I am not able to intercept/interpret this problem, I have checked, and there isn't any other previous install for such packages.

Specifications

  • ROS Version (echo $ROS_DISTRO): rolling/galactic
  • OS Version (grep DISTRIB_CODENAME /etc/lsb-release): Ubuntu 20.04
  • Rosbridge Version (roscat rosbridge_server package.xml | grep '<version>'): ros2
  • Twisted Version (python -c 'import twisted; print twisted.version'): 18.9.0
  • Installation type: Source (ROS & ROSbridge)
@ShivamPR21
Copy link
Author

ShivamPR21 commented Aug 8, 2021

This is the problem with all new CMake versions, and according to the docs it has to be taken care of because it's going to be removed soon.
Even setting CMP0002 policy to OLD doesn't seem to work.

cmake_policy(SET CMP0002 OLD)

Also tried setting ALLOW_DUPLICATE_CUSTOM_TARGETS

set_property(GLOBAL PROPERTY ALLOW_DUPLICATE_CUSTOM_TARGETS 1)

This also not working, I think these properties have to be set by the core packages.

@jtbandes
Copy link
Member

jtbandes commented Aug 18, 2021

I also noticed this problem in rolling when we tried to add it to CI, so we'll need to resolve it in order to do this: #598 #602 I don't know why it would fail in rolling but it works for galactic/foxy in CI and on my machine.

cc @nuclearsandwich

@jtbandes
Copy link
Member

jtbandes commented Aug 19, 2021

This issue is caused by ros2/rosidl_python#131 / ros2/rosidl_python#141.

@jtbandes jtbandes added the ros2 ros2 label Aug 19, 2021
@jtbandes jtbandes self-assigned this Sep 9, 2021
jtbandes added a commit that referenced this issue Oct 15, 2021
…; enable Rolling in CI (#665)

**Public API Changes**
The msg and srv interfaces under `rosapi` are moving to a new package `rosapi_msgs`. The ones from `rosbridge_library` were used only for testing and are moving to a new package `rosbridge_test_msgs`.


**Description**
Fixes #581. Closes #602.
Due to a [change](ros2/rosidl_python#131) in rosidl_python, the generated python packages containing msg classes were conflicting with the python package these libraries export (ros2/rosidl_python#141). The solution recommended in that thread was to split these definitions into separate packages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ros2 ros2
Projects
None yet
2 participants