-
Notifications
You must be signed in to change notification settings - Fork 37.4k
test: Update coverage.cpp to drop linux restriction #32059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32059. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
From the original PR it's not obvious how to use this, is there a tl&dr for what to test? |
Use this config: cmake -S . -B build -DCMAKE_C_COMPILER='clang' -DCMAKE_CXX_COMPILER='clang++' -DCMAKE_CXX_FLAGS='-fprofile-instr-generate -fcoverage-mapping' build as normal : cmake --build build Run tooling for util_string_tests: RUST_BACKTRACE=1 cargo run --manifest-path ./contrib/devtools/deterministic-unittest-coverage/Cargo.toml -- $PWD/build util_string_tests Should return : *** No errors detected
The coverage was deterministic across two runs. |
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
tACK |
611151e
to
7fd0437
Compare
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
No strong opinion, but it could make sense to reword the pull description. Otherwise, it is less clear what all the effects of this will be. Something like:
But anything is fine, Concept ACK. |
7fd0437
to
f53f540
Compare
I guess this can be used to test both (unit and fuzz tests)? If yes, it could make sense to recommend a unit test and fuzz test, each. For example |
Have incorporated your suggestion and checked that the files are indeed deterministic (they are). Again thanks for the review |
src/test/util/coverage.cpp
Outdated
extern "C" void __llvm_profile_reset_counters(void) __attribute__((weak)); | ||
extern "C" void __gcov_reset(void) __attribute__((weak)); | ||
|
||
void ResetCoverageCounters() | ||
{ | ||
if (__llvm_profile_reset_counters) { | ||
__llvm_profile_reset_counters(); | ||
} | ||
// Fallback implementations | ||
extern "C" void __llvm_profile_reset_counters(void) {} | ||
extern "C" void __gcov_reset(void) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I've ever come across this corner of C/C++ before. So you define __llvm_profile_reset_counters(void) __attribute__((weak))
for it to hopefully link to something external, but then define local implements for them in case we don't link to code coverage libs (build with code coverage enabled)? So for when we include this test-related file but only include unit tests, and build without coverage support?
From the PR description:
This change extends the functionality of the function with fallback code so that the linker does not fail on non-linux env.
Wonder if it would be more correct to say:
This change adds fallback functions which are used when building without code coverage.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main problem:
"macOS’s linker (ld64) doesn’t silently resolve unreferenced weak symbols to NULL when they’re called—it demands a definition".
Combined with calling __gcov_reset
and __llvm_profile_reset_counters
directly, forcing the linker to find a definition, will result in that the linker will break on trying to link the following code:
extern "C" void __llvm_profile_reset_counters(void) __attribute__((weak));
extern "C" void __gcov_reset(void) __attribute__((weak));
Solution is to add a fallback option :
extern "C" __attribute__((weak)) void __llvm_profile_reset_counters(void) {}
extern "C" __attribute__((weak)) void __gcov_reset(void) {}
These provide weak definitions—empty implementations that the linker can use if no stronger definitions exist.
With this in place there, are 2 scenario's
1 When Profiling Is Disabled
- Weak definitions are the only ones available. The linker doesn’t need to choose between multiple weak definitions or rely on order—it picks the {} one because they’re the sole candidates.
- The weak attribute ensures no conflict if strong definitions appear later (e.g., with profiling enabled), but without profiling, the weak {} versions are sufficient to satisfy the linker.
- This avoids the “undefined symbol” error as seen before on macOS because a definition exists, even if weak.
2 When Profiling Is Enabled
- The runtime provides strong definitions.
- The weak definitions are overridden (strong beats weak).
- ResetCoverageCounters() calls the runtime’s implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thread #32059 (comment):
Thanks for the thorough explanation, it was helpful!
nit:
This seems to build fine on Linux with/without coverage:
extern "C" void __llvm_profile_reset_counters(void);
extern "C" void __gcov_reset(void);
My guess is that what is important now is that the fallback is weak
, not the prototype, could that be? Mac CI seems to accept that, but I'm not sure if our CI tests both non-coverage and coverage builds on Mac.
Iff the above is a problem on Mac/other platforms though, I have a different variant to suggest:
Others might disagree, but I would be happy if you added a second commit which just refactors these existing prototypes to be consistent with their fallback implementations.
extern "C" __attribute__((weak)) void __llvm_profile_reset_counters(void);
extern "C" __attribute__((weak)) void __gcov_reset(void);
Makes them line up visually with the new fallbacks, and this is test-related code, so we're a bit more lenient on touching unrelated lines.
It's also consistent with Clang docs:
__attribute__((weak)) int __llvm_profile_dump(void);
(I attempted the alternative of instead changing the fallback lines to have __attribute__((weak))
after the function args but Clang warns about GCC incompatibility).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made the fallback functions weak
to make the code more robust, it will build without it but it highly depends on linker implementations (E.g. if a linker builder makes different choices it will break). Making the fallback weak is just removing the ambiguity from the equation. Resulting in more robust code.
Removing the weak
attribute from the declarations will result again being at the mercy of the linker.
Strong declarations expect strong definitions. If profiling is disabled and only your weak fallbacks exist, some linkers may/will complain about missing symbols. Secondly Removing weak
suggests these functions are always available, which isn’t true when profiling is off.
Therefor I would argue to keep the weak attributes on the declarations but move the attributes to the front to keep them aligned with the rest of the code, as suggested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for lining up the attributes!
Looking at the diff, this seems to be dropping the linux restriction, so "adding support for macOS" doesn't seem entirely accurate. It could be better to say "drop linux restriction" or "add support for non-linux". For example, OpenBSD may work as well now. |
f53f540
to
ecdbe72
Compare
In my write-up of the explanation to hodlinator I discovered one edge case that needed fixing, sorry for the new commit. Reason: |
review-only ACK ecdbe72 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK ecdbe72
Tested on Linux by running the recommended Rust deterministic unit test coverage utility both without and with coverage support, with expected results.
src/test/util/coverage.cpp
Outdated
extern "C" void __llvm_profile_reset_counters(void) __attribute__((weak)); | ||
extern "C" void __gcov_reset(void) __attribute__((weak)); | ||
|
||
void ResetCoverageCounters() | ||
{ | ||
if (__llvm_profile_reset_counters) { | ||
__llvm_profile_reset_counters(); | ||
} | ||
// Fallback implementations | ||
extern "C" void __llvm_profile_reset_counters(void) {} | ||
extern "C" void __gcov_reset(void) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thread #32059 (comment):
Thanks for the thorough explanation, it was helpful!
nit:
This seems to build fine on Linux with/without coverage:
extern "C" void __llvm_profile_reset_counters(void);
extern "C" void __gcov_reset(void);
My guess is that what is important now is that the fallback is weak
, not the prototype, could that be? Mac CI seems to accept that, but I'm not sure if our CI tests both non-coverage and coverage builds on Mac.
Iff the above is a problem on Mac/other platforms though, I have a different variant to suggest:
Others might disagree, but I would be happy if you added a second commit which just refactors these existing prototypes to be consistent with their fallback implementations.
extern "C" __attribute__((weak)) void __llvm_profile_reset_counters(void);
extern "C" __attribute__((weak)) void __gcov_reset(void);
Makes them line up visually with the new fallbacks, and this is test-related code, so we're a bit more lenient on touching unrelated lines.
It's also consistent with Clang docs:
__attribute__((weak)) int __llvm_profile_dump(void);
(I attempted the alternative of instead changing the fallback lines to have __attribute__((weak))
after the function args but Clang warns about GCC incompatibility).
Non-Linux linkers require a fallback implementation for when coverage is not enabled. The fallbacks are marked weak to have lower precedence than built-in implementations when available, removing ambiguity from the linker.
ecdbe72
to
54e6eac
Compare
review-only ACK 54e6eac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-ACK 54e6eac
Changes since first ACK:
- Moved
weak
attribute on the original declarations so they line up with the fallback definitions and mirror Clang docs. Thanks! - Improved commit message.
Retested using Rust utility on coverage-enabled version of the code with successful determinism result.
src/test/util/coverage.cpp
Outdated
extern "C" void __llvm_profile_reset_counters(void) __attribute__((weak)); | ||
extern "C" void __gcov_reset(void) __attribute__((weak)); | ||
|
||
void ResetCoverageCounters() | ||
{ | ||
if (__llvm_profile_reset_counters) { | ||
__llvm_profile_reset_counters(); | ||
} | ||
// Fallback implementations | ||
extern "C" void __llvm_profile_reset_counters(void) {} | ||
extern "C" void __gcov_reset(void) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for lining up the attributes!
29f05b91cf8 kernel: Add pure kernel bitcoin-chainstate b7733085a90 kernel: Add functions to get the block hash from a block a4f79616064 kernel: Add block index utility functions to C header 0a0062b85a7 kernel: Add function to read block undo data from disk to C header e49808a42d3 kernel: Add functions to read block from disk to C header 2f54bd53745 kernel: Add function for copying block data to C header c34ecbefbd8 kernel: Add functions for the block validation state to C header 0b46337ebe3 kernel: Add validation interface to C header 4c7a81a030e kernel: Add interrupt function to C header edf1d56fc05 kernel: Add import blocks function to C header 894b9c20447 kernel: Add chainstate load options for in-memory dbs in C header 157de0eccd3 kernel: Add options for reindexing in C header bdff17958b1 kernel: Add block validation to C header c52ca9447fc kernel: Add chainstate loading when instantiating a ChainstateManager 031a96dc6b7 kernel: Add chainstate manager option for setting worker threads c2f03a11251 kernel: Add chainstate manager object to C header 18ec1cc195b kernel: Add notifications context option to C header e3b03745f93 kernel: Add chain params context option to C header ef426234c07 kernel: Add kernel library context object 2c5e6b55922 kernel: Add logging to kernel library C header 20f1f67de07 kernel: Introduce initial kernel C header API 998386d4462 Merge bitcoin/bitcoin#31866: test, refactor: Add TestNode.binaries to hold binary paths aa87e0b4460 Merge bitcoin/bitcoin#31519: refactor: Use std::span over Span ef525e8b7c1 Merge bitcoin/bitcoin#31457: fuzz: Speed up *_package_eval fuzz targets a bit 7d76c9725ca Merge bitcoin/bitcoin#31766: leveldb: pull upstream C++23 changes 780bcf80b5d Merge bitcoin/bitcoin#32091: test: replace assert with assert_equal and assert_greater_than e568c1dd134 Merge bitcoin/bitcoin#32088: test: switch wallet_crosschain.py to signet and drop testnet4 e8f6a48e310 Merge bitcoin/bitcoin#32057: test: avoid disk space warning for non-regtest 387385ba1ed test: replace assert with assert_equal and assert_greater_than d190f0facc8 test, contrib: Fix signer/miner command line escaping 223fc24c4eb Merge bitcoin/bitcoin#31603: descriptor: check whitespace in keys within fragments 0d2eefca8bf test, refactor: Add TestNode.binaries to hold binary paths d61a847af0b Merge bitcoin/bitcoin#32019: cmake: Check for `makensis` and `zip` tools before using them for optional `deploy` targets cec14ee47d7 test: switch wallet_crosschain.py to signet 9c2951541c2 test: drop testnet4 from wallet_crosschain.py 14fec6380dd Merge bitcoin/bitcoin#32059: test: Update coverage.cpp to drop linux restriction ece0b41da6d Merge bitcoin/bitcoin#32087: ci: Drop ENABLE_HARDENING=OFF from clang-tidy c9b633d1190 Merge bitcoin/bitcoin#31948: ci: [lint] Use Cirrus dockerfile cache 6245c235046 Merge bitcoin/bitcoin#32083: doc: shallow clone `qa-assets` 257fd27e4bb Merge bitcoin/bitcoin#32033: test: Check datadir cleanup after assumeutxo was successful 6f9f415a4fa doc: shallow clone qa-assets db2c57ae9ee Merge bitcoin-core/gui#858: qt: doc: adapt outdated binary paths to CMake changes c8fab356171 ci: remove -Wno-error=deprecated-declarations from ASAN 24fd0235e45 Update leveldb subtree to latest upstream a130bbd154d Squashed 'src/leveldb/' changes from 04b5790928..4188247086 a799415d84d Merge bitcoin/bitcoin#31904: refactor: modernize outdated trait patterns using helper aliases (C++14/C++17) 5f4422d68dc Merge bitcoin/bitcoin#32010: qa: Fix TxIndex race conditions 52482cb2440 test: Check datadir cleanup after assumeutxo was successful 7ebc458a8cb qt: doc: adapt outdated binary paths to CMake changes cd8089c20ba Merge bitcoin/bitcoin#32069: test: fix intermittent failure in wallet_reorgsrestore.py 70a0ee89c67 Merge bitcoin/bitcoin#32063: test: fix intermittent failure in p2p_orphan_handling.py 54e6eacc1fc test: Enable ResetCoverageCounters beyond Linux 83a9e55ae16 Merge bitcoin/bitcoin#32070: build: use make < 3.82 syntax for define directive ca05b28710a Merge bitcoin/bitcoin#31859: test: Rename send_message to send_without_ping ab2df1726ed Merge bitcoin/bitcoin#31917: fuzz: provide more realistic values to the base58(check) decoders 51a20e56c2f Merge bitcoin/bitcoin#31977: test: Use rpc_deprecated only for testing deprecation fac3d93c2ba fuzz: Speed up *_package_eval fuzz targets a bit fa40fd043ab fuzz: [refactor] Avoid confusing c-style cast 20fe41e9e83 test: avoid disk space warning for non-regtest 2819c514825 test: Use rpc_deprecated only for testing deprecation 7d34c19853e ci: Drop ENABLE_HARDENING=OFF from clang-tidy 9157d9e4498 build: use make < 3.82 syntax for define directive 36b0713edc4 test: fix intermittent failure in wallet_reorgsrestore.py fa9cf38ab66 scripted-diff: test: Rename send_message to send_without_ping fa4356717d6 test: Prefer send_and_ping over send_message+sync_with_ping 02942056fd8 test: fix intermittent failure in p2p_orphan_handling.py 1f9b2e150ce cmake: Require `zip` only for `deploy` target 0aeff299513 cmake: Check for `makensis` tool before using it fa3b4427158 ci: Use Cirrus dockerfile cache ffff4a293ad bench: Update span-serialize comment fa4d6ec97bc refactor: Avoid false-positive gcc warning fa942332b40 scripted-diff: Bump copyright headers after std::span changes fa0c6b7179c refactor: Remove unused Span alias fade0b5e5e6 scripted-diff: Use std::span over Span fadccc26c03 refactor: Make Span an alias of std::span fa27e36717e test: Fix broken span_tests fadf02ef8bf refactor: Return std::span from MakeUCharSpan fa720b94be1 refactor: Return std::span from MakeByteSpan 3301d2cbe8c qa: Wait for txindex to avoid race condition 9bfb0d75ba1 qa: Remove unnecessary -txindex args 7ac281c19cd qa: Add missing coverage of corrupt indexes d5537c18a90 fuzz: make sure DecodeBase58(Check) is called with valid values more often bad1433ef2b fuzz: Always restrict base conversion input lengths 21e9d39a372 docs: add release notes for 31603 a8b548d75d9 test: `getdescriptorinfo`/`importdescriptors` with whitespace in pubkeys c7afca3d62c test: descriptor: check whitespace into keys cb722a3cea1 descriptor: check whitespace in ParsePubkeyInner 4cd95a29218 refactor: modernize remaining outdated trait patterns ab2b67fce20 scripted-diff: modernize outdated trait patterns - values 8327889f358 scripted-diff: modernize outdated trait patterns - types 50856695ef6 test: fix descriptors in `ismine_tests` REVERT: 2dc27e2860b kernel: Add pure kernel bitcoin-chainstate REVERT: 338126c048f kernel: Add functions to get the block hash from a block REVERT: 56345a77968 kernel: Add block index utility functions to C header REVERT: 9530f65d19b kernel: Add function to read block undo data from disk to C header REVERT: f63860169fb kernel: Add functions to read block from disk to C header REVERT: f3aa1f9bf0c kernel: Add function for copying block data to C header REVERT: a70be77c908 kernel: Add functions for the block validation state to C header REVERT: e4e3dc585a3 kernel: Add validation interface to C header REVERT: d3c48b2bdc6 kernel: Add interrupt function to C header REVERT: 7afbc516054 kernel: Add import blocks function to C header REVERT: bad89c8b30b kernel: Add chainstate load options for in-memory dbs in C header REVERT: 1dcedf3da97 kernel: Add options for reindexing in C header REVERT: aeb68c7f022 kernel: Add block validation to C header REVERT: 99136eb1656 kernel: Add chainstate loading when instantiating a ChainstateManager REVERT: 0a2117ed501 kernel: Add chainstate manager option for setting worker threads REVERT: 599dc235e98 kernel: Add chainstate manager object to C header REVERT: f280a5f3ab8 kernel: Add notifications context option to C header REVERT: 6701d12b017 kernel: Add chain params context option to C header REVERT: f40f037a9cd kernel: Add kernel library context object REVERT: 7a6c5c7abf2 kernel: Add logging to kernel library C header REVERT: 4d663446de1 kernel: Introduce initial kernel C header API git-subtree-dir: depend/bitcoin git-subtree-split: 29f05b91cf8a479e403b0322afeb5ff1133da221
29f05b91cf8 kernel: Add pure kernel bitcoin-chainstate b7733085a90 kernel: Add functions to get the block hash from a block a4f79616064 kernel: Add block index utility functions to C header 0a0062b85a7 kernel: Add function to read block undo data from disk to C header e49808a42d3 kernel: Add functions to read block from disk to C header 2f54bd53745 kernel: Add function for copying block data to C header c34ecbefbd8 kernel: Add functions for the block validation state to C header 0b46337ebe3 kernel: Add validation interface to C header 4c7a81a030e kernel: Add interrupt function to C header edf1d56fc05 kernel: Add import blocks function to C header 894b9c20447 kernel: Add chainstate load options for in-memory dbs in C header 157de0eccd3 kernel: Add options for reindexing in C header bdff17958b1 kernel: Add block validation to C header c52ca9447fc kernel: Add chainstate loading when instantiating a ChainstateManager 031a96dc6b7 kernel: Add chainstate manager option for setting worker threads c2f03a11251 kernel: Add chainstate manager object to C header 18ec1cc195b kernel: Add notifications context option to C header e3b03745f93 kernel: Add chain params context option to C header ef426234c07 kernel: Add kernel library context object 2c5e6b55922 kernel: Add logging to kernel library C header 20f1f67de07 kernel: Introduce initial kernel C header API 998386d4462 Merge bitcoin/bitcoin#31866: test, refactor: Add TestNode.binaries to hold binary paths aa87e0b4460 Merge bitcoin/bitcoin#31519: refactor: Use std::span over Span ef525e8b7c1 Merge bitcoin/bitcoin#31457: fuzz: Speed up *_package_eval fuzz targets a bit 7d76c9725ca Merge bitcoin/bitcoin#31766: leveldb: pull upstream C++23 changes 780bcf80b5d Merge bitcoin/bitcoin#32091: test: replace assert with assert_equal and assert_greater_than e568c1dd134 Merge bitcoin/bitcoin#32088: test: switch wallet_crosschain.py to signet and drop testnet4 e8f6a48e310 Merge bitcoin/bitcoin#32057: test: avoid disk space warning for non-regtest 387385ba1ed test: replace assert with assert_equal and assert_greater_than d190f0facc8 test, contrib: Fix signer/miner command line escaping 223fc24c4eb Merge bitcoin/bitcoin#31603: descriptor: check whitespace in keys within fragments 0d2eefca8bf test, refactor: Add TestNode.binaries to hold binary paths d61a847af0b Merge bitcoin/bitcoin#32019: cmake: Check for `makensis` and `zip` tools before using them for optional `deploy` targets cec14ee47d7 test: switch wallet_crosschain.py to signet 9c2951541c2 test: drop testnet4 from wallet_crosschain.py 14fec6380dd Merge bitcoin/bitcoin#32059: test: Update coverage.cpp to drop linux restriction ece0b41da6d Merge bitcoin/bitcoin#32087: ci: Drop ENABLE_HARDENING=OFF from clang-tidy c9b633d1190 Merge bitcoin/bitcoin#31948: ci: [lint] Use Cirrus dockerfile cache 6245c235046 Merge bitcoin/bitcoin#32083: doc: shallow clone `qa-assets` 257fd27e4bb Merge bitcoin/bitcoin#32033: test: Check datadir cleanup after assumeutxo was successful 6f9f415a4fa doc: shallow clone qa-assets db2c57ae9ee Merge bitcoin-core/gui#858: qt: doc: adapt outdated binary paths to CMake changes c8fab356171 ci: remove -Wno-error=deprecated-declarations from ASAN 24fd0235e45 Update leveldb subtree to latest upstream a130bbd154d Squashed 'src/leveldb/' changes from 04b5790928..4188247086 a799415d84d Merge bitcoin/bitcoin#31904: refactor: modernize outdated trait patterns using helper aliases (C++14/C++17) 5f4422d68dc Merge bitcoin/bitcoin#32010: qa: Fix TxIndex race conditions 52482cb2440 test: Check datadir cleanup after assumeutxo was successful 7ebc458a8cb qt: doc: adapt outdated binary paths to CMake changes cd8089c20ba Merge bitcoin/bitcoin#32069: test: fix intermittent failure in wallet_reorgsrestore.py 70a0ee89c67 Merge bitcoin/bitcoin#32063: test: fix intermittent failure in p2p_orphan_handling.py 54e6eacc1fc test: Enable ResetCoverageCounters beyond Linux 83a9e55ae16 Merge bitcoin/bitcoin#32070: build: use make < 3.82 syntax for define directive ca05b28710a Merge bitcoin/bitcoin#31859: test: Rename send_message to send_without_ping ab2df1726ed Merge bitcoin/bitcoin#31917: fuzz: provide more realistic values to the base58(check) decoders 51a20e56c2f Merge bitcoin/bitcoin#31977: test: Use rpc_deprecated only for testing deprecation fac3d93c2ba fuzz: Speed up *_package_eval fuzz targets a bit fa40fd043ab fuzz: [refactor] Avoid confusing c-style cast 20fe41e9e83 test: avoid disk space warning for non-regtest 2819c514825 test: Use rpc_deprecated only for testing deprecation 7d34c19853e ci: Drop ENABLE_HARDENING=OFF from clang-tidy 9157d9e4498 build: use make < 3.82 syntax for define directive 36b0713edc4 test: fix intermittent failure in wallet_reorgsrestore.py fa9cf38ab66 scripted-diff: test: Rename send_message to send_without_ping fa4356717d6 test: Prefer send_and_ping over send_message+sync_with_ping 02942056fd8 test: fix intermittent failure in p2p_orphan_handling.py 1f9b2e150ce cmake: Require `zip` only for `deploy` target 0aeff299513 cmake: Check for `makensis` tool before using it fa3b4427158 ci: Use Cirrus dockerfile cache ffff4a293ad bench: Update span-serialize comment fa4d6ec97bc refactor: Avoid false-positive gcc warning fa942332b40 scripted-diff: Bump copyright headers after std::span changes fa0c6b7179c refactor: Remove unused Span alias fade0b5e5e6 scripted-diff: Use std::span over Span fadccc26c03 refactor: Make Span an alias of std::span fa27e36717e test: Fix broken span_tests fadf02ef8bf refactor: Return std::span from MakeUCharSpan fa720b94be1 refactor: Return std::span from MakeByteSpan 3301d2cbe8c qa: Wait for txindex to avoid race condition 9bfb0d75ba1 qa: Remove unnecessary -txindex args 7ac281c19cd qa: Add missing coverage of corrupt indexes d5537c18a90 fuzz: make sure DecodeBase58(Check) is called with valid values more often bad1433ef2b fuzz: Always restrict base conversion input lengths 21e9d39a372 docs: add release notes for 31603 a8b548d75d9 test: `getdescriptorinfo`/`importdescriptors` with whitespace in pubkeys c7afca3d62c test: descriptor: check whitespace into keys cb722a3cea1 descriptor: check whitespace in ParsePubkeyInner 4cd95a29218 refactor: modernize remaining outdated trait patterns ab2b67fce20 scripted-diff: modernize outdated trait patterns - values 8327889f358 scripted-diff: modernize outdated trait patterns - types 50856695ef6 test: fix descriptors in `ismine_tests` REVERT: 2dc27e2860b kernel: Add pure kernel bitcoin-chainstate REVERT: 338126c048f kernel: Add functions to get the block hash from a block REVERT: 56345a77968 kernel: Add block index utility functions to C header REVERT: 9530f65d19b kernel: Add function to read block undo data from disk to C header REVERT: f63860169fb kernel: Add functions to read block from disk to C header REVERT: f3aa1f9bf0c kernel: Add function for copying block data to C header REVERT: a70be77c908 kernel: Add functions for the block validation state to C header REVERT: e4e3dc585a3 kernel: Add validation interface to C header REVERT: d3c48b2bdc6 kernel: Add interrupt function to C header REVERT: 7afbc516054 kernel: Add import blocks function to C header REVERT: bad89c8b30b kernel: Add chainstate load options for in-memory dbs in C header REVERT: 1dcedf3da97 kernel: Add options for reindexing in C header REVERT: aeb68c7f022 kernel: Add block validation to C header REVERT: 99136eb1656 kernel: Add chainstate loading when instantiating a ChainstateManager REVERT: 0a2117ed501 kernel: Add chainstate manager option for setting worker threads REVERT: 599dc235e98 kernel: Add chainstate manager object to C header REVERT: f280a5f3ab8 kernel: Add notifications context option to C header REVERT: 6701d12b017 kernel: Add chain params context option to C header REVERT: f40f037a9cd kernel: Add kernel library context object REVERT: 7a6c5c7abf2 kernel: Add logging to kernel library C header REVERT: 4d663446de1 kernel: Introduce initial kernel C header API git-subtree-dir: depend/bitcoin git-subtree-split: 29f05b91cf8a479e403b0322afeb5ff1133da221
29f05b91cf8 kernel: Add pure kernel bitcoin-chainstate b7733085a90 kernel: Add functions to get the block hash from a block a4f79616064 kernel: Add block index utility functions to C header 0a0062b85a7 kernel: Add function to read block undo data from disk to C header e49808a42d3 kernel: Add functions to read block from disk to C header 2f54bd53745 kernel: Add function for copying block data to C header c34ecbefbd8 kernel: Add functions for the block validation state to C header 0b46337ebe3 kernel: Add validation interface to C header 4c7a81a030e kernel: Add interrupt function to C header edf1d56fc05 kernel: Add import blocks function to C header 894b9c20447 kernel: Add chainstate load options for in-memory dbs in C header 157de0eccd3 kernel: Add options for reindexing in C header bdff17958b1 kernel: Add block validation to C header c52ca9447fc kernel: Add chainstate loading when instantiating a ChainstateManager 031a96dc6b7 kernel: Add chainstate manager option for setting worker threads c2f03a11251 kernel: Add chainstate manager object to C header 18ec1cc195b kernel: Add notifications context option to C header e3b03745f93 kernel: Add chain params context option to C header ef426234c07 kernel: Add kernel library context object 2c5e6b55922 kernel: Add logging to kernel library C header 20f1f67de07 kernel: Introduce initial kernel C header API 998386d4462 Merge bitcoin/bitcoin#31866: test, refactor: Add TestNode.binaries to hold binary paths aa87e0b4460 Merge bitcoin/bitcoin#31519: refactor: Use std::span over Span ef525e8b7c1 Merge bitcoin/bitcoin#31457: fuzz: Speed up *_package_eval fuzz targets a bit 7d76c9725ca Merge bitcoin/bitcoin#31766: leveldb: pull upstream C++23 changes 780bcf80b5d Merge bitcoin/bitcoin#32091: test: replace assert with assert_equal and assert_greater_than e568c1dd134 Merge bitcoin/bitcoin#32088: test: switch wallet_crosschain.py to signet and drop testnet4 e8f6a48e310 Merge bitcoin/bitcoin#32057: test: avoid disk space warning for non-regtest 387385ba1ed test: replace assert with assert_equal and assert_greater_than d190f0facc8 test, contrib: Fix signer/miner command line escaping 223fc24c4eb Merge bitcoin/bitcoin#31603: descriptor: check whitespace in keys within fragments 0d2eefca8bf test, refactor: Add TestNode.binaries to hold binary paths d61a847af0b Merge bitcoin/bitcoin#32019: cmake: Check for `makensis` and `zip` tools before using them for optional `deploy` targets cec14ee47d7 test: switch wallet_crosschain.py to signet 9c2951541c2 test: drop testnet4 from wallet_crosschain.py 14fec6380dd Merge bitcoin/bitcoin#32059: test: Update coverage.cpp to drop linux restriction ece0b41da6d Merge bitcoin/bitcoin#32087: ci: Drop ENABLE_HARDENING=OFF from clang-tidy c9b633d1190 Merge bitcoin/bitcoin#31948: ci: [lint] Use Cirrus dockerfile cache 6245c235046 Merge bitcoin/bitcoin#32083: doc: shallow clone `qa-assets` 257fd27e4bb Merge bitcoin/bitcoin#32033: test: Check datadir cleanup after assumeutxo was successful 6f9f415a4fa doc: shallow clone qa-assets db2c57ae9ee Merge bitcoin-core/gui#858: qt: doc: adapt outdated binary paths to CMake changes c8fab356171 ci: remove -Wno-error=deprecated-declarations from ASAN 24fd0235e45 Update leveldb subtree to latest upstream a130bbd154d Squashed 'src/leveldb/' changes from 04b5790928..4188247086 a799415d84d Merge bitcoin/bitcoin#31904: refactor: modernize outdated trait patterns using helper aliases (C++14/C++17) 5f4422d68dc Merge bitcoin/bitcoin#32010: qa: Fix TxIndex race conditions 52482cb2440 test: Check datadir cleanup after assumeutxo was successful 7ebc458a8cb qt: doc: adapt outdated binary paths to CMake changes cd8089c20ba Merge bitcoin/bitcoin#32069: test: fix intermittent failure in wallet_reorgsrestore.py 70a0ee89c67 Merge bitcoin/bitcoin#32063: test: fix intermittent failure in p2p_orphan_handling.py 54e6eacc1fc test: Enable ResetCoverageCounters beyond Linux 83a9e55ae16 Merge bitcoin/bitcoin#32070: build: use make < 3.82 syntax for define directive ca05b28710a Merge bitcoin/bitcoin#31859: test: Rename send_message to send_without_ping ab2df1726ed Merge bitcoin/bitcoin#31917: fuzz: provide more realistic values to the base58(check) decoders 51a20e56c2f Merge bitcoin/bitcoin#31977: test: Use rpc_deprecated only for testing deprecation fac3d93c2ba fuzz: Speed up *_package_eval fuzz targets a bit fa40fd043ab fuzz: [refactor] Avoid confusing c-style cast 20fe41e9e83 test: avoid disk space warning for non-regtest 2819c514825 test: Use rpc_deprecated only for testing deprecation 7d34c19853e ci: Drop ENABLE_HARDENING=OFF from clang-tidy 9157d9e4498 build: use make < 3.82 syntax for define directive 36b0713edc4 test: fix intermittent failure in wallet_reorgsrestore.py fa9cf38ab66 scripted-diff: test: Rename send_message to send_without_ping fa4356717d6 test: Prefer send_and_ping over send_message+sync_with_ping 02942056fd8 test: fix intermittent failure in p2p_orphan_handling.py 1f9b2e150ce cmake: Require `zip` only for `deploy` target 0aeff299513 cmake: Check for `makensis` tool before using it fa3b4427158 ci: Use Cirrus dockerfile cache ffff4a293ad bench: Update span-serialize comment fa4d6ec97bc refactor: Avoid false-positive gcc warning fa942332b40 scripted-diff: Bump copyright headers after std::span changes fa0c6b7179c refactor: Remove unused Span alias fade0b5e5e6 scripted-diff: Use std::span over Span fadccc26c03 refactor: Make Span an alias of std::span fa27e36717e test: Fix broken span_tests fadf02ef8bf refactor: Return std::span from MakeUCharSpan fa720b94be1 refactor: Return std::span from MakeByteSpan 3301d2cbe8c qa: Wait for txindex to avoid race condition 9bfb0d75ba1 qa: Remove unnecessary -txindex args 7ac281c19cd qa: Add missing coverage of corrupt indexes d5537c18a90 fuzz: make sure DecodeBase58(Check) is called with valid values more often bad1433ef2b fuzz: Always restrict base conversion input lengths 21e9d39a372 docs: add release notes for 31603 a8b548d75d9 test: `getdescriptorinfo`/`importdescriptors` with whitespace in pubkeys c7afca3d62c test: descriptor: check whitespace into keys cb722a3cea1 descriptor: check whitespace in ParsePubkeyInner 4cd95a29218 refactor: modernize remaining outdated trait patterns ab2b67fce20 scripted-diff: modernize outdated trait patterns - values 8327889f358 scripted-diff: modernize outdated trait patterns - types 50856695ef6 test: fix descriptors in `ismine_tests` REVERT: 2dc27e2860b kernel: Add pure kernel bitcoin-chainstate REVERT: 338126c048f kernel: Add functions to get the block hash from a block REVERT: 56345a77968 kernel: Add block index utility functions to C header REVERT: 9530f65d19b kernel: Add function to read block undo data from disk to C header REVERT: f63860169fb kernel: Add functions to read block from disk to C header REVERT: f3aa1f9bf0c kernel: Add function for copying block data to C header REVERT: a70be77c908 kernel: Add functions for the block validation state to C header REVERT: e4e3dc585a3 kernel: Add validation interface to C header REVERT: d3c48b2bdc6 kernel: Add interrupt function to C header REVERT: 7afbc516054 kernel: Add import blocks function to C header REVERT: bad89c8b30b kernel: Add chainstate load options for in-memory dbs in C header REVERT: 1dcedf3da97 kernel: Add options for reindexing in C header REVERT: aeb68c7f022 kernel: Add block validation to C header REVERT: 99136eb1656 kernel: Add chainstate loading when instantiating a ChainstateManager REVERT: 0a2117ed501 kernel: Add chainstate manager option for setting worker threads REVERT: 599dc235e98 kernel: Add chainstate manager object to C header REVERT: f280a5f3ab8 kernel: Add notifications context option to C header REVERT: 6701d12b017 kernel: Add chain params context option to C header REVERT: f40f037a9cd kernel: Add kernel library context object REVERT: 7a6c5c7abf2 kernel: Add logging to kernel library C header REVERT: 4d663446de1 kernel: Introduce initial kernel C header API git-subtree-dir: depend/bitcoin git-subtree-split: 29f05b91cf8a479e403b0322afeb5ff1133da221
…f05b91cf8 29f05b91cf8 kernel: Add pure kernel bitcoin-chainstate b7733085a90 kernel: Add functions to get the block hash from a block a4f79616064 kernel: Add block index utility functions to C header 0a0062b85a7 kernel: Add function to read block undo data from disk to C header e49808a42d3 kernel: Add functions to read block from disk to C header 2f54bd53745 kernel: Add function for copying block data to C header c34ecbefbd8 kernel: Add functions for the block validation state to C header 0b46337ebe3 kernel: Add validation interface to C header 4c7a81a030e kernel: Add interrupt function to C header edf1d56fc05 kernel: Add import blocks function to C header 894b9c20447 kernel: Add chainstate load options for in-memory dbs in C header 157de0eccd3 kernel: Add options for reindexing in C header bdff17958b1 kernel: Add block validation to C header c52ca9447fc kernel: Add chainstate loading when instantiating a ChainstateManager 031a96dc6b7 kernel: Add chainstate manager option for setting worker threads c2f03a11251 kernel: Add chainstate manager object to C header 18ec1cc195b kernel: Add notifications context option to C header e3b03745f93 kernel: Add chain params context option to C header ef426234c07 kernel: Add kernel library context object 2c5e6b55922 kernel: Add logging to kernel library C header 20f1f67de07 kernel: Introduce initial kernel C header API 998386d4462 Merge bitcoin/bitcoin#31866: test, refactor: Add TestNode.binaries to hold binary paths aa87e0b4460 Merge bitcoin/bitcoin#31519: refactor: Use std::span over Span ef525e8b7c1 Merge bitcoin/bitcoin#31457: fuzz: Speed up *_package_eval fuzz targets a bit 7d76c9725ca Merge bitcoin/bitcoin#31766: leveldb: pull upstream C++23 changes 780bcf80b5d Merge bitcoin/bitcoin#32091: test: replace assert with assert_equal and assert_greater_than e568c1dd134 Merge bitcoin/bitcoin#32088: test: switch wallet_crosschain.py to signet and drop testnet4 e8f6a48e310 Merge bitcoin/bitcoin#32057: test: avoid disk space warning for non-regtest 387385ba1ed test: replace assert with assert_equal and assert_greater_than d190f0facc8 test, contrib: Fix signer/miner command line escaping 223fc24c4eb Merge bitcoin/bitcoin#31603: descriptor: check whitespace in keys within fragments 0d2eefca8bf test, refactor: Add TestNode.binaries to hold binary paths d61a847af0b Merge bitcoin/bitcoin#32019: cmake: Check for `makensis` and `zip` tools before using them for optional `deploy` targets cec14ee47d7 test: switch wallet_crosschain.py to signet 9c2951541c2 test: drop testnet4 from wallet_crosschain.py 14fec6380dd Merge bitcoin/bitcoin#32059: test: Update coverage.cpp to drop linux restriction ece0b41da6d Merge bitcoin/bitcoin#32087: ci: Drop ENABLE_HARDENING=OFF from clang-tidy c9b633d1190 Merge bitcoin/bitcoin#31948: ci: [lint] Use Cirrus dockerfile cache 6245c235046 Merge bitcoin/bitcoin#32083: doc: shallow clone `qa-assets` 257fd27e4bb Merge bitcoin/bitcoin#32033: test: Check datadir cleanup after assumeutxo was successful 6f9f415a4fa doc: shallow clone qa-assets db2c57ae9ee Merge bitcoin-core/gui#858: qt: doc: adapt outdated binary paths to CMake changes c8fab356171 ci: remove -Wno-error=deprecated-declarations from ASAN 24fd0235e45 Update leveldb subtree to latest upstream a130bbd154d Squashed 'src/leveldb/' changes from 04b5790928..4188247086 a799415d84d Merge bitcoin/bitcoin#31904: refactor: modernize outdated trait patterns using helper aliases (C++14/C++17) 5f4422d68dc Merge bitcoin/bitcoin#32010: qa: Fix TxIndex race conditions 52482cb2440 test: Check datadir cleanup after assumeutxo was successful 7ebc458a8cb qt: doc: adapt outdated binary paths to CMake changes cd8089c20ba Merge bitcoin/bitcoin#32069: test: fix intermittent failure in wallet_reorgsrestore.py 70a0ee89c67 Merge bitcoin/bitcoin#32063: test: fix intermittent failure in p2p_orphan_handling.py 54e6eacc1fc test: Enable ResetCoverageCounters beyond Linux 83a9e55ae16 Merge bitcoin/bitcoin#32070: build: use make < 3.82 syntax for define directive ca05b28710a Merge bitcoin/bitcoin#31859: test: Rename send_message to send_without_ping ab2df1726ed Merge bitcoin/bitcoin#31917: fuzz: provide more realistic values to the base58(check) decoders 51a20e56c2f Merge bitcoin/bitcoin#31977: test: Use rpc_deprecated only for testing deprecation fac3d93c2ba fuzz: Speed up *_package_eval fuzz targets a bit fa40fd043ab fuzz: [refactor] Avoid confusing c-style cast 20fe41e9e83 test: avoid disk space warning for non-regtest 2819c514825 test: Use rpc_deprecated only for testing deprecation 7d34c19853e ci: Drop ENABLE_HARDENING=OFF from clang-tidy 9157d9e4498 build: use make < 3.82 syntax for define directive 36b0713edc4 test: fix intermittent failure in wallet_reorgsrestore.py fa9cf38ab66 scripted-diff: test: Rename send_message to send_without_ping fa4356717d6 test: Prefer send_and_ping over send_message+sync_with_ping 02942056fd8 test: fix intermittent failure in p2p_orphan_handling.py 1f9b2e150ce cmake: Require `zip` only for `deploy` target 0aeff299513 cmake: Check for `makensis` tool before using it fa3b4427158 ci: Use Cirrus dockerfile cache ffff4a293ad bench: Update span-serialize comment fa4d6ec97bc refactor: Avoid false-positive gcc warning fa942332b40 scripted-diff: Bump copyright headers after std::span changes fa0c6b7179c refactor: Remove unused Span alias fade0b5e5e6 scripted-diff: Use std::span over Span fadccc26c03 refactor: Make Span an alias of std::span fa27e36717e test: Fix broken span_tests fadf02ef8bf refactor: Return std::span from MakeUCharSpan fa720b94be1 refactor: Return std::span from MakeByteSpan 3301d2cbe8c qa: Wait for txindex to avoid race condition 9bfb0d75ba1 qa: Remove unnecessary -txindex args 7ac281c19cd qa: Add missing coverage of corrupt indexes d5537c18a90 fuzz: make sure DecodeBase58(Check) is called with valid values more often bad1433ef2b fuzz: Always restrict base conversion input lengths 21e9d39a372 docs: add release notes for 31603 a8b548d75d9 test: `getdescriptorinfo`/`importdescriptors` with whitespace in pubkeys c7afca3d62c test: descriptor: check whitespace into keys cb722a3cea1 descriptor: check whitespace in ParsePubkeyInner 4cd95a29218 refactor: modernize remaining outdated trait patterns ab2b67fce20 scripted-diff: modernize outdated trait patterns - values 8327889f358 scripted-diff: modernize outdated trait patterns - types 50856695ef6 test: fix descriptors in `ismine_tests` REVERT: 5991a69ee00 kernel: Add pure kernel bitcoin-chainstate REVERT: 05b7d136684 kernel: Add functions to get the block hash from a block REVERT: f18c792d843 kernel: Add block index utility functions to C header REVERT: 89f5bf04673 kernel: Add function to read block undo data from disk to C header REVERT: b4f71fc64e7 kernel: Add functions to read block from disk to C header REVERT: 41306f081ad kernel: Add function for copying block data to C header REVERT: 9385d9fc87e kernel: Add functions for the block validation state to C header REVERT: 0bd9a710358 kernel: Add validation interface to C header REVERT: 432710f3fc3 kernel: Add interrupt function to C header REVERT: cb164ae1eb2 kernel: Add import blocks function to C header REVERT: abd67fd93d0 kernel: Add chainstate load options for in-memory dbs in C header REVERT: b98c2748e94 kernel: Add options for reindexing in C header REVERT: 9d0efe1fc86 kernel: Add block validation to C header REVERT: 87e364fc1ec kernel: Add chainstate loading when instantiating a ChainstateManager REVERT: df1599b2d2a kernel: Add chainstate manager option for setting worker threads REVERT: fb767002e97 kernel: Add chainstate manager object to C header REVERT: 10b0fad2fd3 kernel: Add notifications context option to C header REVERT: 39e7ad8d0dc kernel: Add chain params context option to C header REVERT: 6285c353b89 kernel: Add kernel library context object REVERT: 98d10160b6a kernel: Add logging to kernel library C header REVERT: 4d663446de1 kernel: Introduce initial kernel C header API git-subtree-dir: libbitcoinkernel-sys/bitcoin git-subtree-split: 29f05b91cf8a479e403b0322afeb5ff1133da221
In PR #31901, Coverage.cpp was introduced as a separate utility file, based on existing code. However, the macro defined in Coverage.cpp was limited to Clang and Linux, which caused issues for users on macOS when using the newly introduced deterministic test tooling.
This change adds fallback functions which are used when building without code coverage on non linux env.
This adds support for macOS to ResetCoverageCounters. ResetCoverageCounters is used by the unit tests in
g_rng_temp_path_init
to support the deterministic unit test tooling. It is also used in fuzz tests to completely suppress coverage from anything init-related.See Readme on how to test this for deterministic unit & fuzz test.
Suggestion for test files:
util_string_tests
addition_overflow
These files should give deterministic results