ros-industrial / industrial_core

ROS-Industrial core communication packages (http://wiki.ros.org/industrial_core)
156 stars 181 forks source link

Tests fails with catkin build on ROS Kinetic #173

Closed VictorLamoine closed 7 years ago

VictorLamoine commented 7 years ago

Create a workspace:

mkdir -p catkin_workspace/src
cd catkin_workspace/src
git clone https://github.com/ros-industrial/industrial_core.git
cd ..

Run tests with catkin tools:

catkin run_tests --no-status --force-color

Errors:

make[3]: Leaving directory '/home/victor/catkin_workspace/build/simple_message'
[ 84%] Built target gtest_main
/home/victor/catkin_workspace/src/industrial_core/simple_message/src/robot_status.cpp:44:39: fatal error: industrial_msgs/RobotMode.h: No such file or directory

                                       ^
compilation terminated.
CMakeFiles/simple_message_float64.dir/build.make:518: recipe for target 'CMakeFiles/simple_message_float64.dir/src/robot_status.cpp.o' failed
make[3]: *** [CMakeFiles/simple_message_float64.dir/src/robot_status.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
/home/victor/catkin_workspace/src/industrial_core/simple_message/src/robot_status.cpp:44:39: fatal error: industrial_msgs/RobotMode.h: No such file or directory

                                       ^
compilation terminated.
CMakeFiles/simple_message.dir/build.make:518: recipe for target 'CMakeFiles/simple_message.dir/src/robot_status.cpp.o' failed
make[3]: Leaving directory '/home/victor/catkin_workspace/build/simple_message'
make[3]: *** [CMakeFiles/simple_message.dir/src/robot_status.cpp.o] Error 1
make[2]: *** [CMakeFiles/simple_message.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:1668: recipe for target 'CMakeFiles/simple_message.dir/all' failed
/home/victor/catkin_workspace/src/industrial_core/simple_message/src/robot_status.cpp:44:39: fatal error: industrial_msgs/RobotMode.h: No such file or directory

                                       ^
compilation terminated.
CMakeFiles/simple_message_bswap.dir/build.make:518: recipe for target 'CMakeFiles/simple_message_bswap.dir/src/robot_status.cpp.o' failed
make[3]: Leaving directory '/home/victor/catkin_workspace/build/simple_message'
make[3]: *** [CMakeFiles/simple_message_bswap.dir/src/robot_status.cpp.o] Error 1
make[2]: *** [CMakeFiles/simple_message_bswap.dir/all] Error 2
CMakeFiles/Makefile2:1924: recipe for target 'CMakeFiles/simple_message_bswap.dir/all' failed
make[3]: Leaving directory '/home/victor/catkin_workspace/build/simple_message'

See here for an example build: https://gitlab.com/InstitutMaupertuis/ros_additive_manufacturing/builds/10605384

VictorLamoine commented 7 years ago

Seems like it is just a build order problem. Message is being generated after trying to compile robot_status.cpp.

If I run catkin build and then run the tests it goes fine.

gavanderhoorn commented 7 years ago

In any case this should not happen.

Perhaps something changed in Kinetic, or catkin_tools. simple_message/CMakeLists.txt does declare the dependency on industrial_msgs.

VictorLamoine commented 7 years ago

I can't find what's wrong.

$ catkin --version
catkin_tools 0.4.3 (C) 2014-2017 Open Source Robotics Foundation
catkin_tools is released under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
---
Using Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
gcc version 6.2.0 20160901 (Ubuntu 6.2.0-3ubuntu11~16.04) 
gavanderhoorn commented 7 years ago

@VictorLamoine: I'm going to chalk this one up to catkin_tools doing weird things sometime and close the issue.

industrial_msgs_EXPORTED_TARGETS does actually contain all the necessary targets:

industrial_msgs_generate_messages_cpp;industrial_msgs_generate_messages_lisp;industrial_msgs_generate_messages_py;std_msgs_generate_messages_cpp;std_msgs_generate_messages_lisp;std_msgs_generate_messages_py;trajectory_msgs_generate_messages_cpp;trajectory_msgs_generate_messages_lisp;trajectory_msgs_generate_messages_py;std_msgs_generate_messages_cpp;std_msgs_generate_messages_lisp;std_msgs_generate_messages_py;geometry_msgs_generate_messages_cpp;geometry_msgs_generate_messages_lisp;geometry_msgs_generate_messages_py;std_msgs_generate_messages_cpp;std_msgs_generate_messages_lisp;std_msgs_generate_messages_py

I agree with you that using run_tests directly should result in catkin first building all pkgs in the correct order though.

It would seem this is a catkin_tools issue and not with this package.

VictorLamoine commented 7 years ago

I tested again and I cannot reproduce the issue so it's fine that you closed it.