From 13188e1d9276eebf78a99bbecb5b8d31652c5289 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 1 Jul 2020 15:18:55 +0200 Subject: [PATCH] Merge #19331: build: Do not include server symbols in wallet faca73000fa8975c28f6be8be01957c1ae94ea62 ci: Install fixed version of clang-format for linters (MarcoFalke) fa4695da4c69646b58a8fa0b6b30146bb234deb8 build: Sort Makefile.am after renaming file (MarcoFalke) cccc2784a3bb10fa8e43be7e68207cafb12bd915 scripted-diff: Move ui_interface to the node lib (MarcoFalke) fa72ca6a9d90d66012765b0043fd819698b94ba8 qt: Remove unused includes (MarcoFalke) fac96e6450d595fe67168cb7afa7692da6cc9973 wallet: Do not include server symbols (MarcoFalke) fa0f6c58c1c6d10f04c4e65a424cc51ebca50a8c Revert "Fix link error with --enable-debug" (MarcoFalke) Pull request description: This reverts a hacky workaround from commit b83cc0f, which only happens to work due to compiler optimizations. Then, it actually fixes the linker error. The underlying problem is that the wallet includes symbols from the server (ui_interface), which usually results in linker failures. Though, in this specific case the linker failures have not been observed (unless `-O0`) because our compilers were smart enough to strip unused symbols. Fix the underlying problem by creating a new header-only with the needed symbol and move ui_interface to node to clarify that this is part of libbitcoin_server. ACKs for top commit: Sjors: ACK faca730 laanwj: ACK faca73000fa8975c28f6be8be01957c1ae94ea62 hebasto: re-ACK faca73000fa8975c28f6be8be01957c1ae94ea62, since the [previous](https://github.com/bitcoin/bitcoin/pull/19331#pullrequestreview-434420539) review: Tree-SHA512: e9731f249425aaea50b6db5fc7622e10078cf006721bb87989cac190a2ff224412f6f8a7dd83efd018835302337611f5839e29e15bef366047ed591cef58dfb4 --- ci/lint/04_install.sh | 4 ++++ src/Makefile.am | 35 +++++++++++++++++---------------- src/banman.cpp | 2 +- src/bitcoind.cpp | 2 +- src/evo/deterministicmns.cpp | 1 - src/httpserver.cpp | 2 +- src/index/base.cpp | 2 +- src/index/txindex.cpp | 2 +- src/init.cpp | 2 +- src/interfaces/wallet.h | 2 +- src/llmq/chainlocks.cpp | 2 +- src/masternode/sync.cpp | 2 +- src/net.cpp | 2 +- src/node/interfaces.cpp | 2 +- src/{ => node}/ui_interface.cpp | 2 +- src/{ => node}/ui_interface.h | 16 ++++----------- src/noui.cpp | 2 +- src/qt/bitcoin.cpp | 1 - src/qt/bitcoingui.cpp | 2 +- src/qt/guiutil.cpp | 1 - src/qt/paymentserver.cpp | 4 ++-- src/qt/sendcoinsdialog.cpp | 2 +- src/qt/splashscreen.cpp | 1 - src/qt/transactionview.cpp | 2 +- src/qt/walletmodel.cpp | 2 +- src/qt/walletview.cpp | 2 +- src/shutdown.cpp | 2 +- src/timedata.cpp | 2 +- src/txdb.cpp | 2 +- src/util/ui_change_type.h | 15 ++++++++++++++ src/validation.cpp | 2 +- src/wallet/init.cpp | 2 +- src/wallet/interfaces.cpp | 2 +- src/wallet/wallet.h | 2 +- 34 files changed, 68 insertions(+), 60 deletions(-) rename src/{ => node}/ui_interface.cpp (99%) rename src/{ => node}/ui_interface.h (94%) create mode 100644 src/util/ui_change_type.h diff --git a/ci/lint/04_install.sh b/ci/lint/04_install.sh index 542c5b52e3..e7758a8c57 100755 --- a/ci/lint/04_install.sh +++ b/ci/lint/04_install.sh @@ -6,6 +6,10 @@ export LC_ALL=C +travis_retry sudo apt update && sudo apt install -y clang-format-9 +sudo update-alternatives --install /usr/bin/clang-format clang-format $(which clang-format-9 ) 100 +sudo update-alternatives --install /usr/bin/clang-format-diff clang-format-diff $(which clang-format-diff-9) 100 + travis_retry pip3 install codespell==1.17.1 travis_retry pip3 install flake8==3.8.3 travis_retry pip3 install vulture==2.3 diff --git a/src/Makefile.am b/src/Makefile.am index 6e416fa1cf..2e58ef28ef 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -141,6 +141,7 @@ BITCOIN_CORE_H = \ cachemap.h \ cachemultimap.h \ blockfilter.h \ + bloom.h \ chain.h \ chainparams.h \ chainparamsbase.h \ @@ -170,6 +171,7 @@ BITCOIN_CORE_H = \ cuckoocache.h \ ctpl_stl.h \ cxxtimer.hpp \ + dbwrapper.h \ deploymentinfo.h \ deploymentstatus.h \ evo/assetlocktx.h \ @@ -217,7 +219,6 @@ BITCOIN_CORE_H = \ interfaces/wallet.h \ key.h \ key_io.h \ - dbwrapper.h \ limitedmap.h \ llmq/blockprocessor.h \ llmq/chainlocks.h \ @@ -263,6 +264,7 @@ BITCOIN_CORE_H = \ node/context.h \ node/psbt.h \ node/transaction.h \ + node/ui_interface.h \ node/utxo_snapshot.h \ noui.h \ outputtype.h \ @@ -308,13 +310,12 @@ BITCOIN_CORE_H = \ support/lockedpool.h \ sync.h \ timestampindex.h \ - threadsafety.h \ threadinterrupt.h \ + threadsafety.h \ timedata.h \ torcontrol.h \ txdb.h \ txmempool.h \ - ui_interface.h \ undo.h \ unordered_lru_cache.h \ util/bip32.h \ @@ -329,8 +330,6 @@ BITCOIN_CORE_H = \ util/hasher.h \ util/hash_type.h \ util/irange.h \ - util/spanparsing.h \ - util/system.h \ util/asmap.h \ util/getuniquepath.h \ util/macros.h \ @@ -345,20 +344,22 @@ BITCOIN_CORE_H = \ util/ranges_set.h \ util/sock.h \ util/string.h \ + util/spanparsing.h \ + util/system.h \ util/time.h \ util/thread.h \ util/threadnames.h \ util/trace.h \ util/translation.h \ - util/vector.h \ + util/ui_change_type.h \ util/url.h \ util/vector.h \ validation.h \ validationinterface.h \ versionbits.h \ - walletinitinterface.h \ wallet/bdb.h \ wallet/coincontrol.h \ + wallet/coinselection.h \ wallet/context.h \ wallet/crypter.h \ wallet/db.h \ @@ -373,7 +374,7 @@ BITCOIN_CORE_H = \ wallet/walletdb.h \ wallet/wallettool.h \ wallet/walletutil.h \ - wallet/coinselection.h \ + walletinitinterface.h \ warnings.h \ zmq/zmqabstractnotifier.h \ zmq/zmqnotificationinterface.h \ @@ -423,6 +424,14 @@ libbitcoin_server_a_SOURCES = \ evo/specialtx.cpp \ evo/specialtxman.cpp \ flatfile.cpp \ + governance/classes.cpp \ + governance/exceptions.cpp \ + governance/governance.cpp \ + governance/object.cpp \ + governance/validators.cpp \ + governance/vote.cpp \ + governance/votedb.cpp \ + gsl/assert.cpp \ httprpc.cpp \ httpserver.cpp \ i2p.cpp \ @@ -431,14 +440,6 @@ libbitcoin_server_a_SOURCES = \ index/coinstatsindex.cpp \ index/txindex.cpp \ init.cpp \ - governance/governance.cpp \ - governance/classes.cpp \ - governance/exceptions.cpp \ - governance/object.cpp \ - governance/validators.cpp \ - governance/vote.cpp \ - governance/votedb.cpp \ - gsl/assert.cpp \ llmq/quorums.cpp \ llmq/blockprocessor.cpp \ llmq/commitment.cpp \ @@ -472,6 +473,7 @@ libbitcoin_server_a_SOURCES = \ node/interfaces.cpp \ node/psbt.cpp \ node/transaction.cpp \ + node/ui_interface.cpp \ noui.cpp \ policy/fees.cpp \ policy/policy.cpp \ @@ -497,7 +499,6 @@ libbitcoin_server_a_SOURCES = \ torcontrol.cpp \ txdb.cpp \ txmempool.cpp \ - ui_interface.cpp \ validation.cpp \ validationinterface.cpp \ versionbits.cpp \ diff --git a/src/banman.cpp b/src/banman.cpp index c7e9cb6744..8f216ab8a0 100644 --- a/src/banman.cpp +++ b/src/banman.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index def1807316..d56eb01afa 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -14,9 +14,9 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/src/evo/deterministicmns.cpp b/src/evo/deterministicmns.cpp index 73d72b2be6..184a0a888a 100644 --- a/src/evo/deterministicmns.cpp +++ b/src/evo/deterministicmns.cpp @@ -15,7 +15,6 @@ #include #include #include