#35072 cmake: Remove optional definitions from `bitcoin-build-config.h`
| Reviewability | Reviews | Agreement | Size | ||||
|---|---|---|---|---|---|---|---|
| #35072 cmake: Remove optional definitions from `bitcoin-build-config.h` | Author silent 156d | 0 (+1) -1 | Mild | 11 + 1 tests | |||
|
|
|
|
| |||
Reviewability: ReadyStalePaused Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs. Size: lines added or modified outside tests, then in tests; greener = smaller. | |||||||
Goal
Removes optional build feature definitions (`USE_DBUS`, `USE_QRCODE`, `ENABLE_WALLET`, `ENABLE_TRACING`, and `ENABLE_EXTERNAL_SIGNER`) from the global `bitcoin-build-config.h` header. Moves these definitions to target-specific CMake compile definitions on the relevant libraries and targets (`bitcoinqt`, `test_bitcoin-qt`, `USDT::headers`, and `bitcoin_common`). Drops now-unneeded includes of `bitcoin-build-config.h` across Qt, wallet, RPC, and node source files.
Problem: Reconfiguring build options (such as toggling GUI or wallet support after building non-GUI targets) modifies `bitcoin-build-config.h`. Because almost all targets include this header, any reconfiguration forces a full rebuild of the entire tree instead of compiling only the newly enabled targets.
Evidence of importance:
- Author demonstrates unnecessary rebuilds in the PR description: running `cmake -B build -DBUILD_TESTS=OFF && cmake --build build` followed by reconfiguring with `-DBUILD_GUI=ON` unnecessarily rebuilds non-GUI targets because `USE_DBUS` and `USE_QRCODE` modify the common header.
- Author states this is 'a necessary prerequisite for effectively addressing #29914' (no other contributors corroborate in the record).
Scope: Most file changes are mechanical deletions of `#include <bitcoin-build-config.h>` across source files that no longer require build-wide definitions.
Reviewability
Stale · Author silent 156d
No author activity for 156 days; a review may wait a long time for a response.
Agreement
Mild
objection that needs a change was answered, no reply from the objector (fanquake (NACK): undermines the purpose of a shared config header triggering rebuilds on configuration changes, and removes the single po); objection that needs an answer has none yet (151henry151)
Thread notes: fanquake Concept NACKed the approach, stating that config headers should trigger rebuilds when settings change and maintain a canonical source of truth. Hebasto put the PR in draft status to address the concerns.
Objections, suggestions, and questions:
| Reviewer | Type | Harm, request, or question | Status | Must be | Author replied | Quote |
|---|---|---|---|---|---|---|
| 151henry151 (contributor) | objection, maintenance | scripts and auxiliary tooling lose a single source of truth for enabled features | open · v1, not yet re-checked | answered | no | 2026-04-29: 'it would be nice to have a single source of truth for “what was enabled” for this kind of tooling' |
| fanquake (member) | objection, approach | undermines the purpose of a shared config header triggering rebuilds on configuration changes, and removes the single point of truth without an overall design | answered · reply on record; standing not assessed yet · v1, not yet re-checked | changed | yes | 2026-05-21: 'I think the point of a (shared) config header, is to trigger rebuilds of modules that use it, when the header/config changes.' |
Support:
- BrandonOdiwuor (contributor) (Tested ACK, 2026-04-17): tested that only Qt-related targets are rebuilt when BUILD_GUI=ON is enabled while non-GUI targets remain untouched
Participants:
- BrandonOdiwuor (contributor, support, 1 statements 2026-04-17 to 2026-04-17): Tested ACK verifying non-GUI targets are not rebuilt when toggling GUI builds
- fanquake (member, objection, 2 statements 2026-04-17 to 2026-05-21): Concept NACK; argues config headers should trigger rebuilds and provide a single source of truth
- 151henry151 (contributor, objection, 2 statements 2026-04-29 to 2026-05-22): noted tooling like gen-manpages.py needs a canonical source of truth for enabled configuration
Dependencies
Enables:
Files
5 lines under test/bench/ci.
- cmake/bitcoin-build-config.h.in +0/-16
- src/qt/CMakeLists.txt +6/-1
- cmake/module/FindUSDT.cmake +2/-4
- src/CMakeLists.txt +3/-0
- CMakeLists.txt +0/-2
- src/common/run_command.cpp +0/-2
- src/node/interfaces.cpp +0/-2
- src/qt/bitcoin.h +0/-2
- src/qt/bitcoingui.h +0/-2
- src/qt/createwalletdialog.cpp +0/-2
- src/qt/notificator.cpp +0/-2
- src/qt/notificator.h +0/-2
- src/qt/optionsmodel.cpp +0/-2
- src/qt/qrimagewidget.cpp +0/-2
- src/qt/receiverequestdialog.cpp +0/-2
- src/qt/rpcconsole.h +0/-2
- src/qt/test/test_main.cpp +0/-2
- src/rpc/external_signer.cpp +0/-2
- src/rpc/register.h +0/-2
- src/test/system_tests.cpp +0/-2
- src/util/trace.h +0/-2
- src/wallet/rpc/addresses.cpp +0/-2
- src/wallet/rpc/wallet.cpp +0/-2
- src/wallet/walletdb.cpp +0/-2
- src/qt/test/CMakeLists.txt +1/-0
Card
The short text the ranking pass compares across PRs.
Removes optional build configuration macros (`USE_DBUS`, `USE_QRCODE`, `ENABLE_WALLET`, `ENABLE_TRACING`, `ENABLE_EXTERNAL_SIGNER`) from the global `bitcoin-build-config.h` header, scoping them directly to their CMake targets instead. Currently, modifying any optional build setting touches the global config header and triggers a recompilation of every target across the project. This change ensures that toggling features such as the GUI only triggers builds for the newly enabled targets. The author notes this also acts as a prerequisite for #29914.
Data
thread read through 2026-05-28 (8 statements), head 04a1ea6686
Discussion read under schema 1 rules: suggestions and questions may be missing, and an objection may combine several harms (schema history).
labels: Build system, Needs rebase, CI failed · draft
Categories
Build and CI
P3 · speedup (ranking pass: Moved down from 24: developer rebuild-time improvement and stated prerequisite for #29914, but no user-facing consequence)
Reduces rebuild times during reconfiguration by scoping feature flags to specific targets rather than triggering full tree rebuilds through bitcoin-build-config.h. Reconfiguring build options such as toggling GUI or wallet support previously rebuilt non-GUI targets needlessly. Contributor friction and build speed improvements rank as worthwhile P3 work.
Membership: Carries the Build system label and refactors CMake build targets, cmake/bitcoin-build-config.h.in, and target compile definitions.
Factors: security/stability 0, bug 0, performance 1, user value 0, leverage 1