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

Require CMake 3.12 due to introduction of FindPython3 #515

Merged
merged 1 commit into from Mar 3, 2024

Conversation

Ryanf55
Copy link
Contributor

@Ryanf55 Ryanf55 commented Feb 29, 2024

Purpose

Declare a minimum Python version of 3.12 because FindPython3 is only available in 3.12 or after. This gives better error messages if a user is using too old a version of CMake.

Before behavior

If you install CMake 3.5, before this PR, you get this error when trying to compile sensor_msgs with colcon.

  Could not find a package configuration file provided by "Python3" with any
  of the following names:

    Python3Config.cmake
    python3-config.cmake

  Add the installation prefix of "Python3" to CMAKE_PREFIX_PATH or set
  "Python3_DIR" to a directory containing one of the above files.  If
  "Python3" provides a separate development package or SDK, be sure it has
  been installed.

New behavior

CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  CMake 3.12 or higher is required.  You are running version 3.5.0

How to prevent things like this in the future?

The CMake maintainers recommend having CI compile at the cmake_minimum_required declared in a package.
Thus, all the message packages should be compiled with 3.5. This prevents accidentally adding new CMake features and forgetting to bump cmake_minimum_required.

As far as I can tell, the build farm is using the default CMake version of each Tier 1 platform. I think it would be a lot of customization to get this right. For now, manual tests like this one can catch it.

References

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
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.

This seems reasonable to me. FYI @Yadunund ; this doesn't change anything about Iron from a perspective of REP-2000, but there is some chance that it might catch someone off-guard.

@clalancette
Copy link
Contributor

CI:

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

@Ryanf55
Copy link
Contributor Author

Ryanf55 commented Feb 29, 2024

CI:

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

As expected, there were no build failures or CMake warnings introduced by this (on Linux). Applications would already be failing if they were using CMake pre-3.12.
image

@clalancette
Copy link
Contributor

As expected, there were no build failures or CMake warnings introduced by this (on Linux). Applications would already be failing if they were using CMake pre-3.12.

Yep, your logic makes sense. I was just double-checking with CI. With that, I'm going to go ahead and merge this one in, thanks for the fix.

@clalancette clalancette merged commit 47f8528 into ament:iron Mar 3, 2024
3 checks passed
@Ryanf55 Ryanf55 deleted the 513-minimum-cmake-python3-iron branch March 3, 2024 21:08
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.

None yet

2 participants