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

Update cmake minimum version range for build with cmake 4.0 #246

Closed
wants to merge 1 commit into from

Conversation

fundawang
Copy link

compatibility for cmake < 3.5 was removed in cmake 4.0. Adding version range to make it build with cmake 4.0

@heitbaum
Copy link

Confirmed that this fixes build with wsrep-lib using cmake-4.0.0 and allows MariaDB to build correctly. https://jira.mariadb.org/browse/MDEV-36422. MariaDB is using wsrep-lib as a submodule at https://github.com/MariaDB/server

Copy link
Contributor

@janlindstrom janlindstrom left a comment

Choose a reason for hiding this comment

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

Adding maximum supported version would cause a need fix supported range several times of a year. Minimum required may not be changed on GA-releases so is there some other better way to do this ?

@heitbaum
Copy link

heitbaum commented Mar 31, 2025

Adding maximum supported version would cause a need fix supported range several times of a year. Minimum required may not be changed on GA-releases so is there some other better way to do this ?

Background - 3.5 is from 2016 and 3.10 from 2018

the max is actually policy_max. Not max cmake version. It means the the policies / contents in the CmakeLists are conformant to that version of cmake. Which they seem to be on doing the compile.

cmake 4.0.0 warns that cmake 3.5 files will be deprecated. Whilst cmake 3.10 files do not warn.

setting to (VERSION 2.8...3.10) or (VERSION 2.8...3.5) will both allow cmake to compile wsrep-lib - which are probably reasonable and working settings.

Ref: https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html

@temeo
Copy link
Contributor

temeo commented Mar 31, 2025

Hi @heitbaum , thanks for the explanation. Seems that it should be safe to add 4.0 as policy_max.

What comes to minimum version, it is better to leave as it is for now. While cmake 2.8 is an ancient version, we cannot completely rule out that it would not be in use in some builder.

@fundawang Please add your name and email in CONTRIBUTORS.txt.

@heitbaum
Copy link

Hi @heitbaum , thanks for the explanation. Seems that it should be safe to add 4.0 as policy_max.

What comes to minimum version, it is better to leave as it is for now. While cmake 2.8 is an ancient version, we cannot completely rule out that it would not be in use in some builder.

@fundawang Please add your name and email in CONTRIBUTORS.txt.

👍

@temeo I haven’t been changing the min=2.8 in the patches that I have been doing - except when there has been need to rewrite some of the cmake code using later features - this was only in the 2.6 case. So I would agree - just keep with 2.8 in wsrep-lib.

@fundawang
Copy link
Author

fundawang commented Apr 1, 2025

cmake_minimum_required (VERSION 2.8...4.0)

Which means, at least cmake 2.8 is required, but the code also compiles without problems if building with policies defined by cmake 4.0.

cmake_minimum_required (VERSION 2.8)

Which means, at least cmake 2.8 and policies defined by cmake 2.8 are both required. cmake 4.0 disabled policies default values prior to 3.5, so building with cmake 4.0 failed.

@fundawang Please add your name and email in CONTRIBUTORS.txt.

Never mind, it is just a small patch.

@temeo
Copy link
Contributor

temeo commented Apr 3, 2025

Hi,

The corresponding change was pushed in 324b01e, I'll close this one.

Thanks!

@temeo temeo closed this Apr 3, 2025
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.

4 participants