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

Support new target export template introduced with CMake 3.24 #395

Merged
merged 1 commit into from
Aug 11, 2022

Conversation

roehling
Copy link
Contributor

@roehling roehling commented Aug 5, 2022

The latest CMake 3.24 has tweaked its export template, so the regular expression in ament_cmake_export_targets-extra.cmake no longer matches. This PR relaxes the regex to match both the old and the new template.

Signed-off-by: Timo Röhling <timo.roehling@fkie.fraunhofer.de>
@ooeygui
Copy link

ooeygui commented Aug 9, 2022

Thank you for submitting a fix! I've confirmed that this does build. I would love to see this pulled into humble as well.

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

Thanks for the change, this looks reasonable to me. I'm going to go ahead and run full CI on this.

@clalancette
Copy link
Contributor

CI:

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

@clalancette
Copy link
Contributor

The flaky test on Windows is well known, so going ahead and merging this (and backporting to stable distributions).

@clalancette clalancette merged commit ca8c26e into ament:rolling Aug 11, 2022
@clalancette
Copy link
Contributor

@Mergifyio backport humble galactic foxy

mergify bot pushed a commit that referenced this pull request Aug 11, 2022
Signed-off-by: Timo Röhling <timo.roehling@fkie.fraunhofer.de>
(cherry picked from commit ca8c26e)
mergify bot pushed a commit that referenced this pull request Aug 11, 2022
Signed-off-by: Timo Röhling <timo.roehling@fkie.fraunhofer.de>
(cherry picked from commit ca8c26e)
mergify bot pushed a commit that referenced this pull request Aug 11, 2022
Signed-off-by: Timo Röhling <timo.roehling@fkie.fraunhofer.de>
(cherry picked from commit ca8c26e)
@mergify
Copy link

mergify bot commented Aug 11, 2022

backport humble galactic foxy

✅ Backports have been created

@roehling roehling deleted the cmake-3.24-compat branch August 11, 2022 11:53
light-tech added a commit to light-tech/ROS2-On-iOS that referenced this pull request Aug 12, 2022
light-tech added a commit to light-tech/ROS2-On-iOS that referenced this pull request Aug 12, 2022
clalancette pushed a commit that referenced this pull request Aug 12, 2022
…397)

Signed-off-by: Timo Röhling <timo.roehling@fkie.fraunhofer.de>
(cherry picked from commit ca8c26e)

Co-authored-by: Timo Röhling <timo@gaussglocke.de>
clalancette pushed a commit that referenced this pull request Aug 12, 2022
…398)

Signed-off-by: Timo Röhling <timo.roehling@fkie.fraunhofer.de>
(cherry picked from commit ca8c26e)

Co-authored-by: Timo Röhling <timo@gaussglocke.de>
clalancette pushed a commit that referenced this pull request Aug 12, 2022
…399)

Signed-off-by: Timo Röhling <timo.roehling@fkie.fraunhofer.de>
(cherry picked from commit ca8c26e)

Co-authored-by: Timo Röhling <timo@gaussglocke.de>
@ijnek
Copy link
Contributor

ijnek commented Aug 20, 2022

May I request for a release in all distros please @clalancette ?

@ijnek
Copy link
Contributor

ijnek commented Oct 27, 2022

I can't quite understand the reason why using custom messages are failing on Foxy, Galactic and Humble even they aren't using CMake > 3.24, but there are many recent issues (Failed to find exported target names in) that this PR has probably fixed.

Humble:
moveit/moveit2#1611
moveit/moveit2#1570

Foxy:
dusty-nv/jetson-containers#181
https://answers.ros.org/question/406709/sudden-custom_msgs-related-error-in-ros2-build-failed-in-ci/
colcon/colcon-core#525

This started happening in one of my galactic CIs: https://github.com/ros-sports/soccer_interfaces/actions/runs/3333641352/jobs/5515776865 , and I can confirm that the changes in this PR does fix the failure (when i build ament_cmake from source in CI).

I have been trying to make a minimal reproducible example (https://github.com/ijnek/reproduce_ament_cmake_395) but I haven't been able to reproduce it yet, or reproduce the issue locally on my computer in a container.

Does anyone know what the changes were that broke the galactic builds?
@clalancette Could we get these changes released in all distros please?

@clalancette
Copy link
Contributor

@clalancette Could we get these changes released in all distros please?

I mean, we can, but we really should figure out why it is happening in all distributions. By default, it shouldn't happen anywhere but on Windows (which ends up rolling forwards all the time). I suspect somewhere in setup-ros or action-ci-ros is installing a custom version of CMake, and it shouldn't do that.

@ijnek
Copy link
Contributor

ijnek commented Oct 28, 2022

From the logs, the CMake version being installed does seem to be 3.16.3.

2022-10-27T00:47:57.1119909Z Setting up cmake (3.16.3-1ubuntu1) ...

I understand that this is something for me to figure out, but I'm sort of stuck on this one. So if anyone else out there is experiencing something similar, I'd like to know!

@quarkytale
Copy link

I was trying to build moveit2 on humble and it requires CMake >= 3.22. So I manually upgraded to 3.24, stumbling upon this issue of "Failed to find exported target names".

@ijnek
Copy link
Contributor

ijnek commented Nov 10, 2022

My issue was caused by Github's action runner manually installing CMake > 3.24, which I didn't notice due to cmake 3.16.3 also being installed side-by-side. I've written up an explanation on ROS Answers for this specific case and how to prevent being affected by such problems by using containers in Github Actions rather than running builds directly on the Github Action Runners.

@clalancette
Copy link
Contributor

My issue was caused by Github's action runner manually installing CMake > 3.24, which I didn't notice due to cmake 3.16.3 also being installed side-by-side. I've written up an explanation on ROS Answers for this specific case and how to prevent being affected by such problems by using containers in Github Actions rather than running builds directly on the Github Action Runners.

All right, thanks for tracking this down. The good news is that we'll be releasing this fix into Humble in the next patch release, soon-ish. Then we'll be able to handle CMake 3.24 on both Rolling and Humble.

@ijnek
Copy link
Contributor

ijnek commented Nov 10, 2022

Then we'll be able to handle CMake 3.24 on both Rolling and Humble.

Foxy too?

@clalancette
Copy link
Contributor

It doesn't look like we've backported it there, so no, not at the moment. Have we seen instances of the problem on Foxy?

@ijnek
Copy link
Contributor

ijnek commented Nov 10, 2022

I've been reproducing it on galactic, and foxy (although I haven't checked) would very likely have the same problem too.

It seems like you have backported it to galactic and foxy.

@clalancette
Copy link
Contributor

I've been reproducing it on galactic, and foxy (although I haven't checked) would very likely have the same problem too.

It seems like you have backported it to galactic and foxy.

Oh, I looked too quickly. In the case of Foxy, that was backported and released back in September, so it should not be a problem anymore there.

We backported and merged it to Galactic, but have not yet released it. Since this month will be the final patch release of Galactic, it should make it in there too.

@ijnek
Copy link
Contributor

ijnek commented Nov 10, 2022

Great, thanks @clalancette !

cottsay pushed a commit that referenced this pull request Dec 8, 2022
…398)

Signed-off-by: Timo Röhling <timo.roehling@fkie.fraunhofer.de>
(cherry picked from commit ca8c26e)

Co-authored-by: Timo Röhling <timo@gaussglocke.de>
hoffmann-stefan added a commit to schiller-de/ros2_dotnet that referenced this pull request Mar 5, 2023
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.

Ament exports won't work on cmake 3.24+ since they changed export file generator
5 participants