Skip to content

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Nov 17, 2024

This PR is the first step towards treating IWYU warnings as errors. At this stage, it applies only to the crypto and index directories.

@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 17, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31308.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK ryanofsky
Concept ACK jonatack, l0rinc, sipa
Stale ACK maflcko

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #26966 (index: initial sync speedup, parallelize process by furszy)

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.

@hebasto
Copy link
Member Author

hebasto commented Dec 12, 2024

Rebased.

@maflcko
Copy link
Member

maflcko commented Sep 1, 2025

Only change is rebase.

re-ACK a4fa7b9 🚇

Show signature

Signature:

untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
trusted comment: re-ACK a4fa7b97aa73b177ea416388acfc2aba25c79e19 🚇
bRpP979EiaRYiW2rw/6yGXWljok64xDpRXXHzbyfOOiBMN+ftjgfNugbR0of17pwNoW+kOx/kZxEgzXhOkWhAQ==

@hebasto
Copy link
Member Author

hebasto commented Sep 1, 2025

Rebased and addressed @maflcko's comment.

@maflcko
Copy link
Member

maflcko commented Sep 1, 2025

re-ACK 1d49346 📶

Show signature

Signature:

untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
trusted comment: re-ACK 1d49346465de8edec85bb2d498859b4fbc346935 📶
2MJL8GNQQjZb4FgXDGl0qh67OHXwPeXDDWmlxONQfHs9hQfrdiETVAw+8nZ0IE+8qrWtyPqrQqZ7OXa2ZYcBCg==

@DrahtBot DrahtBot removed the CI failed label Sep 1, 2025
Copy link
Contributor

@l0rinc l0rinc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK

@@ -33,7 +33,9 @@ echo "=== BEGIN env ==="
env
echo "=== END env ==="

(
if [ "$RUN_TIDY" != "true" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we fix this in https://github.com/bitcoin-core/leveldb-subtree/pulls instead?
I have opened bitcoin-core/leveldb-subtree#56 (I'm also fine with doing it in a different PR, just wanted to give the possibility to solve it in a cleaner way)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objection, but I am not sure we should diverge the subtree for a test-only patch. Also, the patch is pre-existing, so it seems a bit unrelated to this pull.

Ideally, Google would fix the UB in some way or another, and then we can pull whatever their fix was, but that shouldn't be a blocker here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main leveledb repo doesn't even compile for the past 8 months, not sure why we would wait for them. But as I mentioned, I don't mind doing it after the PR, just seems cleaner if we didn't need to change this section again.

struct IndexSummary {
std::string name;
bool synced{false};
int best_block_height{0};
uint256 best_block_hash;
};
namespace interfaces {
struct BlockRef;
Copy link
Contributor

@l0rinc l0rinc Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure I understand why this was needed, but I haven't run the scripts, just tried to find out locally

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwd decls are slimmer than a full include, and often sufficient, for example when the header only uses the types as pointers or references. IWYU will suggest them sometimes, when possible.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, that wasn't my question. But I'll figure it out next, feel free to resolve it.

Copy link
Member Author

@hebasto hebasto Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[[nodiscard]] virtual bool CustomInit(const std::optional<interfaces::BlockRef>& block) { return true; }

@hebasto
Copy link
Member Author

hebasto commented Sep 4, 2025

@ryanofsky

You may be interested in these changes.

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK 1d49346. Makes sense to try IWYU in a few directories like this to see how stable it is and make sure it won't cause problems.

@DrahtBot DrahtBot requested a review from l0rinc September 8, 2025 15:46
@hebasto
Copy link
Member Author

hebasto commented Sep 8, 2025

The feedback from @ryanofsky has been addressed.

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK d03d861. Just fixing up comment and changing variable name since last review. Thanks for the updates!

IWYU issue bitcoin#1763 appears to be a corner case, so it has been addressed
using a local pragma rather than a global mapping.
@hebasto
Copy link
Member Author

hebasto commented Sep 9, 2025

Rebased due to a conflict with #30469.

@sipa
Copy link
Member

sipa commented Sep 9, 2025

Concept ACK

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK 02d2b5a. Just rebased and update tidy patch comment again since last review

@DrahtBot DrahtBot requested a review from sipa September 9, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants