Skip to content

Commit

Permalink
Squashed 'libbitcoinkernel-sys/bitcoin/' changes from 8777c555fc..d8b…
Browse files Browse the repository at this point in the history
…6e67b2a

d8b6e67b2a kernel: Add check if the chainstate maanger is busy loading blocks
f12a131af8 kernel: Process transactions
75d48e6718 kernel: Add optional mempool
889632bb70 kernel: Add support for handling transactions
476c754f3b kernel: Add check for when a block has been mutated.
ebef1b465b kernel: Add support for handling block headers
a56c79a2b5 kernel: Add utxo set iteration and value retrieval
33c71843e3 kernel: Add pure kernel bitcoin-chainstate
ccb2bb59f9 kernel: Add block index utility functions to C header
c953e1f530 kernel: Add function to read block undo data from disk to C header
55673f7f70 kernel: Add functions to read block from disk to C header
348e1c0a22 kernel: Add function for copying  block data to C header
4c71ffbef6 kernel: Add functions for the block validation state to C header
160343c9c2 kernel: Add validation interface and task runner to C header
55a60d8c3f kernel: Add interrupt function to C header
0d59e95b82 kernel: Add import blocks function to C header
804e064ff6 kernel: Add chainstate load options for in-memory dbs in C header
1c829ce9f4 kernel: Add options for reindexing in C header
c8a2917004 kernel: Add block validation to C header
8015b8374c Kernel: Add chainstate loading to kernel C header
b3c8467b62 kernel: Add chainstate manager object to C header
07c55185c2 kernel: Add notifications context option to C header
71c45c0680 kerenl: Add chain params context option to C header
d2ad67bd5f kernel: Add kernel library context object
1c6716c609 kernel: Add logging to kernel library C header
63a83b8dad kernel: Introduce initial kernel C header API
REVERT: 8777c555fc kernel: Add pure kernel bitcoin-chainstate
REVERT: fcc69abdb9 kernel: Add block index utility functions to C header
REVERT: 266d21c9c6 kernel: Add function to read block undo data from disk to C header
REVERT: 62b2926c0a kernel: Add functions to read block from disk to C header
REVERT: 440d7a7a86 kernel: Add function for copying  block data to C header
REVERT: 8827ebd5ea kernel: Add functions for the block validation state to C header
REVERT: 1ad10251b4 kernel: Add validation interface and task runner to C header
REVERT: b96eb0c49c kernel: Add interrupt function to C header
REVERT: d96ffb9165 kernel: Add import blocks function to C header
REVERT: 28dc294a13 kernel: Add chainstate load options for in-memory dbs in C header
REVERT: 7de1202a01 kernel: Add options for reindexing in C header
REVERT: 2e28c5516d kernel: Add block validation to C header
REVERT: f511ce1489 Kernel: Add chainstate loading to kernel C header
REVERT: 7ed0a89a3e kernel: Add chainstate manager object to C header
REVERT: 3fb9cec5d4 kernel: Add notifications context option to C header
REVERT: d71bbbab94 kerenl: Add chain params context option to C header
REVERT: 7cfc892152 kernel: Add kernel library context object
REVERT: ba01b6bd0e kernel: Add logging to kernel library C header
REVERT: 17b98b95eb kernel: Introduce initial kernel C header API
REVERT: 0c4ff18ee9 Merge bitcoin/bitcoin#30896: kernel: Move background load thread to node context
REVERT: 87d54500bf Merge bitcoin/bitcoin#30892: test: Check already deactivated network stays suspended after dumptxoutset
REVERT: 71af7435ef Merge bitcoin/bitcoin#30233: refactor: move m_is_inbound out of CNodeState
REVERT: 1d5b2406bb Merge bitcoin/bitcoin#30877: code style: update .editorconfig file
REVERT: fea550b480 Merge bitcoin/bitcoin#30890: doc: unit test runner help fixup and improvements
REVERT: 95560616fb code style: update .editorconfig file
REVERT: 282f0e9255 Unit test runner documentation fix and improvements
REVERT: 06a9f7789e Merge bitcoin/bitcoin#30433: build: add `standard branch-protection` to hardening flags for aarch64-linux
REVERT: bc7900f33d kernel: Move background load thread to node context
REVERT: e43ce250c6 Merge bitcoin-core/gui#835: Fix crash when closing wallet
REVERT: 001b1cf010 build: use standard branch-protection for aarch64-linux
REVERT: a965f2bc07 gui: fix crash when closing wallet
REVERT: 72c9a1fe94 test: Check that network stays suspended after dumptxoutset if it was off before
REVERT: cf0120ff02 Merge bitcoin/bitcoin#30880: test: Wait for local services to update in feature_assumeutxo
REVERT: e46bebb444 Merge bitcoin/bitcoin#30546: util: Use consteval checked format string in FatalErrorf, LogConnectFailure
REVERT: be768dbd18 Merge bitcoin/bitcoin#30618: test: support std::optional in BOOST_CHECK_* and increase FromUserHex fuzz feature coverage
REVERT: 07c7c96022 Merge bitcoin/bitcoin#30883: build: Revert "Minimize I/O operations in `GenerateHeaderFrom{Json,Raw}.cmake`"
REVERT: 24817e8b15 Merge bitcoin/bitcoin#30814: kernel: Create usable static kernel library
REVERT: fdeb717e78 Revert "build: Minimize I/O operations in `GenerateHeaderFrom{Json,Raw}.cmake`"
REVERT: 07f4cebe57 refactor: move m_is_inbound out of CNodeState
REVERT: 19f4a7c95a test: Wait for local services to update in feature_assumeutxo
REVERT: 7d43bca052 Merge bitcoin/bitcoin#30872: test: fix exclude parsing for functional runner
REVERT: cf786eccd7 Merge bitcoin/bitcoin#30865: build: Skip secp256k1 ctime tests when tests are not being built
REVERT: 23eedc5d1e build: Skip secp256k1 ctime tests when tests are not being built
REVERT: fa5bc450d5 util: Use compile-time check for LogConnectFailure
REVERT: fa7087b896 util: Use compile-time check for FatalErrorf
REVERT: faa62c0112 util: Add ConstevalFormatString
REVERT: 72b46f28bf test: fix exclude parsing for functional runner
REVERT: a5e99669cc Merge bitcoin/bitcoin#30733: test: remove unused src_dir param from run_tests after CMake migration
REVERT: 0c1e507278 Merge bitcoin/bitcoin#30871: build: Add more cmake presets
REVERT: fcb61bbc8d Merge bitcoin/bitcoin#27038: security-check: test for `_FORTIFY_SOURCE` usage in release binaries
REVERT: 85833cf05f Merge bitcoin/bitcoin#30847: test: Drop no longer needed workarounds
REVERT: 11e2f9fff4 Merge bitcoin/bitcoin#30835: build: Introduce "Kernel" installation component
REVERT: db8350b0e3 Merge bitcoin/bitcoin#30803: build: Minor build system fixes and amendments
REVERT: a86e7a476d Merge bitcoin/bitcoin#30838: build: Use CMake's default permissions in macOS `deploy` target
REVERT: f0eb63399a Merge bitcoin/bitcoin#30841: ci: Post CMake-migration fixes and amendments
REVERT: 155963768a Merge bitcoin/bitcoin#30842: build: Minimize I/O operations in `GenerateHeaderFrom{Json,Raw}.cmake`
REVERT: c773618886 Merge bitcoin/bitcoin#30867: build: Fix `ENABLE_WALLET` option
REVERT: 349632e022 Merge bitcoin/bitcoin#30807: Fix peers abruptly disconnecting from AssumeUTXO nodes during IBD
REVERT: f6298a878f Merge bitcoin/bitcoin#30840: docs: Updated debug build instructions for cmake
REVERT: a8809aeb6e Merge bitcoin/bitcoin#30870: docs: updated developer notes for --with-sanitizers to -DSANITIZERS
REVERT: f15e817811 build: add more CMake presets (dev-mode, libfuzzer, libfuzzer-nosan)
REVERT: fae7b83eb5 lint: Remove forbidden functions from lint-format-strings.py
REVERT: 4b1ce3cac8 docs: updated developer notes for --with-sanitizers to -DSANITIZERS and removed resource for -fsanitze flags
REVERT: 1eac96a503 Compare FromUserHex result against other hex validators and parsers
REVERT: 19947863e1 Use BOOST_CHECK_EQUAL for optional, arith_uint256, uint256, uint160
REVERT: 0725a37494 Merge bitcoin/bitcoin#30805: test: Add explicit onion bind to p2p_permissions
REVERT: 0037d53d1a build: Fix `ENABLE_WALLET` option
REVERT: 992f83bb6f test: add coverage for assumeUTXO honest peers disconnection
REVERT: 6d5812e5c8 assumeUTXO: fix peers disconnection during sync
REVERT: 082779d606 test: Add explicit onion bind to p2p_permissions
REVERT: c66c68345e Merge bitcoin/bitcoin#30773: Remove unsafe uint256S() and test-only uint160S()
REVERT: 2756797eca Merge bitcoin/bitcoin#30065: init: fixes file descriptor accounting
REVERT: 5ba03e7d35 build: Use CMake's default permissions in macOS `deploy` target
REVERT: e4fb97a512 Merge bitcoin/bitcoin#30791: build: Use correct variable name
REVERT: df3f63ccfa Merge bitcoin/bitcoin#30509: multiprocess: Add -ipcbind option to bitcoin-node
REVERT: 743ac30e34 Add std::optional support to Boost's equality check
REVERT: 712a2b5453 Merge bitcoin/bitcoin#30817: test: Add coverage for dumptxoutset failure robustness
REVERT: fb52023ee6 Merge bitcoin/bitcoin#30684: init: fix init fatal error on invalid negated option value
REVERT: 746f88000e Merge bitcoin/bitcoin#30401: fix: increase consistency of rpcauth parsing
REVERT: 2d68c3b1c2 build: Use correct variables when passing `-fsanitize` to libsecp256k1
REVERT: df86a4f333 Merge bitcoin/bitcoin#30845: Update libsecp256k1 subtree to latest master
REVERT: be4f78275f contrib: test for FORTIFY_SOURCE in security-check.py
REVERT: 94bc3c4cc0 Merge bitcoin/bitcoin#30824: cmake: decouple `FORTIFY_SOURCE` check from `Debug` build type
REVERT: ba84c2774d Merge bitcoin/bitcoin#30823: cmake: add `USE_SOURCE_PERMISSIONS` to all `configure_file()` usage
REVERT: da3f4cb8ee Merge bitcoin/bitcoin#30850: doc: fix minor typo
REVERT: 7a669fde18 docs: Fix minor typo
REVERT: 1cc93fe7b4 build: Delete dead code that implements `IF_CHECK_FAILED` option
REVERT: 0b003e1ff7 docs: Updated debug build instructions for cmake
REVERT: 341ad23809 build: Delete MSVC special case for `BUILD_FOR_FUZZING` option
REVERT: 5c80192ff6 test: Drop no longer needed workarounds
REVERT: ff54395de4 Update secp256k1 subtree to latest master
REVERT: 611562806c Squashed 'src/secp256k1/' changes from 642c885b61..2f2ccc4695
REVERT: b07fe666f2 build: Minimize I/O operations in `GenerateHeaderFrom{Json,Raw}.cmake`
REVERT: c45186ca54 ci: Switch from `make` to `cmake --build`
REVERT: 6e5f33af58 ci: Handle log files regardless of CMake's version
REVERT: fdad128b52 build: Stop enabling CMake's CMP0141 policy
REVERT: b2a6f545b4 doc: Drop `ctest` command from Windows cross-compiling instructions
REVERT: 73b618582d build: Print `CMAKE_CXX_COMPILER_ARG1` in summary
REVERT: f03c942095 build, test: Add missed log options
REVERT: 6f2cb0eafd doc: Amend comment about ZeroMQ config files
REVERT: 0dd16d7118 build: Add a pkg-config file for libbitcoinkernel
REVERT: 45be32f838 build: Produce a usable static kernel library
REVERT: 43cd83b0c7 test: move uint256_tests/operator_with_self to arith_uint256_tests
REVERT: c6c994cb2b test: remove test-only uint160S
REVERT: 62cc4656e2 test: remove test-only uint256S
REVERT: adc00ad728 test: remove test-only arith_uint256S
REVERT: a5fa90706a Merge bitcoin/bitcoin#30834: test: Work around boost compilation error
REVERT: 7b04fabe2d build: Introduce "Kernel" installation component
REVERT: fa9d7d5d20 test: Work around boost compilation error
REVERT: fa3ecdf778 Revert "build: work around issue with Boost <= 1.80 and Clang >= 18"
REVERT: 30073e6b3a multiprocess: Add -ipcbind option to bitcoin-node
REVERT: bbf95c0cc5 Merge bitcoin/bitcoin#30755: ci: Add missed configuration options to "Win64 native" job
REVERT: 73fe7d7230 multiprocess: Add unit tests for connect, serve, and listen functions
REVERT: 955d4077aa multiprocess: Add IPC connectAddress and listenAddress methods
REVERT: 4da20434d4 depends: Update libmultiprocess library for CustomMessage function and ThreadContext bugfix
REVERT: ee22bf55e3 doc: Update and amend MSVC build guide
REVERT: c07fdd6546 fuzz: Don't compile BDB-specific code on MSVC in `wallet_bdb_parser.cpp`
REVERT: e07a3ede52 ci: Add missed configuration options to "Win64 native" job
REVERT: 1f054eca4e cmake: add USE_SOURCE_PERMISSIONS to all configure_file usage
REVERT: 0e5cd608da Merge bitcoin/bitcoin#30415: contrib: fix check-deps.sh to check for weak symbols
REVERT: 118b55c462 Merge bitcoin/bitcoin#30790: bench: Remove redundant logging benchmarks
REVERT: c0cbe26a86 Merge bitcoin/bitcoin#30748: test: Pin and document TEST_DIR_PATH_ELEMENT, SeedRand::FIXED_SEED
REVERT: c3af4b1ec3 Merge bitcoin/bitcoin#30822: cmake: scope Boost Test check to `vcpkg`
REVERT: 7f472e9bcd Merge bitcoin/bitcoin#30821: build: work around issue with Boost <= 1.80 and Clang >= 18
REVERT: d4c7c4009d init: error out if -maxconnections is negative
REVERT: c773649481 init: improves file descriptors accounting and docs
REVERT: 29008a7ff4 init: fixes fd accounting regarding poll/select
REVERT: 30803a35d5 cmake: decouple FORTIFY_SOURCE check from Debug build type
REVERT: a7a4e11db8 cmake: scope Boost Test check to vcpkg
REVERT: d661e2b1b7 Merge bitcoin/bitcoin#30812: lint: Check for release note snippets in the wrong folder
REVERT: cd062d6684 build: work around issue with Boost <= 1.80 and Clang >= 18
REVERT: d6a1b94ffd Merge bitcoin-core/gui#834: qt, build: remove unneeded `Q_IMPORT_PLUGIN` macro calls
REVERT: 6852d1d487 Merge bitcoin/bitcoin#30796: test: Use std::span and std::string_view for raw data
REVERT: fa3a7ebe5b lint: Check for release note snippets in the wrong folder
REVERT: fa05ee0517 Merge bitcoin/bitcoin#30772: build: Fix / improve coverage scripts
REVERT: 79772cd26e Merge bitcoin/bitcoin#30743: depends: build libevent with `-D_GNU_SOURCE`
REVERT: faecca9a85 test: Use span for raw data
REVERT: c2b779da4e refactor: Manage dumptxoutset RAII classes with std::optional
REVERT: 4b5bf335ad test: Add coverage for failing dumptxoutset behavior
REVERT: f794a0d5f4 Merge bitcoin/bitcoin#30819: doc: fix assumeutxo design doc link
REVERT: fadbcd51fc bench: Remove redundant logging benchmarks
REVERT: fa8dd952e2 bench: Use LogInfo instead of the deprecated alias LogPrintf
REVERT: e5f7272ad3 doc: fix assumeutxo design doc link
REVERT: 93e48240bf Merge bitcoin/bitcoin#30244: ci: parse TEST_RUNNER_EXTRA into an array
REVERT: f640b323bd Merge bitcoin/bitcoin#30723: lint: Speed up and fix flake8 checks
REVERT: 3ae35b427f ci: run check-deps.sh as part of clang-tidy job
REVERT: 0aaa1298a0 contrib: fix check-deps.sh when libraries do not import symbols
REVERT: 3c99f5a38a contrib: fix check-deps.sh to check for weak symbols
REVERT: 86c80e9cf2 contrib: make check-deps.sh script work with cmake
REVERT: 5373aa30e2 Merge bitcoin/bitcoin#30788: test: fixing failing system_tests/run_command under some Locales
REVERT: 3210d87dfc Merge bitcoin/bitcoin#29043: fuzz: make FuzzedDataProvider usage deterministic
REVERT: 81276540d3 Merge bitcoin/bitcoin#30148: cli: restrict multiple exclusive argument usage in bitcoin-cli
REVERT: 210210c923 Merge bitcoin/bitcoin#29566: test: update satoshi_round function
REVERT: b0c3de6847 Merge bitcoin/bitcoin#28417: contrib/signet/miner updates
REVERT: cb65ac469a Merge bitcoin/bitcoin#29605: net: Favor peers from addrman over fetching seednodes
REVERT: b8d2f58e06 Merge bitcoin/bitcoin#30808: rpc: dumptxoutset height parameter follow-ups (29553)
REVERT: f51b237723 refactor: rpc: use uint256::FromHex for ParseHashV
REVERT: d9fcbfc372 build: Add `JOBS` variable support to `CoverageFuzz.cmake` script
REVERT: e7cf4a6f27 build: Add missed `-g` for "Coverage" build configuration
REVERT: fe2003ab12 build: Add `COMMAND_ERROR_IS_FATAL` to every process in coverage scrips
REVERT: a3108a7c56 rpc: Manage dumptxoutset rollback with RAII class
REVERT: c5eaae3b89 doc: Add -rpcclienttimeout=0 to loadtxoutset examples
REVERT: 598b9bba5a rpc: Don't re-enable previously disabled network after dumptxoutset
REVERT: ae48a22a3d test: fixing failing system_tests/run_command under some Locales
REVERT: fac973647d test: Use string_view for json_tests
REVERT: 5567754087 depends: build libevent with -D_GNU_SOURCE
REVERT: 7346b01092 qt, build: remove unneeded `Q_IMPORT_PLUGIN` macro calls
REVERT: fa84f9decd test: Pin and document TEST_DIR_PATH_ELEMENT
REVERT: 2ad560139b Remove unused src_dir param from run_tests
REVERT: 2222f7a874 test: Rename SeedRand::SEED to FIXED_SEED for clarity
REVERT: fafdb7df34 lint: Speed up flake8 checks
REVERT: faf17df7fb lint: Document missing py_lint dependency
REVERT: faebeb828f lint: Remove python whitespace and shadowing lint rules
REVERT: 7777047835 lint: Remove python lint rules that are SyntaxError
REVERT: faaf3e53f0 test: [refactor] Fix F841 flake8
REVERT: 444421db69 test: [refactor] Fix E714 pycodestyle
REVERT: ee47ca29d6 init: fix fatal error on '-wallet' negated option value
REVERT: 27c976d11a fix: increase consistency of rpcauth parsing
REVERT: 2ad3689512 test: add norpcauth test
REVERT: 67df0dec1a test: blank rpcauth CLI interaction
REVERT: fb6d51eb25 signet/miner: Use argparse exclusive groups
REVERT: ec317bc44b test: update satoshi_round function
REVERT: ecc98ccff2 test: add cases for blank rpcauth
REVERT: c8e6771af0 test: restrict multiple CLI arguments
REVERT: 8838c4f171 common/args.h: automate check for multiple cli commands
REVERT: 6eeb188d40 test: adds seednode functional tests
REVERT: 3270f0adad net: Favor peers from addrman over fetching seednodes
REVERT: 8131bf7483 ci: parse TEST_RUNNER_EXTRA into an array
REVERT: c4762b0aa0 test: allow excluding func test by name and arg
REVERT: 338a266a9a signet/miner: add support for a poolnum/poolid tag in mined blocks
REVERT: 409ab7d35b signet/miner: add Generate.mine function
REVERT: 7b31332370 signet/miner: add Generate.gbt function
REVERT: 85c5c0bea9 signet/miner: add Generate.next_block_time function
REVERT: 5540e6ca49 signet/miner: move next_block_* functions into new Generator class
REVERT: 35f4631196 signet/miner: rename do_decode_psbt to decode_psbt
REVERT: aac040b439 signet/miner: drop create_coinbase function
REVERT: 16951f549e signet/miner: drop do_createpsbt function
REVERT: 3aed0a4284 signet/miner: drop get_reward_address function
REVERT: 01960c53c7 fuzz: make FuzzedDataProvider usage deterministic

git-subtree-dir: libbitcoinkernel-sys/bitcoin
git-subtree-split: d8b6e67b2a12332f188320e90262e2d741e27f7b
  • Loading branch information
TheCharlatan committed Sep 16, 2024
1 parent 3bc8463 commit 6928295
Show file tree
Hide file tree
Showing 164 changed files with 1,975 additions and 2,044 deletions.
12 changes: 6 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ insert_final_newline = true
trim_trailing_whitespace = true

# Source code files
[*.{h,cpp,rs,py,sh}]
[*.{h,cpp,py,sh}]
indent_size = 4

# .cirrus.yml, etc.
# .cirrus.yml, .fuzzbuzz.yml, etc.
[*.yml]
indent_size = 2

# Makefiles (only relevant for depends build)
[Makefile]
# Makefiles
[{*.am,Makefile.*.include}]
indent_style = tab

# CMake files
[{CMakeLists.txt,*.cmake,*.cmake.in}]
# Autoconf scripts
[configure.ac]
indent_size = 2
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:

- name: Generate build system
run: |
cmake -B build --preset vs2022-static -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DBUILD_GUI=ON -DWITH_BDB=ON -DWITH_MINIUPNPC=ON -DWITH_ZMQ=ON -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWERROR=ON
cmake -B build --preset vs2022-static -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWERROR=ON
- name: Save vcpkg binary cache
uses: actions/cache/save@v4
Expand Down
45 changes: 22 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
# Centos Stream 9, https://www.centos.org/cl-vs-cs/#end-of-life, EOL in May 2027:
# - CMake 3.26.5, https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/
cmake_minimum_required(VERSION 3.22)
if(POLICY CMP0141)
# MSVC debug information format flags are selected by an abstraction.
# We want to use the CMAKE_MSVC_DEBUG_INFORMATION_FORMAT variable
# to select the MSVC debug information format.
cmake_policy(SET CMP0141 NEW)
endif()

if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "In-source builds are not allowed.")
Expand Down Expand Up @@ -98,12 +104,14 @@ if(WITH_SQLITE)
find_package(SQLite3 3.7.17 REQUIRED)
endif()
set(USE_SQLITE ON)
set(ENABLE_WALLET ON)
endif()
option(WITH_BDB "Enable Berkeley DB (BDB) wallet support." OFF)
cmake_dependent_option(WARN_INCOMPATIBLE_BDB "Warn when using a Berkeley DB (BDB) version other than 4.8." ON "WITH_BDB" OFF)
if(WITH_BDB)
find_package(BerkeleyDB 4.8 MODULE REQUIRED)
set(USE_BDB ON)
set(ENABLE_WALLET ON)
if(NOT BerkeleyDB_VERSION VERSION_EQUAL 4.8)
message(WARNING "Found Berkeley DB (BDB) other than 4.8.\n"
"BDB (legacy) wallets opened by this build will not be portable!"
Expand Down Expand Up @@ -138,9 +146,7 @@ if(WITH_ZMQ)
find_package(ZeroMQ CONFIG REQUIRED)
else()
# The ZeroMQ project has provided config files since v4.2.2.
# However, mainstream distributions do not yet provide CMake
# config files for ZeroMQ packages. If they do in the future,
# find_package(ZeroMQ) may be used instead.
# TODO: Switch to find_package(ZeroMQ) at some point in the future.
find_package(PkgConfig REQUIRED)
pkg_check_modules(libzmq REQUIRED IMPORTED_TARGET libzmq>=4)
endif()
Expand Down Expand Up @@ -191,7 +197,7 @@ endif()

option(BUILD_BENCH "Build bench_bitcoin executable." OFF)
option(BUILD_FUZZ_BINARY "Build fuzz binary." OFF)
option(BUILD_FOR_FUZZING "Build for fuzzing. Enabling this will disable all other targets and override BUILD_FUZZ_BINARY." OFF)
cmake_dependent_option(BUILD_FOR_FUZZING "Build for fuzzing. Enabling this will disable all other targets and override BUILD_FUZZ_BINARY." OFF "NOT MSVC" OFF)

option(INSTALL_MAN "Install man pages." ON)

Expand Down Expand Up @@ -454,10 +460,10 @@ else()
)
endif()

configure_file(cmake/script/Coverage.cmake Coverage.cmake USE_SOURCE_PERMISSIONS COPYONLY)
configure_file(cmake/script/CoverageFuzz.cmake CoverageFuzz.cmake USE_SOURCE_PERMISSIONS COPYONLY)
configure_file(cmake/script/CoverageInclude.cmake.in CoverageInclude.cmake USE_SOURCE_PERMISSIONS @ONLY)
configure_file(contrib/filter-lcov.py filter-lcov.py USE_SOURCE_PERMISSIONS COPYONLY)
configure_file(cmake/script/Coverage.cmake Coverage.cmake COPYONLY)
configure_file(cmake/script/CoverageFuzz.cmake CoverageFuzz.cmake COPYONLY)
configure_file(cmake/script/CoverageInclude.cmake.in CoverageInclude.cmake @ONLY)
configure_file(contrib/filter-lcov.py filter-lcov.py COPYONLY)

# Don't allow extended (non-ASCII) symbols in identifiers. This is easier for code review.
try_append_cxx_flags("-fno-extended-identifiers" TARGET core_interface SKIP_LINK)
Expand All @@ -476,21 +482,18 @@ if(ENABLE_HARDENING)
try_append_linker_flag("/HIGHENTROPYVA" TARGET hardening_interface)
try_append_linker_flag("/NXCOMPAT" TARGET hardening_interface)
else()

# _FORTIFY_SOURCE requires that there is some level of optimization,
# otherwise it does nothing and just creates a compiler warning.
try_append_cxx_flags("-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3"
RESULT_VAR cxx_supports_fortify_source
SOURCE "int main() {
# if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0
#error
#endif
}"
)
if(cxx_supports_fortify_source)
# When the build configuration is Debug, all optimizations are disabled.
# However, _FORTIFY_SOURCE requires that there is some level of optimization,
# otherwise it does nothing and just creates a compiler warning.
# Since _FORTIFY_SOURCE is a no-op without optimizations, do not enable it
# when the build configuration is Debug.
target_compile_options(hardening_interface INTERFACE
-U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=3
$<$<NOT:$<CONFIG:Debug>>:-U_FORTIFY_SOURCE>
$<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=3>
)
endif()
unset(cxx_supports_fortify_source)
Expand All @@ -508,11 +511,7 @@ if(ENABLE_HARDENING)
endif()

if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
try_append_cxx_flags("-mbranch-protection=bti" TARGET hardening_interface SKIP_LINK)
else()
try_append_cxx_flags("-mbranch-protection=standard" TARGET hardening_interface SKIP_LINK)
endif()
try_append_cxx_flags("-mbranch-protection=bti" TARGET hardening_interface SKIP_LINK)
endif()

try_append_linker_flag("-Wl,--enable-reloc-section" TARGET hardening_interface)
Expand Down
63 changes: 4 additions & 59 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows",
"BUILD_GUI": "ON",
"WITH_QRENCODE": "OFF"
"WITH_QRENCODE": "OFF",
"WITH_NATPMP": "OFF"
}
},
{
Expand All @@ -33,64 +34,8 @@
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows-static",
"BUILD_GUI": "ON",
"WITH_QRENCODE": "OFF"
}
},
{
"name": "libfuzzer",
"displayName": "Build for fuzzing with libfuzzer, and sanitizers enabled",
"binaryDir": "${sourceDir}/build_fuzz",
"cacheVariables": {
"BUILD_FOR_FUZZING": "ON",
"CMAKE_C_COMPILER": "clang",
"CMAKE_C_FLAGS": "-ftrivial-auto-var-init=pattern",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_CXX_FLAGS": "-ftrivial-auto-var-init=pattern",
"SANITIZERS": "undefined,address,fuzzer"
}
},
{
"name": "libfuzzer-nosan",
"displayName": "Build for fuzzing with libfuzzer, and sanitizers disabled",
"binaryDir": "${sourceDir}/build_fuzz_nosan",
"cacheVariables": {
"BUILD_FOR_FUZZING": "ON",
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"SANITIZERS": "fuzzer"
}
},
{
"name": "dev-mode",
"displayName": "Developer mode, with all features/dependencies enabled",
"binaryDir": "${sourceDir}/build_dev_mode",
"cacheVariables": {
"BUILD_BENCH": "ON",
"BUILD_CLI": "ON",
"BUILD_DAEMON": "ON",
"BUILD_FUZZ_BINARY": "ON",
"BUILD_GUI": "ON",
"BUILD_GUI_TESTS": "ON",
"BUILD_KERNEL_LIB": "ON",
"BUILD_SHARED_LIBS": "ON",
"BUILD_TESTING": "ON",
"BUILD_TESTS": "ON",
"BUILD_TX": "ON",
"BUILD_UTIL": "ON",
"BUILD_UTIL_CHAINSTATE": "ON",
"BUILD_WALLET_TOOL": "ON",
"ENABLE_EXTERNAL_SIGNER": "ON",
"ENABLE_HARDENING": "ON",
"ENABLE_WALLET": "ON",
"WARN_INCOMPATIBLE_BDB": "OFF",
"WITH_BDB": "ON",
"WITH_MINIUPNPC": "ON",
"WITH_MULTIPROCESS": "ON",
"WITH_NATPMP": "ON",
"WITH_QRENCODE": "ON",
"WITH_SQLITE": "ON",
"WITH_USDT": "ON",
"WITH_ZMQ": "ON"
"WITH_QRENCODE": "OFF",
"WITH_NATPMP": "OFF"
}
}
]
Expand Down
1 change: 1 addition & 0 deletions ci/lint/04_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ fi

${CI_RETRY_EXE} pip3 install \
codespell==2.2.6 \
flake8==6.1.0 \
lief==0.13.2 \
mypy==1.4.1 \
pyzmq==25.1.0 \
Expand Down
1 change: 0 additions & 1 deletion ci/test/00_setup_env_native_tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export NO_DEPENDS=1
export RUN_UNIT_TESTS=false
export RUN_FUNCTIONAL_TESTS=false
export RUN_FUZZ_TESTS=false
export RUN_CHECK_DEPS=true
export RUN_TIDY=true
export GOAL="install"
export BITCOIN_CONFIG="\
Expand Down
13 changes: 4 additions & 9 deletions ci/test/03_test_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ if [[ "${RUN_TIDY}" == "true" ]]; then
BITCOIN_CONFIG_ALL="$BITCOIN_CONFIG_ALL -DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
fi

bash -c "cmake -S $BASE_ROOT_DIR $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( (cat $(cmake -P "${BASE_ROOT_DIR}/ci/test/GetCMakeLogFiles.cmake")) && false)"
bash -c "cmake -S $BASE_ROOT_DIR $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( (cat CMakeFiles/CMakeOutput.log CMakeFiles/CMakeError.log) && false)"

bash -c "cmake --build . $MAKEJOBS --target all $GOAL" || ( echo "Build failure. Verbose build follows." && cmake --build . --target all "$GOAL" --verbose ; false )
bash -c "make $MAKEJOBS all $GOAL" || ( echo "Build failure. Verbose build follows." && make all "$GOAL" V=1 ; false )

bash -c "${PRINT_CCACHE_STATISTICS}"
du -sh "${DEPENDS_DIR}"/*/
Expand All @@ -137,10 +137,6 @@ if [ -n "$USE_VALGRIND" ]; then
"${BASE_ROOT_DIR}/ci/test/wrap-valgrind.sh"
fi

if [ "$RUN_CHECK_DEPS" = "true" ]; then
"${BASE_ROOT_DIR}/contrib/devtools/check-deps.sh" .
fi

if [ "$RUN_UNIT_TESTS" = "true" ]; then
DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" CTEST_OUTPUT_ON_FAILURE=ON ctest "${MAKEJOBS}"
fi
Expand All @@ -150,9 +146,8 @@ if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then
fi

if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then
# parses TEST_RUNNER_EXTRA as an array which allows for multiple arguments such as TEST_RUNNER_EXTRA='--exclude "rpc_bind.py --ipv6"'
eval "TEST_RUNNER_EXTRA=($TEST_RUNNER_EXTRA)"
LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" test/functional/test_runner.py --ci "${MAKEJOBS}" --tmpdirprefix "${BASE_SCRATCH_DIR}"/test_runner/ --ansi --combinedlogslen=99999999 --timeout-factor="${TEST_RUNNER_TIMEOUT_FACTOR}" "${TEST_RUNNER_EXTRA[@]}" --quiet --failfast
# shellcheck disable=SC2086
LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" test/functional/test_runner.py --ci "${MAKEJOBS}" --tmpdirprefix "${BASE_SCRATCH_DIR}"/test_runner/ --ansi --combinedlogslen=99999999 --timeout-factor="${TEST_RUNNER_TIMEOUT_FACTOR}" ${TEST_RUNNER_EXTRA} --quiet --failfast
fi

if [ "${RUN_TIDY}" = "true" ]; then
Expand Down
11 changes: 0 additions & 11 deletions ci/test/GetCMakeLogFiles.cmake

This file was deleted.

6 changes: 3 additions & 3 deletions cmake/module/AddBoostIfNeeded.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ function(add_boost_if_needed)
set(CMAKE_REQUIRED_DEFINITIONS)
endif()

# Some package managers, such as vcpkg, vendor Boost.Test separately
# from the rest of the headers, so we have to check for it individually.
if(BUILD_TESTS AND DEFINED VCPKG_TARGET_TRIPLET)
if(BUILD_TESTS)
# Some package managers, such as vcpkg, vendor Boost.Test separately
# from the rest of the headers, so we have to check for it individually.
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DBOOST_TEST_NO_MAIN)
include(CheckIncludeFileCXX)
check_include_file_cxx(boost/test/included/unit_test.hpp HAVE_BOOST_INCLUDED_UNIT_TEST_H)
Expand Down
3 changes: 1 addition & 2 deletions cmake/module/FlagsSummary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ function(print_flags_per_config config indent_num)
get_target_interface(definitions "${config}" core_interface COMPILE_DEFINITIONS)
indent_message("Preprocessor defined macros ..........." "${definitions}" ${indent_num})

string(STRIP "${CMAKE_CXX_COMPILER_ARG1} ${CMAKE_CXX_FLAGS}" combined_cxx_flags)
string(STRIP "${combined_cxx_flags} ${CMAKE_CXX_FLAGS_${config_uppercase}}" combined_cxx_flags)
string(STRIP "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${config_uppercase}}" combined_cxx_flags)
string(STRIP "${combined_cxx_flags} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}" combined_cxx_flags)
if(CMAKE_POSITION_INDEPENDENT_CODE)
string(JOIN " " combined_cxx_flags ${combined_cxx_flags} ${CMAKE_CXX_COMPILE_OPTIONS_PIC})
Expand Down
4 changes: 2 additions & 2 deletions cmake/module/GenerateHeaders.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ function(generate_header_from_json json_source_relpath)
)
endfunction()

function(generate_header_from_raw raw_source_relpath raw_namespace)
function(generate_header_from_raw raw_source_relpath)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${raw_source_relpath}.h
COMMAND ${CMAKE_COMMAND} -DRAW_SOURCE_PATH=${CMAKE_CURRENT_SOURCE_DIR}/${raw_source_relpath} -DHEADER_PATH=${CMAKE_CURRENT_BINARY_DIR}/${raw_source_relpath}.h -DRAW_NAMESPACE=${raw_namespace} -P ${PROJECT_SOURCE_DIR}/cmake/script/GenerateHeaderFromRaw.cmake
COMMAND ${CMAKE_COMMAND} -DRAW_SOURCE_PATH=${CMAKE_CURRENT_SOURCE_DIR}/${raw_source_relpath} -DHEADER_PATH=${CMAKE_CURRENT_BINARY_DIR}/${raw_source_relpath}.h -P ${PROJECT_SOURCE_DIR}/cmake/script/GenerateHeaderFromRaw.cmake
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${raw_source_relpath} ${PROJECT_SOURCE_DIR}/cmake/script/GenerateHeaderFromRaw.cmake
VERBATIM
)
Expand Down
2 changes: 1 addition & 1 deletion cmake/module/GenerateSetupNsi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ function(generate_setup_nsi)
set(BITCOIN_WALLET_TOOL_NAME "bitcoin-wallet")
set(BITCOIN_TEST_NAME "test_bitcoin")
set(EXEEXT ${CMAKE_EXECUTABLE_SUFFIX})
configure_file(${PROJECT_SOURCE_DIR}/share/setup.nsi.in ${PROJECT_BINARY_DIR}/bitcoin-win64-setup.nsi USE_SOURCE_PERMISSIONS @ONLY)
configure_file(${PROJECT_SOURCE_DIR}/share/setup.nsi.in ${PROJECT_BINARY_DIR}/bitcoin-win64-setup.nsi @ONLY)
endfunction()
4 changes: 2 additions & 2 deletions cmake/module/Maintenance.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ function(add_macos_deploy_target)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND TARGET bitcoin-qt)
set(macos_app "Bitcoin-Qt.app")
# Populate Contents subdirectory.
configure_file(${PROJECT_SOURCE_DIR}/share/qt/Info.plist.in ${macos_app}/Contents/Info.plist NO_SOURCE_PERMISSIONS)
configure_file(${PROJECT_SOURCE_DIR}/share/qt/Info.plist.in ${macos_app}/Contents/Info.plist)
file(CONFIGURE OUTPUT ${macos_app}/Contents/PkgInfo CONTENT "APPL????")
# Populate Contents/Resources subdirectory.
file(CONFIGURE OUTPUT ${macos_app}/Contents/Resources/empty.lproj CONTENT "")
configure_file(${PROJECT_SOURCE_DIR}/src/qt/res/icons/bitcoin.icns ${macos_app}/Contents/Resources/bitcoin.icns NO_SOURCE_PERMISSIONS COPYONLY)
configure_file(${PROJECT_SOURCE_DIR}/src/qt/res/icons/bitcoin.icns ${macos_app}/Contents/Resources/bitcoin.icns COPYONLY)
file(CONFIGURE OUTPUT ${macos_app}/Contents/Resources/Base.lproj/InfoPlist.strings
CONTENT "{ CFBundleDisplayName = \"@PACKAGE_NAME@\"; CFBundleName = \"@PACKAGE_NAME@\"; }"
)
Expand Down
4 changes: 2 additions & 2 deletions cmake/module/ProcessConfigurations.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ else()
unset(cxx_flags_debug_overridden)
endif()

set(CMAKE_CXX_FLAGS_COVERAGE "-g -Og --coverage")
set(CMAKE_OBJCXX_FLAGS_COVERAGE "-g -Og --coverage")
set(CMAKE_CXX_FLAGS_COVERAGE "-Og --coverage")
set(CMAKE_OBJCXX_FLAGS_COVERAGE "-Og --coverage")
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage")
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage")
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
Expand Down
15 changes: 14 additions & 1 deletion cmake/module/TryAppendCXXFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ Usage examples:
)
try_append_cxx_flags("-Werror=return-type" TARGET core_interface
IF_CHECK_FAILED "-Wno-error=return-type"
SOURCE "#include <cassert>\nint f(){ assert(false); }"
)
In configuration output, this function prints a string by the following pattern:
-- Performing Test CXX_SUPPORTS_[flags]
Expand All @@ -43,7 +49,7 @@ function(try_append_cxx_flags flags)
TACXXF # prefix
"SKIP_LINK" # options
"TARGET;VAR;SOURCE;RESULT_VAR" # one_value_keywords
"IF_CHECK_PASSED" # multi_value_keywords
"IF_CHECK_PASSED;IF_CHECK_FAILED" # multi_value_keywords
)

set(flags_as_string "${flags}")
Expand Down Expand Up @@ -82,6 +88,13 @@ function(try_append_cxx_flags flags)
string(STRIP "${${TACXXF_VAR}} ${flags_as_string}" ${TACXXF_VAR})
endif()
endif()
elseif(DEFINED TACXXF_IF_CHECK_FAILED)
if(DEFINED TACXXF_TARGET)
target_compile_options(${TACXXF_TARGET} INTERFACE ${TACXXF_IF_CHECK_FAILED})
endif()
if(DEFINED TACXXF_VAR)
string(STRIP "${${TACXXF_VAR}} ${TACXXF_IF_CHECK_FAILED}" ${TACXXF_VAR})
endif()
endif()

if(DEFINED TACXXF_VAR)
Expand Down
Loading

0 comments on commit 6928295

Please sign in to comment.