ci, iwyu: Treat warnings as errors for specific targets #31308

pull hebasto wants to merge 5 commits into bitcoin:master from hebasto:241117-force-iwyu changing 27 files +62 −32
  1. hebasto commented at 9:00 pm on November 17, 2024: member

    This PR is the first step towards treating IWYU warnings as errors. It utilises CMake’s native support via the CMAKE_CXX_INCLUDE_WHAT_YOU_USE) variable. While this approach introduces some duplication at present, it will ultimately enable us to consolidate how the IWYU tool is executed, allowing for a choice between using the iwyu_tool.py script or CMake’s built-in functionality.

    At this stage, only the headers for the bitcoin_crypto target have been updated, and the CI will now treat any future IWYU warnings as errors:

     0...
     1Warning: include-what-you-use reported diagnostics:
     2
     3(/ci_container_base/src/crypto/chacha20.h has correct #includes/fwd-decls)
     4
     5/ci_container_base/src/crypto/chacha20.cpp should add these lines:
     6#include <assert.h>           // for assert
     7
     8/ci_container_base/src/crypto/chacha20.cpp should remove these lines:
     9- #include <string.h>  // lines 15-15
    10
    11The full include-list for /ci_container_base/src/crypto/chacha20.cpp:
    12#include <crypto/chacha20.h>
    13#include <assert.h>           // for assert
    14#include <crypto/common.h>    // for WriteLE32, ReadLE32
    15#include <span.h>             // for Span, UCharCast
    16#include <support/cleanse.h>  // for memory_cleanse
    17#include <algorithm>          // for copy, min
    18#include <bit>                // for rotl
    19---
    20
    21gmake[3]: *** [src/crypto/CMakeFiles/bitcoin_crypto.dir/build.make:90: src/crypto/CMakeFiles/bitcoin_crypto.dir/chacha20.cpp.o] Error 1
    22gmake[3]: *** Waiting for unfinished jobs....
    23gmake[2]: *** [CMakeFiles/Makefile2:1097: src/crypto/CMakeFiles/bitcoin_crypto.dir/all] Error 2
    24gmake[1]: *** [CMakeFiles/Makefile2:1104: src/crypto/CMakeFiles/bitcoin_crypto.dir/rule] Error 2
    25gmake: *** [Makefile:452: bitcoin_crypto] Error 2
    

    Based on #31306.

  2. hebasto added the label Refactoring on Nov 17, 2024
  3. hebasto added the label Tests on Nov 17, 2024
  4. DrahtBot commented at 9:00 pm on November 17, 2024: 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/31308.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #31306 (ci: Update Clang in “tidy” job by hebasto)
    • #31061 (refactor: Check translatable format strings at compile-time by maflcko)
    • #30997 (build: Switch to Qt 6 by hebasto)
    • #30975 (Add multiprocess binaries to release build by Sjors)
    • #30906 (refactor: prohibit direct flags access in CCoinsCacheEntry and remove invalid tests by l0rinc)

    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.

  5. hebasto force-pushed on Nov 18, 2024
  6. DrahtBot added the label CI failed on Nov 18, 2024
  7. ci: Update Clang in "tidy" job
    This change switches to the latest IWYU 0.23, which is compatible with
    Clang 19.
    3c259019ff
  8. refactor: Fix "modernize-use-starts-ends-with" clang-tidy warnings 768300955a
  9. iwyu: Drop backported mapping
    See: https://github.com/include-what-you-use/include-what-you-use/pull/1560
    3e039b7a03
  10. hebasto force-pushed on Nov 25, 2024
  11. refactor: Fix includes for `libbitcoin_crypto` 1caf8f938b
  12. ci, iwyu: Treat warnings as errors for specific targets
    Currently, this applies only to the `bitcoin_clientversion` and
    `bitcoin_crypto` targets.
    fc855c6bce
  13. hebasto force-pushed on Nov 25, 2024

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: 2024-12-03 18:12 UTC

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