Skip to content

Missing Dependency in Stomp Test Build #3436

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

Closed
Bckempa opened this issue Apr 14, 2025 · 1 comment · Fixed by #3437
Closed

Missing Dependency in Stomp Test Build #3436

Bckempa opened this issue Apr 14, 2025 · 1 comment · Fixed by #3437
Labels
bug Something isn't working

Comments

@Bckempa
Copy link
Contributor

Bckempa commented Apr 14, 2025

Description

The tests in moveit_planners/stomp/test/CMakeLists.txt do not declare their dependency on the stomp library, causing test compilation to fail when the headerfile stomp/task.h cannot be found because the include flag resolved by find_package(stomp REQUIRED) in the parent Cmake file moveit_planners/stomp/CMakeLists.txt is not passed to the test build.

I'm not 100% sure if the issue is the test declaration or if the library they are testing is missing an export, but I was able to fix the build error by adding stomp to the ament_target_dependencies in moveit_planners/stomp/test/CMakeLists.txt for both tests. However, I'm not sure that is the "correct" solution given how the rest of the project uses ament and cmake target functions.

This is causing the Space ROS CI to fail on Jazzy branches: https://github.com/space-ros/docker/actions/runs/14414449283/job/40428744328?pr=225

ROS Distro

Jazzy

OS and version

Ubuntu 24.04

Source or binary build?

Source

If binary, which release version?

No response

If source, which branch?

jazzy

Which RMW are you using?

CycloneDDS

Steps to Reproduce

Attempt to build Moveit2 from source under a Jazzy-based Space ROS, such as this Dockerfile.

Expected behavior

Successful build of moveit

Actual behavior

Compilation of moveit dependent package moveit_planners_stomp terminates with fatal error: stomp/task.h: No such file or directory when building either test_noise_generator, or test_cost_functions tests.

Backtrace or Console output

#26 2646.2 In file included from /home/spaceros-user/moveit2/src/moveit_planners/stomp/include/stomp_moveit/noise_generators.hpp:42,
#26 2646.2                  from /home/spaceros-user/moveit2/src/moveit_planners/stomp/test/test_noise_generator.cpp:40:
#26 2646.2 /home/spaceros-user/moveit2/src/moveit_planners/stomp/include/stomp_moveit/stomp_moveit_task.hpp:57:10: fatal error: stomp/task.h: No such file or directory
#26 2646.2    57 | #include <stomp/task.h>
#26 2646.2       |          ^~~~~~~~~~~~~~
#26 2646.2 compilation terminated.
#26 2646.2 gmake[2]: *** [test/CMakeFiles/test_noise_generator.dir/build.make:76: test/CMakeFiles/test_noise_generator.dir/test_noise_generator.cpp.o] Error 1
#26 2646.2 gmake[1]: *** [CMakeFiles/Makefile2:229: test/CMakeFiles/test_noise_generator.dir/all] Error 2
#26 2646.2 gmake: *** [Makefile:146: all] Error 2
@sjahr
Copy link
Contributor

sjahr commented Apr 14, 2025

Good catch 👍 Looks like the tests are not linking against stomp even though it is included through
->

#include <stomp_moveit/noise_generators.hpp>
->

Do you mind opening a PR with you fix? I wouldn't use ament_target_dependencies but rather target_link_libraries like the main library (see https://github.com/moveit/moveit2/blob/64e934ff48d5aeb31a72f0c946d5d8719b4d817d/moveit_planners/stomp/CMakeLists.txt#L27C1-L27C22)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants