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 mimimum required cmake version #3802

Merged

Conversation

peter-toft-greve
Copy link

Upgrade minimum cmake version to 3.15

Signed-off-by: Peter Toft peter.toft@dirac.com

@peter-toft-greve
Copy link
Author

@paul-elliott-arm this might also have your interest

@peter-toft-greve
Copy link
Author

peter-toft-greve commented Oct 20, 2020

https://travis-ci.org/github/ARMmbed/mbedtls/builds/737330091 is failing since the verifier is running 3.12
We can downgrade the PR towards 3.12 or upgrade the cmake on the verifier

@paul-elliott-arm paul-elliott-arm self-assigned this Oct 20, 2020
@paul-elliott-arm paul-elliott-arm added Community needs-ci Needs to pass CI tests needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review needs-work labels Oct 20, 2020
@paul-elliott-arm
Copy link
Member

This is going to require some discussion with the team - historically we have to support a wide range of older cmake versions, but as you point out, it looks as if this is coming to a head. Thankyou for bringing this to our attention, and I will definitely get back to you.

@peter-toft-greve
Copy link
Author

@paul-elliott-arm whether the upgrade ends on 3.15 or something else e.g. 3.12 (as you use) seems to be fine from my side, but seems that 2.x is getting retired "within soon".
However I have seen issues with 3.17.0-rcX

Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm left a comment

Choose a reason for hiding this comment

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

CMake 3.15 is far too recent for us to require it.

CMakeLists.txt Outdated
@@ -16,7 +16,7 @@
# will be removed as well as this note.
#

cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.15)
Copy link
Contributor

Choose a reason for hiding this comment

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

This breaks compatibility with RHEL/CentOS 7, which carries CMake 2.8.12.2. For basic functionality (configuring and building the library and the unit tests), we try to stick to tooling that is available in popular long-term support distributions.

Updating to cmake_minimum_required(VERSION 2.8.12.2) would be ok as far as I know, although I think we should make this change only in development, not in our long-time support branches.

Copy link
Author

Choose a reason for hiding this comment

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

@gilles-peskine-arm I suggest to contact the cmake developers https://gitlab.kitware.com/cmake/cmake about what makes most sense. But given that the cmake developers are good at providing new packages it might be good to go to 3.x soon.
And https://blog.kitware.com/cmake-2-8-12-2-available-for-download/ shows that it is 6,5 years old - and I guess within 6-12 months quite a few developers will use cmake 3.19 or later.
I fully understand the problem, and I just suggest that you make a good plan :)

Copy link
Contributor

@ronald-cron-arm ronald-cron-arm Oct 20, 2020

Choose a reason for hiding this comment

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

In #3801, I can see:

CMake Deprecation Warning at CMakeLists.txt:19 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

Thus minimum version of 2.8.12 seems to be a good fit for RHEL/CentOS 7 and cmake 3.19, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't want to constraint development tools too much. Support for CentOS as a development environment is a common request. How often CMake makes releases is irrelevant: what's relevant is how often CentOS and other distributions make releases. CMake is keeping support for 2.8.12 for the same reason we want to keep support for 2.8.12.

2.8.12 was included in some Linux distros' LTS branches and so is much more common than older 2.8 versions. That made it feel like a natural cutoff point, and I want to be conservative since this is the first time we're heading toward removing support for any policy's OLD behavior.

Copy link
Member

Choose a reason for hiding this comment

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

As regards LTS branches, the versions prior to 2.18.2 are not removed yet (I am presuming this error is not fatal yet), just deprecated, so it kinda depends on how long we see the LTS branches living for. At some point we would have to backport this as otherwise the LTS branches may stop working with newer CMake.

Copy link
Author

Choose a reason for hiding this comment

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

Thanx for the feedback @paul-elliott-arm @ronald-cron-arm and @gilles-peskine-arm - I have revised the PR to require 2.8.12 which I tested to be ok with cmake 3.19.0-rc1.

Just note that the mimimum cmake is not just a check of the used cmake version, it is also a load of rules - which have changed over time. Thus testing is golden....

Better?

Copy link
Contributor

@ronald-cron-arm ronald-cron-arm left a comment

Choose a reason for hiding this comment

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

I agree with the choice of the minimum required version. Otherwise, please squash the two commits and add a commit message explaining the rationale of the change. Add also a "Changes" change log explaining the change and its rationale.
Otherwise, you are missing the required "Signed-off-by: Peter Toft peter.toft@dirac.com" in commit message.

@peter-toft-greve
Copy link
Author

@ronald-cron-arm I have updated the PR with 2075a81

@gilles-peskine-arm
Copy link
Contributor

Please indicate your acceptance of the developer certificate of origin with a signoff line in the commit message (git commit --signoff). Otherwise we cannot accept your contribution.

Copy link
Contributor

@ronald-cron-arm ronald-cron-arm left a comment

Choose a reason for hiding this comment

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

Sorry to bother you again with details but that's for the sake of project history.
. Commit message: Please explain why 2.8.12: minimum version for cmake 3.19 compatibilty and also compatible with MbedTLS support of RHEL/CentOS 7 LTS I think.
. Typo in the commit message title: "mimumum"
. Add a "Changes" change log entry: see ChangeLog.d/00README.md and *.txt examples in ChangeLog.d.

@peter-toft-greve
Copy link
Author

@paul-elliott-arm @ronald-cron-arm Have a look again :)

Copy link
Contributor

@ronald-cron-arm ronald-cron-arm 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 changes. There are 2 typos in the commit message that you may want to fix: "Update minumum" and "This PR updates the mimumum" but I am approving the PR anyway.

@peter-toft-greve
Copy link
Author

@ronald-cron-arm lets get it right - check one more time (the commit message).
... adding coffee in my end

@peter-toft-greve
Copy link
Author

peter-toft-greve commented Oct 22, 2020

@ronald-cron-arm did I goof up? I see -> peter-toft-greve dismissed ronald-cron-arm’s stale review via 451a633 28 minutes ago.
If yes, sorry mate :)

@ronald-cron-arm
Copy link
Contributor

@ronald-cron-arm did I goof up? I see -> peter-toft-greve dismissed ronald-cron-arm’s stale review via 451a633 28 minutes ago.
If yes, sorry mate :)

No worries, you pushed a new version thus GitHub automatically dismissed my approval as there is something new that needs me having another look.

* As described in issue Mbed-TLS#3801 the upcoming cmake 3.19
  will not support cmake 2.6 any more
* This PR updates the mimimum required cmake version
  to 2.8.12, which will not give a warning with cmake 3.19
  but still compatible with MbedTLS support of RHEL/CentOS 7 LTS
* Adding ChangeLog.d/bugfix_PR3802.txt

Signed-off-by: Peter Toft <peter.toft@dirac.com>
@ronald-cron-arm ronald-cron-arm removed needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review labels Oct 22, 2020
@peter-toft-greve
Copy link
Author

I take it that friendly folks will take it from here :)

@paul-elliott-arm paul-elliott-arm added approved Design and code approved - may be waiting for CI or backports and removed needs-ci Needs to pass CI tests labels Oct 22, 2020
@gilles-peskine-arm
Copy link
Contributor

The failure of the pr-head job is a known intermittent DTLS failure which is unrelated to this PR.

@mahavirj
Copy link

@gilles-peskine-arm Is it possible to consider this fix for mbedtls-2.16 branch?

mahavirj added a commit to espressif/mbedtls that referenced this pull request Dec 17, 2020
Upcoming cmake 3.19 will not support cmake 2.6 any more, hence
the fix.

Please see Mbed-TLS#3802 for
more details.
mahavirj added a commit to espressif/mbedtls that referenced this pull request Jul 8, 2021
Upcoming cmake 3.19 will not support cmake 2.6 any more, hence
the fix.

Please see Mbed-TLS#3802 for
more details.
mahavirj added a commit to espressif/mbedtls that referenced this pull request Dec 20, 2021
Upcoming cmake 3.19 will not support cmake 2.6 any more, hence
the fix.

Please see Mbed-TLS#3802 for
more details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Design and code approved - may be waiting for CI or backports
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants