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

cmake 3.19 will be a problem for mbedtls #3801

Closed
peter-toft-greve opened this issue Oct 20, 2020 · 5 comments · Fixed by #3845
Closed

cmake 3.19 will be a problem for mbedtls #3801

peter-toft-greve opened this issue Oct 20, 2020 · 5 comments · Fixed by #3845
Labels

Comments

@peter-toft-greve
Copy link

cmake (https://cmake.org/download/) is about to release version 3.19
In https://github.com/ARMmbed/mbedtls/blob/development/CMakeLists.txt#L19 we have
cmake_minimum_required(VERSION 2.6)

That will soon be a problem - and with cmake 3.19 the user will get

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 <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

I suggest to update e.g. to cmake_minimum_required(VERSION 3.15)
since 3.14 has "issues" and later releases are available in general.

@peter-toft-greve
Copy link
Author

I have suggested #3802

peter-toft-greve added a commit to peter-toft-greve/mbedtls that referenced this issue Oct 21, 2020
* As described in issue Mbed-TLS#3801 the upcoming cmake 3.19
  will not support cmake 2.6 any more.
* This PR updates the mimumum required cmake version
  to 2.8.12, which will not give a warning with cmake 3.19

Signed-off-by: Peter Toft peter.toft@dirac.com"
@peter-toft-greve
Copy link
Author

peter-toft-greve commented Oct 21, 2020

and if you are into cmake issues join the band in #3790 which is also a problem :)

peter-toft-greve added a commit to peter-toft-greve/mbedtls that referenced this issue Oct 21, 2020
* As described in issue Mbed-TLS#3801 the upcoming cmake 3.19
  will not support cmake 2.6 any more.
* This PR updates the mimumum required cmake version
  to 2.8.12, which will not give a warning with cmake 3.19

Signed-off-by: Peter Toft <peter.toft@dirac.com>
peter-toft-greve added a commit to peter-toft-greve/mbedtls that referenced this issue Oct 22, 2020
* As described in issue Mbed-TLS#3801 the upcoming cmake 3.19
  will not support cmake 2.6 any more
* This PR updates the mimumum 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>
peter-toft-greve added a commit to peter-toft-greve/mbedtls that referenced this issue Oct 22, 2020
* 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>
peter-toft-greve added a commit to peter-toft-greve/mbedtls that referenced this issue Oct 22, 2020
* 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>
@d3zd3z
Copy link
Contributor

d3zd3z commented Nov 2, 2020

#3788 demonstrates that 2.8.12 already doesn't work. I see two possibilities here:

  1. Update the minimum cmake version to 3.15. This makes it clear that the 2.8.12 doesn't actually work, but we more explicitly lose support for these targets.
  2. Work around the target_sources issue. If this can be solved, it would continue to be able to support platforms with cmake 2.8.12.

I suggest if we decided to do 2, CI should include a build done with cmake 2.8.12, otherwise, it will be fairly easy to keep introducing changes that break with this version of cmake.

@gilles-peskine-arm
Copy link
Contributor

Our CI currently mostly runs Ubuntu 16.04, which has CMake 3.5.1, so switching to CMake 3.15 as the minimum supported version would be a pain for us maintainers as well as for users of the library. We aim to maintain compatibility with popular long-time support distributions, and for RHEL/CentOS 7 this means CMake 2.8.12.2 until June 2024.

@peter-toft-greve
Copy link
Author

@gilles-peskine-arm I would then encourage you to update the CI chain e.g. to Ubuntu 20.04.
CMake 3.14 and earlier have odd errors - especially for Windows. I foresee that you will - at some point - before June 2024 have a conflict beween long term support and supported Cmake. I will happily give a beer in Copenhagen if I am wrong :)

d3zd3z added a commit to d3zd3z/mbedtls that referenced this issue Nov 3, 2020
CMake versions less than 3.0 do not support the `target_sources`
command.  In order to be able to support v2.8.12.2 of cmake, directly
set the SOURCES property instead of using the target_sources command.

A future patch could reverse this, if the project decides to forgo
support for cmake versions less than 3.0.

Fixes Mbed-TLS#3801

Signed-off-by: David Brown <david.brown@linaro.org>
@yanesca yanesca moved this from Incoming Items to Prioritised Backlog in OBSOLETE - SEE https://github.com/orgs/Mbed-TLS/projects/3 Nov 4, 2020
d3zd3z added a commit to d3zd3z/mbedtls that referenced this issue Nov 4, 2020
CMake versions less than 3.0 do not support the `target_sources`
command.  In order to be able to support v2.8.12.2 of cmake, add the
extra targets directly to the target command.

This is a backport from the development branch, except that the uses in
this branch are simpler, and modifying the SOURCES property directly is
not needed.

Fixes Mbed-TLS#3801

Signed-off-by: David Brown <david.brown@linaro.org>
d3zd3z added a commit to d3zd3z/mbedtls that referenced this issue Nov 18, 2020
In cmake version < 3.0, the SOURCES property on targets cannot be
modified after the target is defined.  There are several instances in
the code that were using `target_properties()`, which is not available
in the older versions of cmake.  Unfortunately, the workaround in Mbed-TLS#3801
(381c107) assumes that this SOURCES property can be modified.

Work around this by building up any necessary sources before declaring
the target.  This is more awkward, but needed to continue to be able to
support the old versions of cmake.

Signed-off-by: David Brown <david.brown@linaro.org>
d3zd3z added a commit to d3zd3z/mbedtls that referenced this issue Nov 18, 2020
In cmake version < 3.0, the SOURCES property on targets cannot be
modified after the target is defined.  There are several instances in
the code that were using `target_properties()`, which is not available
in the older versions of cmake.  Unfortunately, the workaround in Mbed-TLS#3801
(381c107) assumes that this SOURCES property can be modified.

Work around this by building up any necessary sources before declaring
the target.  This is more awkward, but needed to continue to be able to
support the old versions of cmake.

Fixes Mbed-TLS#3788.

Signed-off-by: David Brown <david.brown@linaro.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants