Skip to content

Fix headers destination installed by ament_auto_package#540

Merged
sloretz merged 2 commits intoament:rollingfrom
HansRobo:patch-1
Apr 7, 2025
Merged

Fix headers destination installed by ament_auto_package#540
sloretz merged 2 commits intoament:rollingfrom
HansRobo:patch-1

Conversation

@HansRobo
Copy link
Copy Markdown
Contributor

@HansRobo HansRobo commented Jul 4, 2024

To fix ros2/ros2#1150, many packages that are resigtered in rosdistro, are fixed like ament/ament_index#83.

This repository was not fixed at the time because it was not directly involved in installing header files.
However, all packages provided by this repository that use ament_auto_package to install header files have the issue reported in ros2/ros2#1150, which this PR will fix.

@HansRobo HansRobo requested a review from clalancette as a code owner July 4, 2024 08:10
@HansRobo
Copy link
Copy Markdown
Contributor Author

HansRobo commented Jul 4, 2024

This PR needs to be backported to Humble, Iron and Jazzy.

@HansRobo
Copy link
Copy Markdown
Contributor Author

HansRobo commented Jul 5, 2024

I make this to draft because I found some fixes are needed.
See autowarefoundation#2 (comment)

@HansRobo HansRobo marked this pull request as draft July 5, 2024 07:14
@HansRobo
Copy link
Copy Markdown
Contributor Author

HansRobo commented Apr 6, 2025

OK, I finished test these changes on my repository.
https://github.com/HansRobo/ros2_sandbox/actions/runs/14287948020
HansRobo/ros2_sandbox#1

with rolling branch of ament_cmake

The header files are installed to install/include/<package name>/<header name>.hpp with merge install.
These should be installed on install/include/<package name>/ <package name> /<header name>.hpp.

https://github.com/HansRobo/ros2_sandbox/actions/runs/14287948020/job/40045385546#step:10:13

tree ./install
./install
├── COLCON_IGNORE
├── _local_setup_util_ps1.py
├── _local_setup_util_sh.py
├── include
│   ├── parent_package
│   │   └── test_node.hpp
│   └── timer_experiments
│       └── timer_statistics.hpp
...

with this pull-request

The header files are installed to install/include/<package name>/<package name>/<header name>.hpp with merge install.
These are correct install location.

https://github.com/HansRobo/ros2_sandbox/actions/runs/14287948020/job/40045385606#step:10:14

tree ./install
./install
├── COLCON_IGNORE
├── _local_setup_util_ps1.py
├── _local_setup_util_sh.py
├── include
│   ├── parent_package
│   │   └── parent_package
│   │       └── test_node.hpp
│   └── timer_experiments
│       └── timer_experiments
│           └── timer_statistics.hpp
...

without fixing ament_export_include_directories

a fix argument of ament_export_include_directories in ament_auto_package is added in 9adf093.
Without this, dependencies are not handled correctly.

It causes build failure on my test without the commit.
https://github.com/HansRobo/ros2_sandbox/actions/runs/14287948020/job/40045385678#step:9:59

Starting >>> child_package
--- stderr: child_package
/__w/ros2_sandbox/ros2_sandbox/ament_auto_install_test/child_package/src/child_package_node.cpp:3:10: fatal error: parent_package/test_node.hpp: No such file or directory
    3 | #include <parent_package/test_node.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

@HansRobo HansRobo marked this pull request as ready for review April 6, 2025 02:21
@HansRobo
Copy link
Copy Markdown
Contributor Author

HansRobo commented Apr 6, 2025

@clalancette
I finished working on this pull-request.
Could you review or assign appropriate reviewers?

Copy link
Copy Markdown
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!

@sloretz
Copy link
Copy Markdown
Contributor

sloretz commented Apr 7, 2025

@Mergifyio rebase

HansRobo added 2 commits April 7, 2025 16:02
Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>
Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>
@mergify
Copy link
Copy Markdown

mergify bot commented Apr 7, 2025

rebase

✅ Branch has been successfully rebased

@sloretz
Copy link
Copy Markdown
Contributor

sloretz commented Apr 7, 2025

Pulls: #540
Gist: https://gist.githubusercontent.com/sloretz/716fdf61cd5904d3f8821427e2c29ece/raw/27bf1cde67e8bd9d872ee6fb71a73d53f2a41f7e/ros2.repos
BUILD args: --packages-above-and-dependencies ament_cmake_auto
TEST args: --packages-above ament_cmake_auto
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/15619

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@sloretz sloretz merged commit ed4a0a5 into ament:rolling Apr 7, 2025
3 checks passed
@HansRobo
Copy link
Copy Markdown
Contributor Author

HansRobo commented Apr 7, 2025

Thank you for reviewing!

HansRobo added a commit to HansRobo/ament_cmake that referenced this pull request Apr 7, 2025
* fix headers destination installed by ament_auto_package 

Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>

* Fix exporting include directory target by ament_auto_package

Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>

---------

Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>
HansRobo added a commit to HansRobo/ament_cmake that referenced this pull request Apr 7, 2025
* fix headers destination installed by ament_auto_package 

Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>

* Fix exporting include directory target by ament_auto_package

Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>

---------

Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>
HansRobo added a commit to HansRobo/ament_cmake that referenced this pull request Apr 7, 2025
* fix headers destination installed by ament_auto_package 

Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>

* Fix exporting include directory target by ament_auto_package

Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>

---------

Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>
@HansRobo
Copy link
Copy Markdown
Contributor Author

HansRobo commented Apr 7, 2025

@sloretz
I also submitted the backport pull-requests to humble, iron, and jazzy.
Could you review them?

@HansRobo HansRobo deleted the patch-1 branch April 18, 2025 13:50
sloretz pushed a commit that referenced this pull request Apr 22, 2025
…ort #540) (#578)

* Add USE_SCOPED_HEADER_INSTALL_DIR option to ament_auto_package

Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>

* Add warning message to ament_auto_package related to USE_SCOPED_HEADER_INSTALL_DIR option

Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>

* Add missing endif to ament_auto_package

Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>

* Use no mode instead of WARNING in message in ament_auto_package.cmake

Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>

---------

Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overlaying packages using CMake export targets can fail with merge install underlay

2 participants