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: Bump CMake minimum required version up to 3.22 #123

Merged
merged 7 commits into from Mar 23, 2024

Conversation

hebasto
Copy link
Owner

@hebasto hebasto commented Mar 19, 2024

Considering the time when the new CMake-based build system will be available for users and bitcoin#29091, it seems reasonable to drop support for CMake versions older than 3.22.

For CMake version availability, please refer to https://repology.org/project/cmake/versions.

If an OS has no supported CMake in its system/default package manager, the user is still able to download it from https://cmake.org/download//

Please refer to commit messages for detailed explanations of code changes.

Bump CMake minimum required version up to 3.22
CMake 3.19:
- The CMAKE_<LANG>_COMPILER variable may now be used to store
"mandatory" compiler flags like the CC and other environment variables.

CMake 3.21:
- The Makefile Generators and the Ninja generator learned to add linker
launcher tools along with the linker for C, CXX, OBJC, and OBJCXX
languages.
CMake 3.17:
- The FindPkgConfig module now extracts include directories prefixed
with -isystem into the *_INCLUDE_DIRS variables and
INTERFACE_INCLUDE_DIRECTORIES target properties.
CMake 3.20:
- The configure_file() command gained FILE_PERMISSIONS options to
support using specified permissions.
CMake 3.17:
- The CMAKE_CURRENT_FUNCTION variable is now defined inside a
function().
CMake 3.21:
- cmake gained the --toolchain command-line option to specify a
toolchain file.
@hebasto hebasto added the help wanted Extra attention is needed label Mar 19, 2024
@TheCharlatan
Copy link

Concept ACK :)

@TheCharlatan
Copy link

Guix build:

80c9a64895c7419056a00867a75dfe8c262d00ea78858044084d8cbd4948fde8  guix-build-a6a746e5b390/output/aarch64-linux-gnu/SHA256SUMS.part
fbfc91cfc5bd625441d69cc44054cf6e5aa4f307820f1c7b27e31e032461c674  guix-build-a6a746e5b390/output/aarch64-linux-gnu/bitcoin-a6a746e5b390-aarch64-linux-gnu-debug.tar.gz
7b196fda321bc35fc4cf2b6e36e53800e5b0826864bcda2001ef2e5d3330ba5f  guix-build-a6a746e5b390/output/aarch64-linux-gnu/bitcoin-a6a746e5b390-aarch64-linux-gnu.tar.gz
bc148454bd90aad9d1416b326e0f16b4b9ec71a76ca64c64f640d6b9ac319528  guix-build-a6a746e5b390/output/arm-linux-gnueabihf/SHA256SUMS.part
054de54f1473974b0fb2247c2b2199891b0b294ee6e3e7a6c3553ef0df663721  guix-build-a6a746e5b390/output/arm-linux-gnueabihf/bitcoin-a6a746e5b390-arm-linux-gnueabihf-debug.tar.gz
c98bac18196e267d46b5d7f7f73fc4d0f38861597ec526dd0599819a80f48e4f  guix-build-a6a746e5b390/output/arm-linux-gnueabihf/bitcoin-a6a746e5b390-arm-linux-gnueabihf.tar.gz
47e42797b4eea1fb30a376926c55cfd8b9b1a1aa434a7c078448992dc632c669  guix-build-a6a746e5b390/output/dist-archive/bitcoin-a6a746e5b390.tar.gz
a69c9cbf6a128117106cb430ffa6f97addd2b63475389c8ff24af2087f8913d1  guix-build-a6a746e5b390/output/powerpc64-linux-gnu/SHA256SUMS.part
8d5f3e7873bf2db504cf83b3f09bdcb69b54a5177b1ac8f65e52153490d4010b  guix-build-a6a746e5b390/output/powerpc64-linux-gnu/bitcoin-a6a746e5b390-powerpc64-linux-gnu-debug.tar.gz
940061cf357d165317bb4ed77060c3c14203e34e606ac160d97da5c4dee5b5ec  guix-build-a6a746e5b390/output/powerpc64-linux-gnu/bitcoin-a6a746e5b390-powerpc64-linux-gnu.tar.gz
5b7d1b8cb916dbe7b890df3acf2992ed2a4f8ee7b47a4bd0d06632579c2cbc72  guix-build-a6a746e5b390/output/powerpc64le-linux-gnu/SHA256SUMS.part
f277eb0e49bf0e69e31e0bd66fe348c11bfe2d014f2bb3beccf101cde515e58c  guix-build-a6a746e5b390/output/powerpc64le-linux-gnu/bitcoin-a6a746e5b390-powerpc64le-linux-gnu-debug.tar.gz
6f0b8c2257c9629035de2e0d2ca05f8e93b5a0f8057fc5cb63fb76f74e472b1a  guix-build-a6a746e5b390/output/powerpc64le-linux-gnu/bitcoin-a6a746e5b390-powerpc64le-linux-gnu.tar.gz
ab4caed3d7a8a427ba40ea9c5918bfe0b690d78f63976fa005b0919be4cc4344  guix-build-a6a746e5b390/output/riscv64-linux-gnu/SHA256SUMS.part
675f2272de755293327c0b67c1f64f2adcfcfda9f8a56e5526aabd0cbb40841b  guix-build-a6a746e5b390/output/riscv64-linux-gnu/bitcoin-a6a746e5b390-riscv64-linux-gnu-debug.tar.gz
8db14a0d6ff90a718275531699fba1b52e412f3a0fb9391ba1f804cf78a22cce  guix-build-a6a746e5b390/output/riscv64-linux-gnu/bitcoin-a6a746e5b390-riscv64-linux-gnu.tar.gz
affe152e26ce4852ac8d4bdb2c2b7cde08faa0319fc829bb703249584097f340  guix-build-a6a746e5b390/output/x86_64-linux-gnu/SHA256SUMS.part
711d838d98a421a73bf55d34d0a52004735565cb67c77f93b32ff21ac9b53c07  guix-build-a6a746e5b390/output/x86_64-linux-gnu/bitcoin-a6a746e5b390-x86_64-linux-gnu-debug.tar.gz
4cfa08385708db5f3f9ab4b785ffdf8f797e240a0a838de905e8d161ea0794af  guix-build-a6a746e5b390/output/x86_64-linux-gnu/bitcoin-a6a746e5b390-x86_64-linux-gnu.tar.gz
5cb19c90af886c735c7ef11f4fdaa4dff0b5986c2d0ac6a4742597478433bca9  guix-build-a6a746e5b390/output/x86_64-w64-mingw32/SHA256SUMS.part
962ac2fe8aceee9eb349c95ee3fec078101531fbd924d0a009da41ed097c9620  guix-build-a6a746e5b390/output/x86_64-w64-mingw32/bitcoin-a6a746e5b390-win64-debug.zip
5f8b0de0b8d482d6125686621d4f074ac968f1ac3bbb78ef37b89f607ec58f32  guix-build-a6a746e5b390/output/x86_64-w64-mingw32/bitcoin-a6a746e5b390-win64-setup-unsigned.exe
0756fbeea0791408a4eeeb182cd32023fecc8a36694b6ff2c23a7c8478755072  guix-build-a6a746e5b390/output/x86_64-w64-mingw32/bitcoin-a6a746e5b390-win64-unsigned.tar.gz
68c17f0a9c725fb4dbcaa62d04950cbe49c3c255c5bc9bb0bec3251485f180d4  guix-build-a6a746e5b390/output/x86_64-w64-mingw32/bitcoin-a6a746e5b390-win64.zip

Copy link

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

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

Concept ACK

I'll perform a cross-build later today, especially due to the removal of the workaround on commit ae5bd32 (cmake/module/CrossPkgConfig.cmake) not being necessary anymore (even CIs indicate to work fine).

Copy link

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

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

tACK a6a746e

Cross-building for Windows on Ubuntu 22.04 & Ubuntu 22.04 on WSL.

Ran successfully ctest and test_bitcoin-qt on both WSL and Windows 11 Pro.

fanquake added a commit to fanquake/bitcoin that referenced this pull request Mar 21, 2024
Matches hebasto#123.
This also also dev/ci only code.
@fanquake
Copy link

ACK on bumping the version. I haven't yet looked at the all the cleanups.

# Centos Stream 8, EOL in May 2024:
# - CMake 3.20.2, http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/
# Centos Stream 9, EOL in May 2027:
# - CMake 3.26.5, https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/
Copy link

Choose a reason for hiding this comment

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

lgtm. Confirmed in a docker:

# dnf install cmake 
CentOS Stream 9 - BaseOS                                                                                                                                                                                      2.8 MB/s | 8.0 MB     00:02    
CentOS Stream 9 - AppStream                                                                                                                                                                                   5.1 MB/s |  19 MB     00:03    
CentOS Stream 9 - Extras packages                                                                                                                                                                              17 kB/s |  16 kB     00:00    
Last metadata expiration check: 0:00:01 ago on Thu Mar 21 18:14:38 2024.
Dependencies resolved.
==============================================================================================================================================================================================================================================
 Package                                                      Architecture                                       Version                                                          Repository                                             Size
==============================================================================================================================================================================================================================================
Installing:
 cmake                                                        x86_64                                             3.26.5-2.el9                                                     appstream                                             8.7 M

Copy link

@vasild vasild left a comment

Choose a reason for hiding this comment

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

ACK a6a746e

+31 / -100 ❤️

fanquake added a commit to fanquake/bitcoin that referenced this pull request Mar 22, 2024
Matches hebasto#123.
This also also dev/ci only code.
@hebasto hebasto merged commit e8bbd04 into cmake-staging Mar 23, 2024
27 checks passed
fanquake added a commit to bitcoin/bitcoin that referenced this pull request Mar 25, 2024
11ee058 tidy: remove C compiler check (fanquake)
c3a4ea1 tidy: set CMAKE_CXX_STANDARD to 20 (fanquake)
5b690ae tidy: remove terminfo TODO (fanquake)
24410e5 tidy: set minimum CMake to 3.22 (fanquake)

Pull request description:

  See hebasto#123 for the minimum version bump.

ACKs for top commit:
  hebasto:
    re-ACK 11ee058.

Tree-SHA512: 94a508ea24bf17919961bbdbc2e9d17658858e179c3b2017d5932557af32530d9d6aab197453aa5444f5478c417129c5a8e39522ff82bafac0d5a6966c7246d3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants