ci, iwyu: Fix warnings in src/zmq and treat them as errors #34338

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:260119-iwyu-zmq changing 8 files +15 −19
  1. hebasto commented at 12:24 pm on January 19, 2026: member

    This PR continues the ongoing effort to enforce IWYU warnings.

    See Developer Notes.

    Additionally, this adds a new include category to src/.clang-format.

  2. hebasto added the label Refactoring on Jan 19, 2026
  3. DrahtBot commented at 12:24 pm on January 19, 2026: contributor

    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/34338.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK maflcko, janb84, sedited

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #34448 (ci, iwyu: Fix warnings in 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.

  4. hebasto force-pushed on Jan 19, 2026
  5. hebasto commented at 5:09 pm on January 19, 2026: member
    Rebased to resolve a conflict with the merged bitcoin/bitcoin#34296.
  6. hebasto force-pushed on Jan 20, 2026
  7. hebasto commented at 11:31 am on January 20, 2026: member
    Rebased.
  8. hebasto added the label RPC/REST/ZMQ on Jan 20, 2026
  9. janb84 commented at 2:01 pm on January 26, 2026: contributor

    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
    
  10. in src/zmq/zmqnotificationinterface.h:20 in 01ab21f838 outdated
    16 #include <vector>
    17 
    18-class CBlock;
    19 class CBlockIndex;
    20 class CZMQAbstractNotifier;
    21-struct NewMempoolTransactionInfo;
    


    maflcko commented at 8:51 am on January 27, 2026:
    seems wrong to remove?

    hebasto commented at 2:35 pm on January 29, 2026:
    These types are part of the signatures of overridden virtual functions. Since the base class is fully defined here, these types are guaranteed to be declared already.
  11. in src/zmq/zmqpublishnotifier.h:16 in 01ab21f838 outdated
     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;
    


    maflcko commented at 8:55 am on January 27, 2026:
    same?

    hebasto commented at 2:35 pm on January 29, 2026:
    same :)
  12. maflcko commented at 8:55 am on January 27, 2026: member

    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==
    
  13. DrahtBot added the label Needs rebase on Jan 28, 2026
  14. hebasto marked this as a draft on Jan 29, 2026
  15. ci, iwyu: Fix warnings in `src/zmq` and treat them as errors efcbf79448
  16. hebasto force-pushed on Jan 29, 2026
  17. hebasto commented at 2:39 pm on January 29, 2026: member
    Rebased to resolve a conflict with the merged #34352.
  18. hebasto marked this as ready for review on Jan 29, 2026
  19. DrahtBot removed the label Needs rebase on Jan 29, 2026
  20. DrahtBot added the label CI failed on Jan 29, 2026
  21. maflcko commented at 6:28 pm on January 29, 2026: member

    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==
    
  22. DrahtBot requested review from janb84 on Jan 29, 2026
  23. janb84 commented at 6:34 pm on January 29, 2026: contributor

    re ACK efcbf794484ecc02cae05e520120df9d1aa8c93a

    change since last ACK:

    • minor fixes after merge.
  24. DrahtBot removed the label CI failed on Jan 29, 2026
  25. sedited approved
  26. sedited commented at 8:21 am on January 31, 2026: contributor
    ACK efcbf794484ecc02cae05e520120df9d1aa8c93a
  27. sedited merged this on Jan 31, 2026
  28. sedited closed this on Jan 31, 2026

  29. hebasto deleted the branch on Jan 31, 2026

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-02-11 21:13 UTC

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