This PR continues the ongoing effort to enforce IWYU warnings.
See Developer Notes.
Based on #36844.
This PR continues the ongoing effort to enforce IWYU warnings.
See Developer Notes.
Based on #36844.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline and AI policy for information on the review process. A summary of reviews will appear here.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
MSG_BLOCK by stripping witnesses in place by l0rinc)If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
<!--85328a0da195eb286784d51f73fa0af9-->
🚧 At least one of the CI tasks failed.
<sub>Task Alpine (musl): https://github.com/bitcoin/bitcoin/actions/runs/42513074263/job/128830134615</sub>
<sub>LLM reason (✨ experimental): CI failed during compilation: headerssync.cpp has missing declarations/includes, causing incomplete CBlockIndex and undefined symbols.</sub>
<details><summary>Hints</summary>
Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
</details>
315 | @@ -313,10 +316,6 @@ inline const std::array ALL_NET_MESSAGE_TYPES{std::to_array<std::string>({ 316 | inline constexpr size_t MAX_FEATUREID_LENGTH{80}; 317 | inline constexpr size_t MAX_FEATUREDATA_LENGTH{512}; 318 | 319 | -namespace NetMsgFeature {
this should be left as-is. Also, I am unsure how to review the non-fuzz header changes? How do I know they are enforced by iwyu? I think it would be easier if the header changes are addition-only for now?
this should be left as-is.
Thanks! Fixed.
0 | @@ -1,3 +1,5 @@ 1 | # Nothing for now. 2 | [ 3 | + # Standard C library symbols. 4 | + { "include": [ "<bits/types/cookie_io_functions_t.h>", "private", "<cstdio>", "public" ] },
Why is this needed? Has it been upstreamed?
Has it been upstreamed?
Working on this.
Also, I am unsure how to review the non-fuzz header changes? How do I know they are enforced by iwyu?
The changes in non-fuzz headers are enforced by IWYU because, due to the stem name coincidence, it considers them associated headers of the corresponding fuzz sources. For example, src/test/fuzz/protocol.cpp and src/protocol.h. However, they are not, because the fuzz sources contain no definitions for any declarations from those headers.
This, in turn, requires adding includes to some non-fuzz sources for headers that were previously included transitively.
I think it would be easier if the header changes are addition-only for now?
I'm going to split out the non-fuzz changes so that they can be reviewed separately.
This makes the list easier to read and extend, and keeps diffs
minimal when files are added.
Fix IWYU warnings in the following source files and their associated
headers, and add them to `IWYU_SRC_FILES`, so that any new warnings
there fail CI:
- chain.cpp
- headerssync.cpp
- key_io.cpp
- merkleblock.cpp
- pow.cpp
The changes in other files add includes of headers that were previously
included transitively.