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

Builds prioritizing binaries instead of source #447

Closed
jhdcs opened this issue Jun 23, 2020 · 3 comments
Closed

Builds prioritizing binaries instead of source #447

jhdcs opened this issue Jun 23, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@jhdcs
Copy link
Contributor

jhdcs commented Jun 23, 2020

Description

When attempting to build a rosbag2 project involving an issue I was working on, it seemed that Colcon preferred to use the ROS2 Binary installation rosbag2 files as a source rather than the source code in the project, violating how overlays/underlays are supposed to work. Specifically, rosbag2_cpp was using the unmodified header files from /opt/ros/foxy rather than the modified files in rosbag2_storage.

Expected Behavior

The modified source files of the project would be used to build rosbag2_cpp, providing the newly-added constant.

Actual Behavior

The build would use the files from /opt/ros/foxy, which lacked the constant and caused the following error:

rosbag2_cpp/writers/sequential_writer.cpp: In constructor ‘rosbag2_cpp::writers::SequentialWriter::SequentialWriter(std::unique_ptr<rosbag2_storage::StorageFactoryInterface>, std::shared_ptr<rosbag2_cpp::SerializationFormatConverterFactoryInterface>, std::unique_ptr<rosbag2_storage::MetadataIo>)’: /home/jhassold/rosbag_ws/src/rosbag2/rosbag2_cpp/src/rosbag2_cpp/writers/sequential_writer.cpp:65:63: error: ‘MAX_BAGFILE_DURATION_NO_SPLIT’ is not a member of ‘rosbag2_storage::storage_interfaces’; did you mean ‘MAX_BAGFILE_SIZE_NO_SPLIT’? 65 | std::chrono::seconds(rosbag2_storage::storage_interfaces::MAX_BAGFILE_DURATION_NO_SPLIT)), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | MAX_BAGFILE_SIZE_NO_SPLIT

To Reproduce

  1. Install and source the binary installation of Foxy
  2. In rosbag2_storage/storage_interfaces/base_io_interface.hpp, add a constant
  3. In rosbag2_storage/storage_interfaces/base_io_interface.cpp, make sure the constant is set to something. 0 is a lovely number.
  4. In rosbag2_cpp/writers/sequential_writer.cpp, create a dummy function that uses that constant.
  5. Try running colcon build. You should get an error that the constant you defined is not a member of rosbag2_storage::storage_interfaces

System (please complete the following information)

  • OS: Ubuntu Focal Fossa running on Docker
  • ROS 2 Distro: Foxy

Additional context

My workaround for the problem was to use apt remove ros-foxy-rosbag2-storage. The project built fine after that

@jhdcs jhdcs added the bug Something isn't working label Jun 23, 2020
@emersonknapp
Copy link
Collaborator

emersonknapp commented Jul 31, 2020

This ROS Answers post is relevant https://answers.ros.org/question/358314/colcon-build-include-path-from-overlay-workspace/

We currently suspect this may be an issue trickling down from rcutils, but it needs to be confirmed.

Note: if rosbag2_cpp is moved above rcutils in https://github.com/ros2/rosbag2/blob/master/rosbag2_transport/CMakeLists.txt#L53 then it works - undetermined why

@dirk-thomas
Copy link
Member

I can't reproduce the problem with the steps described in the original ticket.

This ROS Answers post is relevant https://answers.ros.org/question/358314/colcon-build-include-path-from-overlay-workspace/

This specific case is being resolved by #479 which just declares the necessary target dependencies.

@Karsten1987
Copy link
Collaborator

I am closing this as #479 addressed the issue. Please feel free to re-open this ticket in your case problem still persists.

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

No branches or pull requests

4 participants