#35072 cmake: Remove optional definitions from `bitcoin-build-config.h`

ReviewabilityReviewsAgreementSize
#35072 hebasto cmake: Remove optional definitions from `bitcoin-build-config.h`Author silent 156d0 (+1) -1Mild11 + 1 tests
  • Avoid full tree rebuilds when reconfiguring build options like GUI or wallet support
  • Ensure only newly enabled targets recompile rather than the entire codebase
  • Author silent for 118 days after putting PR in draft status
  • Needs rebase and CI is failing
  • Concept NACK: undermines purpose of config header triggering rebuilds without a broad design (fanquake)
  • Unaddressed objection: scripts and tooling lose a single source of truth for enabled features (151henry151)
  • Verified by testing that non-GUI targets do not rebuild when enabling the GUI (BrandonOdiwuor)
  • 11 lines added or modified outside tests
  • 1 lines added or modified in tests
  • 61 lines removed in total
  • 25 files, 5 commits
Build and CI#30 of 56
P3 · speedup
  • P3 because it reduces developer build times when reconfiguring options like GUI or wallet support
  • Prevents unnecessary full tree recompilations by isolating feature flags to relevant targets
  • Ranking pass: Moved down from 24: developer rebuild-time improvement and stated prerequisite for #29914, but no user-facing consequence
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:

ReviewerTypeHarm, request, or questionStatusMust beAuthor repliedQuote
151henry151 (contributor)objection, maintenancescripts and auxiliary tooling lose a single source of truth for enabled featuresopen · v1, not yet re-checkedansweredno2026-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, approachundermines the purpose of a shared config header triggering rebuilds on configuration changes, and removes the single point of truth without an overall designanswered · reply on record; standing not assessed yet · v1, not yet re-checkedchangedyes2026-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

dossier JSON · extract JSON · model ledger, generated 2026-09-18T03:28, confidence high, input hash f1b7e6b3bf9d420f
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