Skip to content

Conversation

@hebasto
Copy link
Member

@hebasto hebasto commented Jul 12, 2025

This PR is a proof of concept for using a compilation database with static analysis tools such as clang-tidy or IWYU. The idea was suggested in #32662 (comment):

Shouldn't this be excluded in the tidy CI task as well?

Additionally, this PR makes use of the codegen target, following the suggestion in #32662 (comment):

It does seem nice to be able to run clang-tidy on generated files... Maybe more ideally there could be ... target like make --build build -t codegen that only runs code generation steps and doesn't compile the sources.

A few tasks remain to be addressed. Here's the current TODO list:

  • Implement the codegen target for CMake versions older than 3.31.
  • Handle files generated by the mpgen tool.
  • Handle files generated by Qt tools.
  • Enable RUN_CHECK_DEPS=true elsewhere.

While #31965 is still under discussion, it may make sense to move this CI job to GHA to provide quicker feedback.

@hebasto hebasto added the Tests label Jul 12, 2025
@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 12, 2025

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

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:

  • #30595 (kernel: Introduce C header API 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.

export LC_ALL=C.UTF-8

export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:25.04"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was done in the past, but it makes bisecting harder, because those images (and their package mirrors) quickly get deleted upstream

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems fine to wait a few months until the 26.04 tag is available and then just use that. Also, it seems fine to just require cmake 3.31 (or higher) if anyone wants to use the codegen target, but no strong opinion.

@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 4, 2025

🐙 This pull request conflicts with the target branch and needs rebase.

@hebasto hebasto mentioned this pull request Nov 6, 2025
hebasto added a commit that referenced this pull request Dec 22, 2025
56750c4 iwyu, clang-format: Sort includes (Hennadii Stepanov)
2c78814 ci: Add IWYU job (Hennadii Stepanov)
94e4f04 cmake: Fix target name (Hennadii Stepanov)
0f81e00 cmake: Make `codegen` target dependent on `generate_build_info` (Hennadii Stepanov)
73f7844 iwyu: Add patch to prefer C++ headers over C counterparts (Hennadii Stepanov)
7a65437 iwyu: Add patch to prefer angled brackets over quotes for includes (Hennadii Stepanov)

Pull request description:

  This PR separates the IWYU checks into its own CI job to provide faster feedback to developers. No other changes are made to the treatment of IWYU warnings. The existing “tidy” CI job will no longer run IWYU.

  See also the discussion of #33779, specifically this [comment](#33779 (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.

ACKs for top commit:
  maflcko:
    review ACK 56750c4 🌄
  sedited:
    ACK 56750c4

Tree-SHA512: af15326b6d0c5d1e11346ac64939644936c65eb9466cd1a17ab5da347d39aef10f7ab33b39fbca31ad291b0b4b54639b147b24410f4f86197e4a776049882694
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants