bitcoin
bitcoin copied to clipboard
CMake-based build system tracking issue
This issue will be updated to reflect the current state of CMake integration.
A brief historical context:
- https://github.com/bitcoin/bitcoin/pull/25797 proposed a CMake-based build system with 100% feature parity to the Autotools-based one.
- The reviewing process is happening in this repo as suggested in https://github.com/bitcoin/bitcoin/pull/27060#issuecomment-1431798320.
- The recent discussion at CoreDev -- https://btctranscripts.com/bitcoin-core-dev-tech/2023-09/cmake/
How reviewing happens:
- Pull requests are opened against the https://github.com/hebasto/bitcoin/tree/cmake-staging branch.
- After reviewing and merging them, the staging branch get synced with the main branch from this repo.
- This loop continues until all commits from https://github.com/bitcoin/bitcoin/pull/25797 get reviewed.
The planned chunks of work:
- [x] The root
CMakeLists.txt
andconfig/bitcoin-config.h
files -- https://github.com/hebasto/bitcoin/pull/5 - [x] Project-wide system introspections; the
leveldb
build target -- https://github.com/hebasto/bitcoin/pull/6 - [x] The
bitcoind
build target -- https://github.com/hebasto/bitcoin/pull/7 - [x] Cross-compiling support -- https://github.com/hebasto/bitcoin/pull/10
- [x] Ccache support;
libnatpmp
,libminiupnpc
,libzmq
andsystemtap-sdt
optional packages support -- https://github.com/hebasto/bitcoin/pull/13 - [x] Utility binaries, wallet functionality,
bench_bitcoin
andtest_bitcoin
-- https://github.com/hebasto/bitcoin/pull/15 - [x] Handling different build configurations -- https://github.com/hebasto/bitcoin/pull/18
- [x] Hardening, shared libraries -- https://github.com/hebasto/bitcoin/pull/32
- ~Build
libbitcoinconsensus
library -- https://github.com/hebasto/bitcoin/pull/41~ See https://github.com/bitcoin/bitcoin/pull/29189 - [x] Qt stuff -- https://github.com/hebasto/bitcoin/pull/77
- [x] Guix builds -- https://github.com/hebasto/bitcoin/pull/67
- [x] Building for fuzzing -- https://github.com/hebasto/bitcoin/pull/43
- [x] multiprocess support -- https://github.com/hebasto/bitcoin/pull/118
- [x]
libbitcoin-kernel
andbitcoin-chainstate
-- https://github.com/hebasto/bitcoin/pull/134 - [x] CI stuff -- https://github.com/hebasto/bitcoin/pull/142
- ~Building for Android~ See https://github.com/bitcoin/bitcoin/pull/30049
~The current minimum required CMake version is 3.13, which is the system package on Debian 10. Considering the timings of Debian 10 LTS EOL and integrating CMake into this repo, it seems reasonable to bump the minimum supported version up to 3.16, which is the system package on Ubuntu 20.04 LTS.~
- [x] Bump minimum supported CMake version from 3.13 up to 3.16 -- https://github.com/hebasto/bitcoin/pull/33
To hold the 100% feature parity, the current CMake-based build system implementation can autodetect an optional package and enable it as Autotools-based one does. However, it was suggested to make all optional package opt-in by default. See:
-
https://github.com/hebasto/bitcoin/pull/12#discussion_r1156251913
-
https://github.com/hebasto/bitcoin/pull/12#discussion_r1157570678
-
https://github.com/hebasto/bitcoin/pull/13#discussion_r1164377093
-
[ ] Make all optional package opt-in by default
Autotools vs CMake Feature Parity Table is available here.
To list CMake's options, one might add the -LH
option during configuring step.
Updated build docs:
cc @theuni @TheCharlatan
The current minimum required CMake version is 3.13, which is the system package on Debian 10. Considering the timings of Debian 10 LTS EOL and integrating CMake into this repo, it seems reasonable to bump the minimum supported version up to 3.16, which is the system package on Ubuntu 20.04 LTS.
Buster Backports has 3.18: https://packages.debian.org/buster-backports/cmake
Also, on a general note, it would be good to have a "cheat sheet" table for each configure option to list the corresponding cmake option. Maybe also one auto-generated and enforced with a script, to check equality, similar to https://github.com/curl/curl/pull/11964
Also, on a general note, it would be good to have a "cheat sheet" table for each configure option to list the corresponding cmake option. Maybe also one auto-generated and enforced with a script, to check equality, similar to curl/curl#11964
Thanks! It is available here. It has been added to the top post.
The next PR to review is https://github.com/hebasto/bitcoin/pull/32.
The current minimum required CMake version is 3.13, which is the system package on Debian 10. Considering the timings of Debian 10 LTS EOL and integrating CMake into this repo, it seems reasonable to bump the minimum supported version up to 3.16, which is the system package on Ubuntu 20.04 LTS.
Buster Backports has 3.18: packages.debian.org/buster-backports/cmake
The CMake minimum required version has been bumped up to 3.16 in https://github.com/hebasto/bitcoin/pull/33.
libbitcoin-kernel and bitcoin-chainstate should be on this list too?
libbitcoin-kernel and bitcoin-chainstate should be on this list too?
Sure. Added.
The new Building Bitcoin Core with Visual Studio doc has been added to the issue description.
+1
Heads up: here are suggestions regarding the current features that are not expected being ported to the CMake-based build system:
- https://github.com/bitcoin/bitcoin/pull/29185
- https://github.com/bitcoin/bitcoin/pull/29189
- https://github.com/bitcoin/bitcoin/pull/29203
Next one: Add MULTIPROCESS option.
What's next?
It would be useful to have a link to build instructions too, not just the cheat cheat (or just add the standard mkdir build
, cmake ..
incantations to the cheat cheat).
In noticed that in your hebasto/cmake-staging
branch the macOS instructions still assume autotools.
@Sjors
What's next?
It would be useful to have a link to build instructions too, not just the cheat cheat (or just add the standard
mkdir build
,cmake ..
incantations to the cheat cheat).In noticed that in your
hebasto/cmake-staging
branch the macOS instructions still assume autotools.
WIP :)
Your testing and reviewing https://github.com/hebasto/bitcoin/pull/163 will be much appreciated!
The main part of the https://github.com/bitcoin/bitcoin/issues/28607#issue-1929913410 has all checkboxes checked.
Thanks to all reviewers and testers!
Keeping working :)