Repository navigation
bench: [refactor] iwyu - #30716
bench: [refactor] iwyu#30716
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. 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. |
|
Concept ACK. Maybe check |
Yes, this will be a follow-up, because it requires other changes as well. |
hebasto
left a comment
There was a problem hiding this comment.
I still see IWYU warnings in https://cirrus-ci.com/task/5307830952001536. Here are some of them:
bench/addrman.cpp should add these lines:
#include "netaddress.h" // for CService, CNetAddr, Network
#include "protocol.h" // for CAddress, ServiceFlags
bench/bech32.cpp should remove these lines:
- #include <cstdint> // lines 9-9
bench/bench.h should add these lines:
#include "nanobench.h" // for Bench (ptr only)
bench/data.cpp should add these lines:
#include <iterator> // for begin, end
|
Concept ACK |
Thanks, fixed. |
|
Still seems to be:
I'm guessing handling this case, or ignoring it, is part of that? |
|
Concept ACK Thanks for taking the initiative on this! (Should hopefully free contributors from considering |
|
ACK fab0e83 https://cirrus-ci.com/task/4676750536343552 log only shows bench/ issues with bench/bench.h itself, as TheCharlatan previously mentioned. |
It reminds me include-what-you-use/include-what-you-use#1280. |
stickies-v
left a comment
There was a problem hiding this comment.
ACK fab0e83
Reviewed by:
- checking that all changes are limited to updating includes and fwd declarations in
bench/files - checking the clang-tidy CI job output for suggestions on
bench/files, yielding only one result forbench/bench.h(as already pointed out by other reviewers):
grep "bench\/.*should" -A 3
bench/bench.h should add these lines:
#include "nanobench.h" // for Bench (ptr only)
bench/bench.h should remove these lines:
The full include-list for bench/bench.h:
#include <bench/nanobench.h>
| #include <bench/bench.h> | ||
|
|
||
| #include <test/util/setup_common.h> | ||
| #include <test/util/setup_common.h> // IWYU pragma: keep |
There was a problem hiding this comment.
Review note: this include (and thus the new pragma) is necessary to compile setup_common.cpp. Without it, fails with
Undefined symbols for architecture arm64:
"_G_TEST_COMMAND_LINE_ARGUMENTS", referenced from:
BasicTestingSetup::BasicTestingSetup(ChainType, TestOpts) in libtest_util.a[11](libtest_util_a-setup_common.o)
"_G_TEST_GET_FULL_NAME", referenced from:
BasicTestingSetup::BasicTestingSetup(ChainType, TestOpts) in libtest_util.a[11](libtest_util_a-setup_common.o)
"_G_TEST_LOG_FUN", referenced from:
BasicTestingSetup::BasicTestingSetup(ChainType, TestOpts) in libtest_util.a[11](libtest_util_a-setup_common.o)
ld: symbol(s) not found for architecture arm64
|
ACK fab0e83 |
Missing includes are problematic, because:
_LIBCPP_REMOVE_TRANSITIVE_INCLUDES(https://libcxx.llvm.org/DesignDocs/HeaderRemovalPolicy.html). This can lead to compile failures, which are easy to fix for developers, but may not be for users. For example, commit 138f867 had to add missing includes to accommodate GCC 15 (and the commit had to be backported).Moreover, missing or extraneous includes are problematic, because they may be confusing the code reader as to what the real dependencies are.
Finally, extraneous includes may slow down the build.
Fix all issues in
bench, by applying the rule include-what-you-use (iwyu).Follow-up pull requests will handle the other places.