Page MenuHomePhabricator

Add SQLiteDatabase and SQLiteBatch dummy classes
ClosedPublic

Authored by PiRK on Nov 25 2021, 12:35.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC67f1d3774676: Add SQLiteDatabase and SQLiteBatch dummy classes
Summary

This is a backport of core#19077 [3/26]
https://github.com/bitcoin/bitcoin/pull/19077/commits/7577b6e1c88a1a7b45ecf5c7f1735bae6f5a82bf

Depends on D10472

Note: I had to comment out m_mock to avoid triggering compiler warnings about unused variables.

Test Plan
cmake .. -GNinja -DCMAKE_C_COMPILER=clang-12 -DCMAKE_CXX_COMPILER=clang++-12 -DENABLE_CLANG_TIDY=ON
ninja

Event Timeline

PiRK requested review of this revision.Nov 25 2021, 12:35

Tail of the build log:

[344/511] Linking C static library src/secp256k1/libsecp256k1.a
[345/511] Building CXX object src/CMakeFiles/bitcoin-wallet.dir/bitcoin-wallet.cpp.o
[346/511] Linking CXX static library src/libbitcoinconsensus.a
[347/511] Linking C executable src/secp256k1/ecmult-bench
[348/511] Linking C executable src/secp256k1/internal-bench
[349/511] Linking C executable src/secp256k1/sign-bench
[350/511] Linking CXX static library src/libscript.a
[351/511] Linking C executable src/secp256k1/verify-bench
[352/511] Linking C executable src/secp256k1/recover-bench
[353/511] Installing component secp256k1
-- Install configuration: "Debug"
-- Install component: "secp256k1"
-- Installing: /results/artifacts/lib/libsecp256k1.a
-- Installing: /results/artifacts/include/secp256k1.h
-- Installing: /results/artifacts/include/secp256k1_preallocated.h
-- Installing: /results/artifacts/include/secp256k1_recovery.h
-- Installing: /results/artifacts/include/secp256k1_schnorr.h
[354/511] Linking CXX static library src/libcommon.a
[355/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[356/511] Linking CXX shared library src/libbitcoinconsensus.so.0.24.7
[357/511] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[358/511] Linking CXX executable src/bitcoin-cli
[359/511] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[360/511] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[361/511] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[362/511] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[363/511] Linking CXX executable src/bitcoin-tx
[364/511] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[365/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[366/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[367/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[368/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[369/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
FAILED: src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DABORT_ON_FAILED_ASSUME -DBOOST_AC_USE_STD_ATOMIC -DBOOST_SP_USE_STD_ATOMIC -DBUILD_BITCOIN_INTERNAL -DDEBUG -DDEBUG_LOCKORDER -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -isystem /usr/include/jemalloc -Werror -O0 -fPIC -fvisibility=hidden -g3 -ftrapv -fstack-reuse=none -fstack-protector-all -Wstack-protector -U_FORTIFY_SOURCE -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -pthread -std=gnu++17 -MD -MT src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o -MF src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o.d -o src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o -c ../../src/wallet/sqlite.cpp
In file included from ../../src/wallet/sqlite.cpp:5:
../../src/./wallet/sqlite.h:44:45: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
     [[maybe_unused]] const bool m_mock{false};
                                             ^
cc1plus: all warnings being treated as errors
[370/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[371/511] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[372/511] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[373/511] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[374/511] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[375/511] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[376/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[377/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[378/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[379/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/__/interfaces/wallet.cpp.o
[380/511] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[381/511] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[382/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[383/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[384/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[385/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcdump.cpp.o
[386/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[387/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-debug failed with exit code 1

Tail of the build log:

[344/511] Linking C executable src/secp256k1/ecmult-bench
[345/511] Linking C executable src/secp256k1/internal-bench
[346/511] Linking C executable src/secp256k1/sign-bench
[347/511] Linking C executable src/secp256k1/recover-bench
[348/511] Linking C executable src/secp256k1/verify-bench
[349/511] Installing component secp256k1
-- Install configuration: "RelWithDebInfo"
-- Install component: "secp256k1"
-- Installing: /results/artifacts/lib/libsecp256k1.a
-- Installing: /results/artifacts/include/secp256k1.h
-- Installing: /results/artifacts/include/secp256k1_preallocated.h
-- Installing: /results/artifacts/include/secp256k1_recovery.h
-- Installing: /results/artifacts/include/secp256k1_schnorr.h
[350/511] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[351/511] Building CXX object src/CMakeFiles/script.dir/script/descriptor.cpp.o
[352/511] Linking CXX static library src/libscript.a
[353/511] Building CXX object src/CMakeFiles/bitcoin-cli.dir/bitcoin-cli.cpp.o
[354/511] Linking CXX static library src/libcommon.a
[355/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[356/511] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[357/511] Linking CXX shared library src/libbitcoinconsensus.so.0.24.7
[358/511] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[359/511] Linking CXX executable src/bitcoin-cli
[360/511] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[361/511] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[362/511] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[363/511] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[364/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[365/511] Linking CXX executable src/bitcoin-tx
[366/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[367/511] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[368/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[369/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[370/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
FAILED: src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DBOOST_AC_USE_STD_ATOMIC -DBOOST_SP_USE_STD_ATOMIC -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -isystem /usr/include/jemalloc -Werror -g -O2 -fPIC -fvisibility=hidden -fstack-reuse=none -fstack-protector-all -Wstack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -pthread -std=gnu++17 -MD -MT src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o -MF src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o.d -o src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o -c ../../src/wallet/sqlite.cpp
In file included from ../../src/wallet/sqlite.cpp:5:
../../src/./wallet/sqlite.h:44:45: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
     [[maybe_unused]] const bool m_mock{false};
                                             ^
cc1plus: all warnings being treated as errors
[371/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[372/511] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[373/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[374/511] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[375/511] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[376/511] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[377/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[378/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[379/511] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[380/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[381/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/__/interfaces/wallet.cpp.o
[382/511] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[383/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[384/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[385/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcdump.cpp.o
[386/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[387/511] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1
PiRK planned changes to this revision.Nov 25 2021, 13:17
PiRK requested review of this revision.Nov 25 2021, 13:49

The error: ‘maybe_unused’ attribute ignored [-Werror=attributes] can be safely ignored. It will go away in later commit from the same PR.

PiRK planned changes to this revision.Nov 25 2021, 14:30

will try to find a solution to suppress the gcc error about [[maybe_unused]]

PiRK edited the summary of this revision. (Show Details)

comment out m_mock until it is used
With the original commit, clang warns about an unused variable. With [[maybe_unused]], some gcc versions warn about ignoring the tag.

This revision is now accepted and ready to land.Nov 26 2021, 13:13