This PR continues the ongoing effort to enforce IWYU warnings.
See Developer Notes.
Additionally, this adds a new include category to src/.clang-format.
src/zmq and treat them as errors
#34338
This PR continues the ongoing effort to enforce IWYU warnings.
See Developer Notes.
Additionally, this adds a new include category to src/.clang-format.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34338.
See the guideline for information on the review process.
If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.
Reviewers, this pull request conflicts with the following ones:
src/util and treat them as errors by hebasto)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.
ACK 01ab21f83824d124e9ca37f67a9535893ad9ae28
This PR fixes the zmq warnings as reported by iwyu on master:
0/home/admin/actions-runner/_work/_temp/src/zmq/zmqnotificationinterface.h should add these lines:
1#include <cstddef> // for byte
2
3/home/admin/actions-runner/_work/_temp/src/zmq/zmqnotificationinterface.h should remove these lines:
4- class CBlock; // lines 17-17
5- struct NewMempoolTransactionInfo; // lines 20-20
6
7/home/admin/actions-runner/_work/_temp/src/zmq/zmqnotificationinterface.cpp should add these lines:
8#include <util/check.h> // for inline_assertion_check, assert
9
10/home/admin/actions-runner/_work/_temp/src/zmq/zmqnotificationinterface.cpp should remove these lines:
11- #include <validationinterface.h> // lines 14-14
12- #include <cassert> // lines 21-21
13
14(/home/admin/actions-runner/_work/_temp/src/zmq/zmqrpc.h has correct #includes/fwd-decls)
15
16/home/admin/actions-runner/_work/_temp/src/zmq/zmqrpc.cpp should add these lines:
17#include <memory> // for operator==, unique_ptr, default_delete
18#include <utility> // for move
19#include <vector> // for vector
20
21/home/admin/actions-runner/_work/_temp/src/zmq/zmqrpc.cpp should remove these lines:
22
23/usr/include/c++/14/bits/unicode-data.h:1:1: warning: no private include name for [@headername](/bitcoin-bitcoin/contributor/headername/) mapping
24
25/home/admin/actions-runner/_work/_temp/src/zmq/zmqpublishnotifier.h should add these lines:
26#include <utility> // for move
27
28/home/admin/actions-runner/_work/_temp/src/zmq/zmqpublishnotifier.h should remove these lines:
29- class CTransaction; // lines 16-16
30
31/home/admin/actions-runner/_work/_temp/src/zmq/zmqpublishnotifier.cpp should add these lines:
32#include <util/check.h> // for inline_assertion_check, assert
33#include <span> // for as_bytes
34
35/home/admin/actions-runner/_work/_temp/src/zmq/zmqpublishnotifier.cpp should remove these lines:
36- #include <chainparams.h> // lines 8-8
37- #include <kernel/cs_main.h> // lines 10-10
38- #include <node/blockstorage.h> // lines 14-14
39- #include <primitives/block.h> // lines 15-15
40- #include <rpc/server.h> // lines 17-17
41- #include <sync.h> // lines 20-20
42- #include <cassert> // lines 26-26
43- namespace Consensus { struct Params; } // lines 38-38
44
45(/home/admin/actions-runner/_work/_temp/src/zmq/zmqutil.h has correct #includes/fwd-decls)
46
47/home/admin/actions-runner/_work/_temp/src/zmq/zmqutil.cpp should add these lines:
48#include <util/check.h> // for inline_assertion_check
49
50/home/admin/actions-runner/_work/_temp/src/zmq/zmqutil.cpp should remove these lines:
After change IWUY does not complain about zmq:
0(/home/admin/actions-runner/_work/_temp/src/zmq/zmqabstractnotifier.h has correct #includes/fwd-decls)
1
2(/home/admin/actions-runner/_work/_temp/src/zmq/zmqabstractnotifier.cpp has correct #includes/fwd-decls)
3
4(/home/admin/actions-runner/_work/_temp/src/zmq/zmqutil.h has correct #includes/fwd-decls)
5
6(/home/admin/actions-runner/_work/_temp/src/zmq/zmqutil.cpp has correct #includes/fwd-decls)
7
8(/home/admin/actions-runner/_work/_temp/src/zmq/zmqpublishnotifier.h has correct #includes/fwd-decls)
9
10(/home/admin/actions-runner/_work/_temp/src/zmq/zmqpublishnotifier.cpp has correct #includes/fwd-decls)
11
12(/home/admin/actions-runner/_work/_temp/src/zmq/zmqrpc.h has correct #includes/fwd-decls)
13
14(/home/admin/actions-runner/_work/_temp/src/zmq/zmqrpc.cpp has correct #includes/fwd-decls)
15
16(/home/admin/actions-runner/_work/_temp/src/zmq/zmqnotificationinterface.h has correct #includes/fwd-decls)
17
18(/home/admin/actions-runner/_work/_temp/src/zmq/zmqnotificationinterface.cpp has correct #includes/fwd-decls)
The enforcement is also added to the zmq folder, and will result in iwyu to fail, tested on master:
0
1diff --git a/src/zmq/zmqutil.cpp b/src/zmq/zmqutil.cpp
2index d3addaad4b..f2d22dbe73 100644
3--- a/src/zmq/zmqutil.cpp
4+++ b/src/zmq/zmqutil.cpp
5@@ -5,6 +5,7 @@
6 #include <zmq/zmqutil.h>
7
8 #include <logging.h>
9+#include <util/check.h>
10 #include <zmq.h>
11
12 #include <cerrno>
13+ echo '^^^ ?? Failure generated from IWYU'
14+ false
15^^^ ?? Failure generated from IWYU
16 #include <vector>
17
18-class CBlock;
19 class CBlockIndex;
20 class CZMQAbstractNotifier;
21-struct NewMempoolTransactionInfo;
9@@ -10,10 +10,10 @@
10 #include <cstddef>
11 #include <cstdint>
12 #include <functional>
13+#include <utility>
14 #include <vector>
15
16 class CBlockIndex;
17-class CTransaction;
01ab21f83824d124e9ca37f67a9535893ad9ae28 🚣
Signature:
0untrusted 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}"
1RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
2trusted comment: 01ab21f83824d124e9ca37f67a9535893ad9ae28 🚣
3fcZfYPWOW71LWfnqPn2sYlXBe2sSRgj375V9CwdZgq1AvlONo5B4fwuvLL9OlfjwVy5KZosKsWpGkoJdzhjyAA==
review ACK efcbf794484ecc02cae05e520120df9d1aa8c93a 🐼
Signature:
0untrusted 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}"
1RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
2trusted comment: review ACK efcbf794484ecc02cae05e520120df9d1aa8c93a 🐼
3dK9vUftLo0y2W3gamChSO1sXSyBXPZ1O39nEhmzU0oQNbDW5hZTqX0EzwMzSqp3bnGgf1YK2hKYEie3Inqi2AQ==
re ACK efcbf794484ecc02cae05e520120df9d1aa8c93a
change since last ACK: