Page MenuHomePhabricator

Remove configure-time setting of DEFAULT_NATPMP and DEFAULT_UPNP
ClosedPublic

Authored by PiRK on Mar 30 2026, 14:04.

Details

Summary

Default to false.

We never set these "default default" values in any build, so we can simplify the configuration.
Note that we could simplify it even further by merging USE_[UPNP,NATPMP] and ENABLE_[UPNP,NATPMP], which are now aliases of each-other, but all of these options are going away soon so it's not worth the extra effort.

This is a backport of core#26896 and core#28874

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Mar 30 2026, 14:04

Tail of the build log:

[420/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/random.cpp.o
[421/602] Building CXX object src/CMakeFiles/bitcoind.dir/bitcoind.cpp.o
[422/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[423/602] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[424/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[425/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[426/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[427/602] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[428/602] Building CXX object src/CMakeFiles/bitcoin-wallet.dir/bitcoin-wallet.cpp.o
[429/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[430/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[431/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[432/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[433/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[434/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[435/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[436/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/txmempool.cpp.o
[437/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[438/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[439/602] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[440/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[441/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[442/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[443/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[444/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[445/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[446/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[447/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[448/602] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[449/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[450/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[451/602] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[452/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[453/602] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[454/602] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_formatter.cpp.o
[455/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[456/602] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_interpreter.cpp.o
[457/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[458/602] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[459/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[460/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
FAILED: src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o 
/usr/bin/cmake -E __run_co_compile --launcher=/usr/bin/ccache --tidy="/usr/bin/clang-tidy-16;-warnings-as-errors=*;--extra-arg-before=--driver-mode=g++" --source=/work/src/wallet/wallet.cpp -- /usr/bin/clang++ -DBOOST_ALL_NO_LIB -DBOOST_NO_CXX98_FUNCTION_BASE -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -I/work/src/. -I/work/abc-ci-builds/build-clang-tidy/src -I/work/src/univalue/include -I/work/abc-ci-builds/build-clang-tidy/src/crypto/.. -I/work/src/secp256k1/include -I/work/src/leveldb/include -I/work/src/crc32c/include -I/work/chronik -I/work/abc-ci-builds/build-clang-tidy/cargo/build/x86_64-unknown-linux-gnu/cxxbridge -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -g -O2 -fPIC -fvisibility=hidden -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wgnu -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wno-implicit-fallthrough -Wno-psabi -Wno-unused-parameter -Wthread-safety -Wrange-loop-analysis -Wredundant-decls -Wunreachable-code-loop-increment -Wsign-compare -Wconditional-uninitialized -Wdocumentation -Wformat-security -Wredundant-move -Wsuggest-override -Woverloaded-virtual -Wshadow -Wshadow-field -std=gnu++20 -MD -MT src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o -MF src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o.d -o src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o -c /work/src/wallet/wallet.cpp
/work/src/wallet/wallet.cpp:50:13: error: using decl 'ToString' is unused [misc-unused-using-decls,-warnings-as-errors]
using util::ToString;
            ^
/work/src/wallet/wallet.cpp:50:13: note: remove the using
using util::ToString;
~~~~~~~~~~~~^~~~~~~~~
3232 warnings generated.
Suppressed 3231 warnings (3231 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning treated as error
[461/602] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana.cpp.o
[462/602] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[463/602] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[464/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[465/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1
PiRK planned changes to this revision.Mar 30 2026, 14:38

Tail of the build log:

[422/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/random.cpp.o
[423/602] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[424/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[425/602] Building CXX object src/CMakeFiles/bitcoin-wallet.dir/bitcoin-wallet.cpp.o
[426/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[427/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[428/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[429/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[430/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[431/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[432/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[433/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[434/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[435/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[436/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/txmempool.cpp.o
[437/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[438/602] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[439/602] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[440/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[441/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[442/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[443/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[444/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[445/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[446/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[447/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[448/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[449/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[450/602] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[451/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[452/602] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[453/602] Linking CXX static library chronik/libchronik-bridge.a
[454/602] Linking CXX static library chronik/libchronik.a
[455/602] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[456/602] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_formatter.cpp.o
[457/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[458/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[459/602] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_interpreter.cpp.o
[460/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
FAILED: src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o 
/usr/bin/cmake -E __run_co_compile --launcher=/usr/bin/ccache --tidy="/usr/bin/clang-tidy-16;-warnings-as-errors=*;--extra-arg-before=--driver-mode=g++" --source=/work/src/wallet/wallet.cpp -- /usr/bin/clang++ -DBOOST_ALL_NO_LIB -DBOOST_NO_CXX98_FUNCTION_BASE -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -I/work/src/. -I/work/abc-ci-builds/build-clang-tidy/src -I/work/src/univalue/include -I/work/abc-ci-builds/build-clang-tidy/src/crypto/.. -I/work/src/secp256k1/include -I/work/src/leveldb/include -I/work/src/crc32c/include -I/work/chronik -I/work/abc-ci-builds/build-clang-tidy/cargo/build/x86_64-unknown-linux-gnu/cxxbridge -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -g -O2 -fPIC -fvisibility=hidden -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wgnu -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wno-implicit-fallthrough -Wno-psabi -Wno-unused-parameter -Wthread-safety -Wrange-loop-analysis -Wredundant-decls -Wunreachable-code-loop-increment -Wsign-compare -Wconditional-uninitialized -Wdocumentation -Wformat-security -Wredundant-move -Wsuggest-override -Woverloaded-virtual -Wshadow -Wshadow-field -std=gnu++20 -MD -MT src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o -MF src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o.d -o src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o -c /work/src/wallet/wallet.cpp
/work/src/wallet/wallet.cpp:50:13: error: using decl 'ToString' is unused [misc-unused-using-decls,-warnings-as-errors]
using util::ToString;
            ^
/work/src/wallet/wallet.cpp:50:13: note: remove the using
using util::ToString;
~~~~~~~~~~~~^~~~~~~~~
3232 warnings generated.
Suppressed 3231 warnings (3231 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning treated as error
[461/602] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana.cpp.o
[462/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[463/602] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[464/602] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[465/602] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[466/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[467/602] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1
PiRK planned changes to this revision.Mar 30 2026, 15:49

needs rebase

Fabien added inline comments.
src/config/bitcoin-config.h.cmake.in
66 ↗(On Diff #58804)

Are the ENABLE_x definitions used at all ?

src/config/bitcoin-config.h.cmake.in
66 ↗(On Diff #58804)

We use them to disable these features for the native build, and we mention them in the the build process documentation to optionaly skip a dependency.

src/config/bitcoin-config.h.cmake.in
66 ↗(On Diff #58804)

they are not used in the source code, it is just a cmake intermediate var. I'll see if i can remove it from the config.h file

remove unused ENABLE_* from bitcoin-config.h

This revision is now accepted and ready to land.Mar 31 2026, 20:11