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

pull hebasto wants to merge 2 commits into bitcoin:master from hebasto:241117-force-iwyu changing 20 files +51 −25
  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
    
  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

    No conflicts as of last run.

  5. hebasto force-pushed on Nov 18, 2024
  6. DrahtBot added the label CI failed on Nov 18, 2024
  7. hebasto force-pushed on Nov 25, 2024
  8. hebasto force-pushed on Nov 25, 2024
  9. DrahtBot added the label Needs rebase on Dec 5, 2024
  10. hebasto force-pushed on Dec 5, 2024
  11. hebasto force-pushed on Dec 5, 2024
  12. DrahtBot removed the label Needs rebase on Dec 5, 2024
  13. hebasto marked this as ready for review on Dec 5, 2024
  14. DrahtBot removed the label CI failed on Dec 5, 2024
  15. DrahtBot added the label Needs rebase on Dec 8, 2024
  16. refactor: Fix includes for `libbitcoin_crypto` 6df1a0ce23
  17. ci, iwyu: Treat warnings as errors for specific targets
    Currently, this applies only to the `bitcoin_clientversion` and
    `bitcoin_crypto` targets.
    d838f1bac6
  18. hebasto force-pushed on Dec 12, 2024
  19. hebasto commented at 10:45 am on December 12, 2024: member
    Rebased.
  20. DrahtBot removed the label Needs rebase on Dec 12, 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-21 18:12 UTC

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