-
Notifications
You must be signed in to change notification settings - Fork 248
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
Wrong include directories order #698
Comments
I think that this is the right fix - most of the time this type of problem happens because target aren't declaring their dependencies explicitly, so if there is a system-installed version it gets picked up by accident. PRs welcome |
Note: we probably want a regular build that tries to build from source, when the binary package is already installed. We have no way to catch these problems in the current setup |
This is a symptom of ros2/ros2#1150, right? |
|
Description
I've tried to build #687 to check if it works in our environment, but it seems it wont build clean if ros-foxy-rosbag2... packages are installed on the target machine.
I've checked it while building on host machine and reproduced in
ros:foxy
docker container. In both casescolcon build
finishes with an error:ERROR
For some reason
/opt/ros/foxy/include/rosbag2_cpp/writer_interfaces/base_writer_interface.hpp
header was selected instead ofsrc/rosbag2_cpp/include/
, so I've build it with exported compile commands and found thattest_record_regex
is compiled like:Note than
-isystem /ws/install/rosbag2_cpp_future/include
goes AFTER-isystem /opt/ros/foxy/include
While for
test_record
everything seems ok:Well, not truly ok, cuz
-isystem /opt/ros/foxy/include
still goes before other includes from workspace. But it compiles at least.It seems that adding
rosbag2_cpp_future
toAMENT_DEPS
fortest_record_regex
moves-isystem /ws/install/rosbag2_cpp_future/include
to position before-isystem /opt/ros/foxy/include
but I am not sure it is right fix, cuz I dont know how doesament_target_dependencies
work and how does it handle transitive dependencies. It might be a problem in ament cmake scriptsObserved behavior is not only for
rosbag2_transport_future
package. It seems that all compile commands for all packages should be reviewed, cuz this behavior might lead to very confusing bugsExpected Behavior
Everything compiles successfully and include directories order is right
Actual Behavior
Error while compiling rosbag2 packages
To Reproduce
cat build/rosbag2_transport_future/compile_commands.json
System (please complete the following information)
The text was updated successfully, but these errors were encountered: