ci: Add IWYU job #33810

pull hebasto wants to merge 3 commits into bitcoin:master from hebasto:251106-force-iwyu-ci changing 8 files +57 −10
  1. hebasto commented at 11:27 pm on November 6, 2025: member

    This PR seeks to address feedback raised in the discussion of #33779, specifically from this comment:

    Maybe a better approach would be to run the enforced sections in a separate, faster job? Some of the linters are already a bit annoying to invoke locally, so I usually just run the lint job. Doing the same for the includes seems fine to me.

    Based on ideas from #32953.

  2. hebasto added the label Tests on Nov 6, 2025
  3. DrahtBot commented at 11:28 pm on November 6, 2025: 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/33810.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK w0xlt

    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:

    • #33824 (ci: Enable experimental kernel stuff in most CI tasks by maflcko)
    • #31425 (RFC: Riscv bare metal CI job by TheCharlatan)

    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. w0xlt commented at 0:00 am on November 7, 2025: contributor
    Concept ACK
  5. in src/crypto/hex_base.cpp:11 in f72b2f7f58 outdated
     7@@ -8,7 +8,6 @@
     8 #include <cassert>
     9 #include <cstring>
    10 #include <string>
    11-#include <tuple>
    


    maflcko commented at 10:49 am on November 7, 2025:

    I think both CI tasks should use the same config (debian:trixie). Otherwise, if someone tries to reproduce the CI config, they two configs will contradict each other, which doesn’t seem helpful?

    Also, I find it confusing that one CI task is printing the iwyu errors and the other is printing the warnings. What is the goal here? It seems clearer to just print the errors and warnings in one task, like it was done before.

    As mentioned previously, iwyu takes 9 minutes (https://github.com/bitcoin/bitcoin/pull/33779#issuecomment-3491592008) and in this pull it takes 30 seconds and you claim that it is faster. However, if the goal is to eventually run it on more stuff, it will take 9 minutes again. So I’d say we should also combine iwyu errors and warnings into one task, to be honest and accurate about the expected long-term runtime of the task.


    hebasto commented at 11:37 am on November 7, 2025:
    Reworked into a single job.
  6. fanquake commented at 11:14 am on November 7, 2025: member

    providing convenient feedback to developers.

    How can we improve the quality of the feedback (https://github.com/bitcoin/bitcoin/pull/33779#issuecomment-3496969502)? Getting it faster is nice, but if it can’t be taken and applied directly without fixing the sorting, and the formatting, and in the worse case, changing headers entirely for modernize-deprecated-headers, then it doesn’t seem that much more useful.

  7. hebasto commented at 11:26 am on November 7, 2025: member

    but if it can’t be taken and applied directly without fixing the sorting, and the formatting, and in the worse case, changing headers entirely for modernize-deprecated-headers, then it doesn’t seem that much more useful.

    I disagree. In practice, when a developer works on changes that modify includes, the diff in the includes would typically be just a few lines. Using the diff from the CI job as a hint seems entirely reasonable. I don’t see a strong need to increase the script’s complexity just to produce a diff that can be immediately applied.

  8. hebasto force-pushed on Nov 7, 2025
  9. in ci/test/03_test_script.sh:44 in 9bb013d8e5
    43@@ -44,7 +44,7 @@ echo "=== END env ==="
    44 # Don't apply patches in the tidy job, because it relies on the `git diff`
    


    maflcko commented at 11:55 am on November 7, 2025:
    0# Don't apply patches in the iwyu job, because it relies on the `git diff`
    

    nit, if you re-touch


    hebasto commented at 12:11 pm on November 7, 2025:
    Thanks! Fixed.
  10. maflcko approved
  11. maflcko commented at 12:01 pm on November 7, 2025: member
    lgtm. Seems fine
  12. hebasto renamed this:
    ci: Add fast IWYU job
    ci: Add IWYU job
    on Nov 7, 2025
  13. hebasto force-pushed on Nov 7, 2025
  14. DrahtBot added the label CI failed on Nov 7, 2025
  15. fanquake commented at 12:12 pm on November 7, 2025: member

    just to produce a diff that can be immediately applied.

    The diff can’t be applied at all, how wrong it is varies, and there are no instructions for devs on how to fix it.

  16. maflcko commented at 12:23 pm on November 7, 2025: member

    instructions

    Some basic instructions could be added after the echo "^^^ ⚠️ Failure generated from IWYU", if needed.

  17. hebasto commented at 12:32 pm on November 7, 2025: member

    instructions

    Some basic instructions could be added after the echo "^^^ ⚠️ Failure generated from IWYU", if needed.

    Happy to add them once someone suggests good wording.

  18. DrahtBot removed the label CI failed on Nov 7, 2025
  19. cmake: Make `codegen` target dependent on `generate_build_info` 485ad27415
  20. cmake: Fix target name
    The executable target run by ctest is `mptest`.
    
    This change removes unnecessary steps when building the `codegen`
    target.
    0c16445f05
  21. hebasto force-pushed on Nov 7, 2025
  22. hebasto commented at 3:36 pm on November 7, 2025: member
    Rebased on top of the merged bitcoin/bitcoin#33818.
  23. DrahtBot added the label CI failed on Nov 7, 2025
  24. hebasto force-pushed on Nov 7, 2025
  25. fanquake commented at 5:01 pm on November 7, 2025: member
    The TSAN failure is #33318.
  26. ci: Add IWYU job
    The change in `src/crypto/hex_base.cpp` is because GCC 14 is not
    affected by an IWYU bug.
    See: https://github.com/include-what-you-use/include-what-you-use/issues/1763.
    1f55824743
  27. in ci/test/03_test_script.sh:223 in bd48a101f9 outdated
    216@@ -213,7 +217,9 @@ if [ "${RUN_TIDY}" = "true" ]; then
    217     echo "^^^ ⚠️ Failure generated from clang-tidy"
    218     false
    219   fi
    220+fi
    221 
    222+if [ "${RUN_IWYU}" == "true" ]; then
    223   # TODO: Consider enforcing IWYU across the entire codebase.
    


    maflcko commented at 5:42 pm on November 7, 2025:

    Maybe:

    0echo "^^^ ⚠️ Failure generated from IWYU"
    1echo
    2echo "Some adjustments to the diff may be needed:"
    3echo
    4echo "* Use the C++ headers: E.g. <cerrno> over <errno.h>"
    5echo '* Use #include <__.h> over #include "__.h" for all headers'
    6echo "* Sort the headers, so that they are in the right pre-existing section, if"
    7echo "  there are any."
    

    hebasto commented at 5:52 pm on November 7, 2025:
    Thanks! Added.
  28. hebasto force-pushed on Nov 7, 2025
  29. maflcko approved
  30. maflcko commented at 6:11 pm on November 7, 2025: member
    lgtm
  31. DrahtBot removed the label CI failed on Nov 7, 2025

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

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