This PR continues the ongoing effort to enforce IWYU warnings.
See Developer Notes.
This PR continues the ongoing effort to enforce IWYU warnings.
See Developer Notes.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35011.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| ACK | hebasto |
| Concept ACK | kevkevinpal |
If your review is incorrectly listed, please copy-paste <code><!--meta-tag:bot-skip--></code> into the comment that the bot should ignore.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
src/common 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.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
Concept ACK.
d41095a70d87e84b8c5cdfcefe1c53174fbabac6
Per our policy, "a comment explaining the rationale is required for every use of IWYU pragma: export":
$ git grep -l "IWYU pragma: export" -- src/script
src/script/interpreter.h
src/script/script.h
Concept ACK
Looks like common/ compat/ support/ are now left from that list after this PR is merged
@kevkevinpal from the list I only think only compat/ and support/ are left there is already a PR: 34995 for common/ -> #34995. I don't know if this will be done for QT #33725 (comment)
I don't know if this will be done for
QT#33725 (comment)
It will be, though it requires some preliminary work.
Per our policy, "a comment explaining the rationale is required for every use of
IWYU pragma: export":
updated the PR to include comments for the left IWYU pragma: export on scr/script
208 | @@ -209,7 +209,7 @@ fi 209 | 210 | if [[ "${RUN_IWYU}" == true ]]; then 211 | # TODO: Consider enforcing IWYU across the entire codebase. 212 | - FILES_WITH_ENFORCED_IWYU="/src/(((crypto|index|kernel|primitives|univalue/(lib|test)|util|zmq)/.*|common/license_info|node/blockstorage|node/utxo_snapshot|clientversion|core_io|signet)\\.cpp)" 213 | + FILES_WITH_ENFORCED_IWYU="/src/(((crypto|index|kernel|primitives|univalue/(lib|test)|util|zmq|script)/.*|common/license_info|node/blockstorage|node/utxo_snapshot|clientversion|core_io|signet)\\.cpp)"
nit: Could the subdirectories be lexicographically ordered?
fixed
23 | #include <script/signingprovider.h> 24 | #include <script/solver.h> 25 | +#include <serialize.h> 26 | +#include <tinyformat.h> 27 | #include <uint256.h> 28 |
nit: Drop empty line?
fixed
9 | @@ -10,8 +10,16 @@ 10 | #include <crypto/sha256.h> 11 | #include <pubkey.h> 12 | #include <script/script.h> 13 | +#include <serialize.h> 14 | +#include <span.h> 15 | #include <tinyformat.h> 16 | #include <uint256.h> 17 | +#include <algorithm>
Separate header groups by an empty line?
fixed
8 | @@ -9,21 +9,26 @@ 9 | #include <consensus/amount.h> 10 | #include <hash.h> 11 | #include <primitives/transaction.h> 12 | +#include <script/script.h> 13 | +// script_error.h is exported because there should rarely be a case where it is 14 | +// included without interpreter.h 15 | #include <script/script_error.h> // IWYU pragma: export
13 | +// script_error.h is exported because there should rarely be a case where it is 14 | +// included without interpreter.h 15 | #include <script/script_error.h> // IWYU pragma: export 16 | +// verify_flags.h is exported because it defines the common SCRIPT_VERIFY_* 17 | +// type alias used by the interpreter interface 18 | #include <script/verify_flags.h> // IWYU pragma: export
1 | @@ -2,17 +2,16 @@ 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | -#include <limits> 6 | -#include <vector> 7 | - 8 | -#include <primitives/transaction.h> 9 | #include <script/miniscript.h> 10 | +#include <primitives/transaction.h>
We usually separate the associated header by an empty line:
#include <script/miniscript.h>
#include <primitives/transaction.h>
fixed
7 | @@ -8,14 +8,16 @@ 8 | 9 | #include <attributes.h> 10 | #include <crypto/common.h> 11 | +// prevector.h is exported because it exists primarily to represent scripts 12 | #include <prevector.h> // IWYU pragma: export
22 | +#include <serialize.h> 23 | #include <uint256.h> 24 | +#include <util/check.h> 25 | #include <util/translation.h> 26 | #include <util/vector.h> 27 | +#include <algorithm>
nit: Separate groups by an empty line?
fixed
Left some comments.
Almost ACK.
There is a silent merge conflict here. Please apply the following patch during your next rebase to resolve it:
--- a/src/script/sigcache.h
+++ b/src/script/sigcache.h
@@ -11,7 +11,9 @@
#include <cuckoocache.h>
#include <script/interpreter.h>
#include <uint256.h>
-#include <util/byte_units.h>
+// IWYU incorrectly suggests removing this header.
+// See https://github.com/include-what-you-use/include-what-you-use/issues/2014.
+#include <util/byte_units.h> // IWYU pragma: keep
#include <util/hasher.h>
#include <cstddef>
See also: #35152#pullrequestreview-4179389612.
ACK 74f42e9dd7c5683209d5d366486e1a6def49dcf1.