scripted-diff: Drop `IWYU pragma: keep` from build config includes #36875

pull hebasto wants to merge 2 commits into bitcoin:master from hebasto:261114-always-include changing 65 files +67 −72
  1. hebasto commented at 7:35 PM on November 14, 2026: member

    This PR marks the bitcoin-build-config.h header with the dedicated IWYU pragma: always_keep, which makes the per-include IWYU pragma: keep comments redundant.

    As a result, grepping for IWYU pragma: keep returns only the genuine use cases, each of which should be properly documented.

  2. DrahtBot added the label Refactoring on Nov 14, 2026
  3. DrahtBot commented at 7:35 PM on November 14, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK l0rinc, vasild
    Stale ACK maflcko

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. maflcko commented at 7:04 AM on November 16, 2026: member

    lgtm ACK cc37763829fb946669b8127f59b97ed936200bbc

  5. l0rinc approved
  6. l0rinc commented at 7:26 AM on November 16, 2026: contributor

    ACK cc37763829fb946669b8127f59b97ed936200bbc

    Verified the scripted diff and reviewed the patch manually and confirmed locally that the updated lint catches these reintroductions.

    Note that other open PRs add or move the old annotation and may cause silent merge conflicts (#36743, #36628, #36608, #36434, #35368, #32966, #30988, #30437, #19461, #19460, #10102).

    Small non-blocking nit: We don’t usually script a one-off documentation edits, so I’d find the removal of “Make sure to include it with the IWYU pragma” easier to review as a manual change - but I do appreciate having the repetitive replacements done as a scripted diff.

  7. maflcko commented at 7:32 AM on November 16, 2026: member

    may cause silent merge conflicts

    Most of them need rebase already. For those that don't, none of them have any review, but it could make sense to re-run the lint task or leave a comment after this is merged?

  8. in test/lint/test_runner/src/lint_cpp.rs:57 in cc37763829
      50 | @@ -51,7 +51,7 @@ pub fn lint_includes_build_config() -> LintResult {
      51 |                      "--files-with-matches"
      52 |                  },
      53 |                  if mode {
      54 | -                    "^#include <bitcoin-build-config.h> // IWYU pragma: keep$"
      55 | +                    "^#include <bitcoin-build-config.h>$"
      56 |                  } else {
      57 |                      "#include <bitcoin-build-config.h>" // Catch redundant includes with and without the IWYU pragma
      58 |                  },
    


    vasild commented at 10:30 AM on November 16, 2026:

    This comment is now outdated.

    - "#include <bitcoin-build-config.h>" // Catch redundant includes with and without the IWYU pragma
    + "#include <bitcoin-build-config.h>"
    

    maflcko commented at 10:47 AM on November 16, 2026:

    The whole mode branch can be removed here? Maybe the linter change can be done in a separate commit wholesale, as mentioned by #36875#pullrequestreview-5916379834

    (No one is bisecting the linters, so them failing shouldn't matter at all.)


    hebasto commented at 12:30 PM on November 16, 2026:

    Thanks! Reworked.


    vasild commented at 1:54 PM on November 16, 2026:

    Now is without mode. I was going to suggest that but didn't because thought it might be out of scope.

    The mode==true branch gets all files that include some macros from bitcoin-build-config.h and insists that all those files contain ^#include <bitcoin-build-config.h>$. But if some file contains #include <bitcoin-build-config.h> (with leading space) it would be reported as "This file uses some macros but does not include bitcoin-build-config.h" (which would be wrong).

    Now is better. I guess things like /* inside comment #include <bitcoin-build-config.h> hoho */ are not supported ;-)

  9. vasild approved
  10. vasild commented at 10:31 AM on November 16, 2026: contributor

    ACK cc37763829fb946669b8127f59b97ed936200bbc

    <details> <summary>Show Signature</summary>

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA256
    
    ACK cc37763829fb946669b8127f59b97ed936200bbc
    -----BEGIN PGP SIGNATURE-----
    
    iQRPBAEBCAA5FiEE5k2NRWFNsHVF2czBVN8G9ktVy78FAmr62uUbFIAAAAAABAAO
    bWFudTIsMi41KzEuMTIsMiwzAAoJEFTfBvZLVcu/l4of/1io53l/CL8sRM8GTIQu
    NLdyKgg0tvSB5w1BxAnCExU9xxze7ixCGU/qK6/niA+qDGTgzcNWiJm+tzzzAmvX
    rDHZdeOBxltmRNwS5gblduBrhZ3xMMs3gef1/ZKsy8riOjEsyYuASvuKfMzqEYPb
    9DDE/aQyslrot7C3/3MzKVnSv9VOscxdb8p2xXUDIHOEUNnHIr7B4RBrx/DMZQZK
    vRg7ETTpPVu3psOyJnMA1OM2pxWE0/9OqxAl1Ujea2+Ayee7z9KxtmOdof5uL66s
    u/JJLU3687vfwrenBchXuC0L53NNl1/hEw5imUrxdeEPzLNeLIfT/+ONgVWJv6fy
    dnr1eH49fMrh3u22WXqrDaE7NXhj+BLLnWTh88RGuQ7PV+6YSb2QVcz/0fFJkG91
    a2JkXUBWRnI22P08Eakaq2T52WVMWXFWwgSfhvZIXjgbO3dRNlf5UXu220MF/l4F
    tAd8UyiGHX359XN4IzLW0csG0uEVyK3J7HM2K1HKdrlFCR+5xactjcfAIfcbqAgy
    N4ZJdVL2xZpteLc1Me+mtAez1AoQUQXz5e0O7nLt3NpWpfbIFqhoN8OEmbVjeKfo
    tdxdY1U8Kq+Lqb8f3AgLGqHtqyV0CwRClyHH8DDlyN7tyt7GzMmNPmidWJu9Av8C
    E+7GO0vj0LFTI6ur5r9I3G+BHuXrhi4QGg6XlPxQQjZckxEizp3VFZxdBmWQ+yJK
    6ssSLtZaL8pR5BI3OnhAKzohHQkethtXK6ylkeVehtqWNkC5qE6nMsTOjDbV4MIr
    nLAAssp49v8Qe+I0LOOcubqkzcB75B7NoLwSoDZZltkJ9Z1x46deWkd028cWvCFC
    HesVxdAwdNxLrpgNrK77QinnT/YfB4i21fesNyMFTzAnOghHcucmJJhGWm2So4qw
    ua4CxGdzIq38cpTO9V8wp63rbj+PrRdPIn1M6SY2thigO8095XX2YNHpPWiQKuVd
    /I4V4h0MhEsMrlqaF0oepiCsA0ekjEaNtjCICw4NCJ3qgy/yzxjoUXByOrShjzPW
    FoL/10H7kisXAk+ukJ2CyusmWbWmwWAkpJhP7Cj7S6IxlsG0NZ3EiRBNcMuVJXF2
    mPrfQL96MzIV01nROmxTiquptO0wRi+I4Kn0N4Erh6Ue8Qpf0jCIxnzFd2xpdTbM
    95MmrOeD8Jyr9yX3MtOLglTPwBLTo6VOlfTLLDp7uVtW/3qQqcuYsvtTmnc4lCnO
    QV0S1OsPlUfd4QdbdX9wqI/3lXMsAUXplCP5+5m38+YKgJVjamIXXPkynOCzeQnv
    yfyXQ/axZskGKd30qYbkfwrSSu9JVuwzs/kyI9wZQSJGc2rOvVlmTZmAG/t6CrFU
    Um0=
    =FHrj
    -----END PGP SIGNATURE-----
    

    vasild's public key is on openpgp.org

    </details>

  11. scripted-diff: Drop `IWYU pragma: keep` from build config includes
    The `bitcoin-build-config.h` header is now marked with
    `IWYU pragma: always_keep`, which makes the per-include
    `IWYU pragma: keep` comments redundant.
    
    -BEGIN VERIFY SCRIPT-
    OLD='#include <bitcoin-build-config.h> // IWYU pragma: keep'
    NEW='#include <bitcoin-build-config.h>'
    sed -i "s|$OLD|$NEW|" $(git grep -l "$OLD")
    
    GUARD='#ifndef BITCOIN_CONFIG_H'
    PRAGMA='// IWYU pragma: always_keep'
    sed -i "s|^$GUARD$|$PRAGMA\n\n&|" cmake/bitcoin-build-config.h.in
    -END VERIFY SCRIPT-
    04108a0dbb
  12. lint: Update `lint_includes_build_config` function 53561d8037
  13. hebasto force-pushed on Nov 16, 2026
  14. hebasto commented at 12:30 PM on November 16, 2026: member

    Thanks for the review! The feedback has been addressed.

  15. l0rinc commented at 12:33 PM on November 16, 2026: contributor

    code review and diff reACK 53561d803747567fc01ca1513ecfb280a01aa5a9

    We lost the regex constraints when mode, but my understanding is that it should be fine.

  16. DrahtBot requested review from maflcko on Nov 16, 2026
  17. DrahtBot requested review from vasild on Nov 16, 2026
  18. vasild approved
  19. vasild commented at 1:55 PM on November 16, 2026: contributor

    ACK 53561d803747567fc01ca1513ecfb280a01aa5a9

    <details> <summary>Show Signature</summary>

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA256
    
    ACK 53561d803747567fc01ca1513ecfb280a01aa5a9
    -----BEGIN PGP SIGNATURE-----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+O2G+aJSxaGqISzgWtTzVsI8SNNx3GguWhf+5G9+7fuGeCsEDREHMnAs9Ut
    cIWav1jbXs3eNeaDp2IjuS7chyP7tFchL1bYigDwtIQ0w/IlB4IKdm3PWXUG+lg7
    BJimjpPY26fDCoBLHq+IQrgo6jwnP+hJc1vatDczpR0wHB0+VMwJoeBlVTGLUANI
    DR/wgH/mjKpJmFZvPQy5VOXCxwPhsiaw+3NtQRbW2EJkR7QVo3p8XpMiaNW4JNAH
    6nwB/c6bQkJOygvllakghZO8rTtmcmyaC4jGUoVaLLCVMQJ1yH1D+LLYwYMGUtid
    Xrm30VMOwGAtQEOYjbMF15Xw7PL18SUC14/mJKtYNDRjzw/Fzt7nT7P2kM/7qXEG
    svCZibPwZXLKLFPCRbjDf1fXMLGl/+0G70pPMrLnAewHOPvT0sC0Blzz/ahIUxUS
    T88=
    =80yZ
    -----END PGP SIGNATURE-----
    

    vasild's public key is on openpgp.org

    </details>

  20. fanquake merged this on Nov 16, 2026
  21. fanquake closed this on Nov 16, 2026

  22. hebasto deleted the branch on Nov 16, 2026


maflcko


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-11-19 19:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me