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
This commit is contained in:
Wladimir J. van der Laan 2020-07-01 15:18:55 +02:00 committed by pasta
parent cd9af42411
commit 13188e1d92
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984
34 changed files with 68 additions and 60 deletions

View File

@ -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

View File

@ -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 \

View File

@ -6,7 +6,7 @@
#include <banman.h>
#include <netaddress.h>
#include <ui_interface.h>
#include <node/ui_interface.h>
#include <util/system.h>
#include <util/time.h>
#include <util/translation.h>

View File

@ -14,9 +14,9 @@
#include <init.h>
#include <interfaces/chain.h>
#include <node/context.h>
#include <node/ui_interface.h>
#include <noui.h>
#include <shutdown.h>
#include <ui_interface.h>
#include <util/check.h>
#include <util/system.h>
#include <util/strencodings.h>

View File

@ -15,7 +15,6 @@
#include <consensus/validation.h>
#include <deploymentstatus.h>
#include <script/standard.h>
#include <ui_interface.h>
#include <validation.h>
#include <validationinterface.h>
#include <univalue.h>

View File

@ -6,10 +6,10 @@
#include <chainparamsbase.h>
#include <netbase.h>
#include <node/ui_interface.h>
#include <rpc/protocol.h> // For HTTP status codes
#include <shutdown.h>
#include <sync.h>
#include <ui_interface.h>
#include <util/strencodings.h>
#include <util/system.h>
#include <util/threadnames.h>

View File

@ -5,9 +5,9 @@
#include <chainparams.h>
#include <index/base.h>
#include <node/blockstorage.h>
#include <node/ui_interface.h>
#include <shutdown.h>
#include <tinyformat.h>
#include <ui_interface.h>
#include <util/thread.h>
#include <util/translation.h>
#include <validation.h> // For g_chainman

View File

@ -4,8 +4,8 @@
#include <index/disktxpos.h>
#include <index/txindex.h>
#include <node/ui_interface.h>
#include <shutdown.h>
#include <ui_interface.h>
#include <util/system.h>
#include <util/translation.h>
#include <validation.h>

View File

@ -38,6 +38,7 @@
#include <netbase.h>
#include <node/blockstorage.h>
#include <node/context.h>
#include <node/ui_interface.h>
#include <policy/feerate.h>
#include <policy/fees.h>
#include <policy/policy.h>
@ -54,7 +55,6 @@
#include <torcontrol.h>
#include <txdb.h>
#include <txmempool.h>
#include <ui_interface.h>
#include <util/asmap.h>
#include <util/error.h>
#include <util/moneystr.h>

View File

@ -11,8 +11,8 @@
#include <pubkey.h> // For CKeyID and CScriptID (definitions needed in CTxDestination instantiation)
#include <script/standard.h> // For CTxDestination
#include <support/allocators/secure.h> // For SecureString
#include <ui_interface.h> // For ChangeType
#include <util/message.h>
#include <util/ui_change_type.h>
#include <functional>
#include <map>

View File

@ -14,10 +14,10 @@
#include <masternode/sync.h>
#include <net_processing.h>
#include <node/blockstorage.h>
#include <node/ui_interface.h>
#include <scheduler.h>
#include <spork.h>
#include <txmempool.h>
#include <ui_interface.h>
#include <util/thread.h>
#include <util/time.h>
#include <validation.h>

View File

@ -8,8 +8,8 @@
#include <governance/governance.h>
#include <netfulfilledman.h>
#include <netmessagemaker.h>
#include <node/ui_interface.h>
#include <shutdown.h>
#include <ui_interface.h>
#include <validation.h>
#include <util/time.h>
#include <util/translation.h>

View File

@ -20,10 +20,10 @@
#include <net_permissions.h>
#include <netaddress.h>
#include <netbase.h>
#include <node/ui_interface.h>
#include <protocol.h>
#include <random.h>
#include <scheduler.h>
#include <ui_interface.h>
#include <util/sock.h>
#include <util/strencodings.h>
#include <util/thread.h>

View File

@ -30,6 +30,7 @@
#include <node/blockstorage.h>
#include <node/coin.h>
#include <node/context.h>
#include <node/ui_interface.h>
#include <node/transaction.h>
#include <policy/feerate.h>
#include <policy/fees.h>
@ -44,7 +45,6 @@
#include <sync.h>
#include <timedata.h>
#include <txmempool.h>
#include <ui_interface.h>
#include <uint256.h>
#include <util/check.h>
#include <util/system.h>

View File

@ -2,7 +2,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <ui_interface.h>
#include <node/ui_interface.h>
#include <util/translation.h>

View File

@ -3,8 +3,8 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_UI_INTERFACE_H
#define BITCOIN_UI_INTERFACE_H
#ifndef BITCOIN_NODE_UI_INTERFACE_H
#define BITCOIN_NODE_UI_INTERFACE_H
#include <functional>
#include <memory>
@ -21,14 +21,6 @@ class connection;
}
} // namespace boost
/** General change type (added, updated, removed). */
enum ChangeType
{
CT_NEW,
CT_UPDATED,
CT_DELETED
};
/** Signals for UI communication. */
class CClientUIInterface
{
@ -132,8 +124,8 @@ void InitWarning(const bilingual_str& str);
/** Show error message **/
bool InitError(const bilingual_str& str);
inline bool AbortError(const bilingual_str& str) { return InitError(str); }
constexpr auto AbortError = InitError;
extern CClientUIInterface uiInterface;
#endif // BITCOIN_UI_INTERFACE_H
#endif // BITCOIN_NODE_UI_INTERFACE_H

View File

@ -7,7 +7,7 @@
#include <noui.h>
#include <logging.h>
#include <ui_interface.h>
#include <node/ui_interface.h>
#include <util/translation.h>
#include <string>

View File

@ -34,7 +34,6 @@
#include <node/context.h>
#include <noui.h>
#include <stacktraces.h>
#include <ui_interface.h>
#include <uint256.h>
#include <util/system.h>
#include <util/threadnames.h>

View File

@ -36,9 +36,9 @@
#include <interfaces/coinjoin.h>
#include <interfaces/handler.h>
#include <interfaces/node.h>
#include <node/ui_interface.h>
#include <qt/governancelist.h>
#include <qt/masternodelist.h>
#include <ui_interface.h>
#include <util/system.h>
#include <util/translation.h>

View File

@ -22,7 +22,6 @@
#include <protocol.h>
#include <script/script.h>
#include <script/standard.h>
#include <ui_interface.h>
#include <util/system.h>
#include <cmath>

View File

@ -16,9 +16,9 @@
#include <chainparams.h>
#include <clientversion.h>
#include <interfaces/node.h>
#include <policy/policy.h>
#include <key_io.h>
#include <ui_interface.h>
#include <node/ui_interface.h>
#include <policy/policy.h>
#include <util/system.h>
#include <cstdlib>

View File

@ -21,9 +21,9 @@
#include <chainparams.h>
#include <interfaces/node.h>
#include <key_io.h>
#include <node/ui_interface.h>
#include <policy/fees.h>
#include <txmempool.h>
#include <ui_interface.h>
#include <wallet/coincontrol.h>
#include <wallet/fees.h>
#include <wallet/wallet.h>

View File

@ -18,7 +18,6 @@
#include <qt/guiutil.h>
#include <qt/networkstyle.h>
#include <qt/walletmodel.h>
#include <ui_interface.h>
#include <util/system.h>
#include <util/translation.h>

View File

@ -17,7 +17,7 @@
#include <qt/walletmodel.h>
#include <interfaces/node.h>
#include <ui_interface.h>
#include <node/ui_interface.h>
#include <QCalendarWidget>
#include <QComboBox>

View File

@ -21,8 +21,8 @@
#include <interfaces/handler.h>
#include <interfaces/node.h>
#include <key_io.h>
#include <node/ui_interface.h>
#include <psbt.h>
#include <ui_interface.h>
#include <util/system.h> // for GetBoolArg
#include <util/translation.h>
#include <wallet/coincontrol.h>

View File

@ -22,8 +22,8 @@
#include <qt/walletmodel.h>
#include <interfaces/node.h>
#include <node/ui_interface.h>
#include <psbt.h>
#include <ui_interface.h>
#include <util/strencodings.h>
#include <QAction>

View File

@ -6,7 +6,7 @@
#include <shutdown.h>
#include <logging.h>
#include <ui_interface.h>
#include <node/ui_interface.h>
#include <warnings.h>
#include <config/bitcoin-config.h>

View File

@ -9,8 +9,8 @@
#include <timedata.h>
#include <netaddress.h>
#include <node/ui_interface.h>
#include <sync.h>
#include <ui_interface.h>
#include <util/system.h>
#include <util/translation.h>
#include <warnings.h>

View File

@ -5,12 +5,12 @@
#include <txdb.h>
#include <node/ui_interface.h>
#include <pow.h>
#include <random.h>
#include <shutdown.h>
#include <uint256.h>
#include <util/system.h>
#include <ui_interface.h>
#include <util/translation.h>
#include <util/vector.h>

15
src/util/ui_change_type.h Normal file
View File

@ -0,0 +1,15 @@
// Copyright (c) 2012-2020 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_UTIL_UI_CHANGE_TYPE_H
#define BITCOIN_UTIL_UI_CHANGE_TYPE_H
/** General change type (added, updated, removed). */
enum ChangeType {
CT_NEW,
CT_UPDATED,
CT_DELETED
};
#endif // BITCOIN_UTIL_UI_CHANGE_TYPE_H

View File

@ -24,6 +24,7 @@
#include <logging/timer.h>
#include <node/blockstorage.h>
#include <node/coinstats.h>
#include <node/ui_interface.h>
#include <policy/policy.h>
#include <policy/settings.h>
#include <pow.h>
@ -39,7 +40,6 @@
#include <tinyformat.h>
#include <txdb.h>
#include <txmempool.h>
#include <ui_interface.h>
#include <uint256.h>
#include <undo.h>
#include <util/check.h> // For NDEBUG compile time check

View File

@ -9,8 +9,8 @@
#include <interfaces/wallet.h>
#include <net.h>
#include <node/context.h>
#include <node/ui_interface.h>
#include <univalue.h>
#include <ui_interface.h>
#include <util/check.h>
#include <util/error.h>
#include <util/system.h>

View File

@ -15,10 +15,10 @@
#include <script/standard.h>
#include <support/allocators/secure.h>
#include <sync.h>
#include <ui_interface.h>
#include <uint256.h>
#include <util/check.h>
#include <util/system.h>
#include <util/ui_change_type.h>
#include <validation.h>
#include <wallet/context.h>
#include <wallet/fees.h>

View File

@ -16,11 +16,11 @@
#include <psbt.h>
#include <saltedhasher.h>
#include <tinyformat.h>
#include <ui_interface.h>
#include <util/message.h>
#include <util/string.h>
#include <util/system.h>
#include <util/strencodings.h>
#include <util/ui_change_type.h>
#include <validationinterface.h>
#include <wallet/coincontrol.h>
#include <wallet/crypter.h>