Skip to content

bazel: Switch over to clang-22#30012

Merged
StephanDollberg merged 9 commits intodevfrom
stephan/clang-22-default
Apr 8, 2026
Merged

bazel: Switch over to clang-22#30012
StephanDollberg merged 9 commits intodevfrom
stephan/clang-22-default

Conversation

@StephanDollberg
Copy link
Copy Markdown
Member

Travis already made everything build.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v26.1.x
  • v25.3.x
  • v25.2.x

Release Notes

  • none

rockwotj
rockwotj previously approved these changes Mar 31, 2026
Copy link
Copy Markdown
Contributor

@rockwotj rockwotj left a comment

Choose a reason for hiding this comment

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

Don't we need to clang-format?

Comment thread .bazelrc
@rockwotj rockwotj dismissed their stale review March 31, 2026 15:25

actually need to trigger lint-cpp CI check

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the repo’s Bazel-managed LLVM/Clang toolchain to make LLVM/Clang 22.1.0 the default (“current”) toolchain, removing the prior “current”/“next” toolchain entries and associated Bazel configs.

Changes:

  • Promote LLVM/Clang 22.1.0 to the sole “current” toolchain definition in MODULE.bazel.
  • Update MODULE.bazel.lock to reflect the new toolchain repo specs/digests for @current_llvm_toolchain.
  • Simplify .bazelrc by removing the common:clang-21 / common:clang-22 extra toolchain configs now that @current_llvm_toolchain is the default.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
MODULE.bazel Removes old 20.x/21.x compiler entries and sets “current” to LLVM/Clang 22.1.0 tarballs/shas.
MODULE.bazel.lock Regenerates/updates bzlmod lock data so @current_llvm_toolchain resolves to LLVM/Clang 22.1.0.
.bazelrc Drops now-redundant clang-21/clang-22 config blocks; continues to use @current_llvm_toolchain by default.

@rockwotj
Copy link
Copy Markdown
Contributor

rockwotj commented Mar 31, 2026

Don't we need to clang-format?

We also need to format and add to .git-blame-ignore-refs or whatever the file is. Also consider backporting (just the clang-format stuff) to reduce conflicts with backports

@StephanDollberg
Copy link
Copy Markdown
Member Author

Yep good point.

@StephanDollberg StephanDollberg requested a review from a team as a code owner March 31, 2026 15:34
@github-actions github-actions Bot added area/redpanda area/wasm WASM Data Transforms labels Mar 31, 2026
std::string{schema_def.data(), schema_def.size()}));
!res.has_value()) {
if (
auto res = sr_client->create_schema(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is just odd, isn't it. Let me see whether one can disable.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it seems kinda unfortunate that upgrading clang-format causes so much churn. are they "bugs" or just defaults changing and we can tweek our config? either way, no big deal.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

They are config. But it seems for this specifically it was inconsistent before so you get diffs either way. I don't care which way we go.

I'll leave default unless I hear otherwise.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i find previous style

one cherry picked example:

  • old style it is very easy to visually scan where if expression ends and where the if block starts
  • new style: good luck since all lines are aligned to the same depth so you have to scan line ends rather than line starts
Screenshot 2026-03-31 at 16 49 40 more readable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

seems for this specifically it was inconsistent before

got it so like formatting "bugs" so yeh it makes sense then to accept all the churn?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

btw our .clang-format files has AlignAfterOpenBracket: AlwaysBreak but it seems it applied only to function parameters in prev release
Screenshot 2026-03-31 at 16 54 19

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

there are more BreakAfterOpen* options to consider

Yes but they result in tens of thousands of line changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes but they result in tens of thousands of line changes.

I mean if we can make this less painful in the future I think it's worth it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't really see what's painful about it right now but I also don't really see how we can avoid it.

The "problem" is that they are adding new flags for underspecified behaviour I think. So you can add explicit values for everything right now that still won't prevent future flags from causing changes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agree with @StephanDollberg here, it looks like they switching from a heuristic (penalty) based breaking for these examples to more binary options which will always break after ( (for example) when it can't fit on one line. So we cannot get to zero churn.

I mean if we can make this less painful in the future I think it's worth it.

I don't think that's the case: we are just choosing between two different styles now, no reason to believe the other one will have less churn in the future. So I would vote for what we have now as the low churn option unless there is a very concrete reason we like the other way better.

@StephanDollberg
Copy link
Copy Markdown
Member Author

Also consider backporting (just the clang-format stuff)

How would this work btw? Backport the whole toolchain?

@travisdowns
Copy link
Copy Markdown
Member

Let's get a microbench on this.

@rockwotj
Copy link
Copy Markdown
Contributor

Also consider backporting (just the clang-format stuff)

How would this work btw? Backport the whole toolchain?

backport the toolchain as next or format or something and only use it for formatting. Or you could just backport the format and disable the format CI check on backport branches. TBH I think disabling formatting for backports is totally fine

@StephanDollberg
Copy link
Copy Markdown
Member Author

I guess clang-22 is already on 26.1 but we don't have a custom clang-format config which we could append to.

We'd need to disable pre-commit hooks as well. Hmm.

@rockwotj
Copy link
Copy Markdown
Contributor

I guess clang-22 is already on 26.1 but we don't have a custom clang-format config which we could append to.
We'd need to disable pre-commit hooks as well. Hmm.

You could just change the clang-format target in bazel to /bin/true which I think might also work too... IDK just a thought.

@vbotbuildovich
Copy link
Copy Markdown
Collaborator

vbotbuildovich commented Mar 31, 2026

Retry command for Build#82547

please wait until all jobs are finished before running the slash command

/ci-repeat 1
skip-redpanda-build
skip-units
skip-rebase
tests/rptest/tests/cluster_features_test.py::FeaturesMultiNodeUpgradeTest.test_rollback
tests/rptest/tests/license_enforcement_test.py::LicenseEnforcementTest.test_license_enforcement@{"clean_node_after_recovery":false,"clean_node_before_recovery":true}
tests/rptest/tests/cluster_features_test.py::FeaturesMultiNodeUpgradeTest.test_upgrade
tests/rptest/tests/license_enforcement_test.py::LicenseEnforcementTest.test_license_enforcement@{"clean_node_after_recovery":false,"clean_node_before_recovery":false}
tests/rptest/tests/cluster_features_test.py::FeaturesSingleNodeUpgradeTest.test_upgrade
tests/rptest/tests/license_enforcement_test.py::LicenseEnforcementTest.test_license_enforcement@{"clean_node_after_recovery":true,"clean_node_before_recovery":true}
tests/rptest/tests/cluster_features_test.py::FeaturesNodeJoinTest.test_old_node_join
tests/rptest/tests/license_enforcement_test.py::LicenseEnforcementTest.test_license_enforcement@{"clean_node_after_recovery":true,"clean_node_before_recovery":false}

@vbotbuildovich
Copy link
Copy Markdown
Collaborator

vbotbuildovich commented Mar 31, 2026

CI test results

test results on build#82547
test_class test_method test_arguments test_kind job_url test_status passed reason test_history
FeaturesMultiNodeUpgradeTest test_rollback null integration https://buildkite.com/redpanda/redpanda/builds/82547#019d44a8-0117-4a29-8d83-3f21f7f297bd FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3520, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=FeaturesMultiNodeUpgradeTest&test_method=test_rollback
FeaturesMultiNodeUpgradeTest test_rollback null integration https://buildkite.com/redpanda/redpanda/builds/82547#019d44a8-b9a0-47b2-8d67-125ad8307aa3 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3520, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=FeaturesMultiNodeUpgradeTest&test_method=test_rollback
FeaturesMultiNodeUpgradeTest test_upgrade null integration https://buildkite.com/redpanda/redpanda/builds/82547#019d44a8-0117-492f-8949-a2455366af0c FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3520, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=FeaturesMultiNodeUpgradeTest&test_method=test_upgrade
FeaturesMultiNodeUpgradeTest test_upgrade null integration https://buildkite.com/redpanda/redpanda/builds/82547#019d44a8-b9a1-4a74-a903-cc8fb07c2481 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3659, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=FeaturesMultiNodeUpgradeTest&test_method=test_upgrade
FeaturesNodeJoinTest test_old_node_join null integration https://buildkite.com/redpanda/redpanda/builds/82547#019d44a8-0118-4f6c-af20-8cd2eed57918 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3513, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=FeaturesNodeJoinTest&test_method=test_old_node_join
FeaturesNodeJoinTest test_old_node_join null integration https://buildkite.com/redpanda/redpanda/builds/82547#019d44a8-b9a1-4751-8d64-1f6ecc085818 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3652, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=FeaturesNodeJoinTest&test_method=test_old_node_join
FeaturesSingleNodeUpgradeTest test_upgrade null integration https://buildkite.com/redpanda/redpanda/builds/82547#019d44a8-0113-4cd8-a68e-3dc10f31130c FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3513, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=FeaturesSingleNodeUpgradeTest&test_method=test_upgrade
FeaturesSingleNodeUpgradeTest test_upgrade null integration https://buildkite.com/redpanda/redpanda/builds/82547#019d44a8-b99d-4683-adab-e6c05e7835e0 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3652, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=FeaturesSingleNodeUpgradeTest&test_method=test_upgrade
LicenseEnforcementTest test_license_enforcement {"clean_node_after_recovery": false, "clean_node_before_recovery": false} integration https://buildkite.com/redpanda/redpanda/builds/82547#019d44a8-011b-431e-bac5-5b895e31f6f3 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3493, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=LicenseEnforcementTest&test_method=test_license_enforcement
LicenseEnforcementTest test_license_enforcement {"clean_node_after_recovery": false, "clean_node_before_recovery": false} integration https://buildkite.com/redpanda/redpanda/builds/82547#019d44a8-b9a2-444b-8e63-9505953ce89a FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3634, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=LicenseEnforcementTest&test_method=test_license_enforcement
LicenseEnforcementTest test_license_enforcement {"clean_node_after_recovery": true, "clean_node_before_recovery": false} integration https://buildkite.com/redpanda/redpanda/builds/82547#019d44a8-011c-40a4-a6e9-01bcc3bda2f5 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3493, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=LicenseEnforcementTest&test_method=test_license_enforcement
LicenseEnforcementTest test_license_enforcement {"clean_node_after_recovery": true, "clean_node_before_recovery": false} integration https://buildkite.com/redpanda/redpanda/builds/82547#019d44a8-b9a3-442c-9c99-ef82e41dc224 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3564, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=LicenseEnforcementTest&test_method=test_license_enforcement
LicenseEnforcementTest test_license_enforcement {"clean_node_after_recovery": false, "clean_node_before_recovery": true} integration https://buildkite.com/redpanda/redpanda/builds/82547#019d44a8-0112-4af8-8b8b-521ad65623fc FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3493, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=LicenseEnforcementTest&test_method=test_license_enforcement
LicenseEnforcementTest test_license_enforcement {"clean_node_after_recovery": false, "clean_node_before_recovery": true} integration https://buildkite.com/redpanda/redpanda/builds/82547#019d44a8-b99d-4011-9ec7-6f1e548e568c FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3493, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=LicenseEnforcementTest&test_method=test_license_enforcement
LicenseEnforcementTest test_license_enforcement {"clean_node_after_recovery": true, "clean_node_before_recovery": true} integration https://buildkite.com/redpanda/redpanda/builds/82547#019d44a8-0113-4cd8-a68e-3dc10f31130c FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3493, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=LicenseEnforcementTest&test_method=test_license_enforcement
LicenseEnforcementTest test_license_enforcement {"clean_node_after_recovery": true, "clean_node_before_recovery": true} integration https://buildkite.com/redpanda/redpanda/builds/82547#019d44a8-b99d-4683-adab-e6c05e7835e0 FAIL 0/11 Test FAILS after retries.Significant increase in flaky rate(baseline=0.3599, p0=0.0000, reject_threshold=0.0100) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=LicenseEnforcementTest&test_method=test_license_enforcement
test results on build#82576
test_class test_method test_arguments test_kind job_url test_status passed reason test_history
WriteCachingFailureInjectionE2ETest test_crash_all {"use_transactions": false} integration https://buildkite.com/redpanda/redpanda/builds/82576#019d4601-5d71-4559-9bec-82e6a0e59141 FLAKY 9/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0857, p0=0.5917, reject_threshold=0.0100. adj_baseline=0.2357, p1=0.2779, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=WriteCachingFailureInjectionE2ETest&test_method=test_crash_all
test results on build#82610
test_class test_method test_arguments test_kind job_url test_status passed reason test_history
AlterConfigMixedNodeTest test_alter_config_shadow_indexing_mixed_node {"incremental_update": false} integration https://buildkite.com/redpanda/redpanda/builds/82610#019d484c-908e-4fc4-b09a-bcf53f9ecbf9 FLAKY 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0029, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.3487, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=AlterConfigMixedNodeTest&test_method=test_alter_config_shadow_indexing_mixed_node
DatalakeThrottlingTest test_basic_throttling {"catalog_type": "rest_hadoop", "cloud_storage_type": 1} integration https://buildkite.com/redpanda/redpanda/builds/82610#019d484c-908d-4d9a-9613-def92d9dca23 FLAKY 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0000, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.3487, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=DatalakeThrottlingTest&test_method=test_basic_throttling

@travisdowns travisdowns force-pushed the stephan/clang-22-default branch from 3ee1814 to 56b3b9a Compare March 31, 2026 20:41
@travisdowns
Copy link
Copy Markdown
Member

@StephanDollberg I rebased this branch to get the CI to run again.

@StephanDollberg
Copy link
Copy Markdown
Member Author

You could just change the clang-format target in bazel to /bin/true which I think might also work too... IDK just a thought.

Hmm, all feels very hacky.

Ideally we'd have to:

  • Add build:clang-format --build to all branches
  • Add --config=clang-format to pre-commit and CI/vtools
  • Change 26.1 build:clang-format --config=clang-22

@StephanDollberg StephanDollberg force-pushed the stephan/clang-22-default branch 2 times, most recently from 4bf1bb2 to 3590b95 Compare April 1, 2026 08:32
@StephanDollberg StephanDollberg requested a review from a team as a code owner April 1, 2026 08:55
@StephanDollberg StephanDollberg requested review from ivotron and removed request for a team April 1, 2026 08:55
@StephanDollberg StephanDollberg force-pushed the stephan/clang-22-default branch 3 times, most recently from a8b1795 to 748272f Compare April 1, 2026 12:27
@rockwotj
Copy link
Copy Markdown
Contributor

rockwotj commented Apr 1, 2026

You could just change the clang-format target in bazel to /bin/true which I think might also work too... IDK just a thought.

Hmm, all feels very hacky.

Ideally we'd have to:

* Add `build:clang-format --build` to all branches
* Add --config=clang-format to pre-commit and CI/vtools
* Change 26.1 `build:clang-format --config=clang-22`

Simpler is to just bump the toolchain used for clang format only?

redpanda/tools/BUILD

Lines 134 to 137 in b75774d

"$(rootpath @current_llvm_toolchain//:clang-format)",
],
data = [
"@current_llvm_toolchain//:clang-format",

@StephanDollberg
Copy link
Copy Markdown
Member Author

Ah interesting, that would be easier yes.

@StephanDollberg
Copy link
Copy Markdown
Member Author

/microbench

@StephanDollberg
Copy link
Copy Markdown
Member Author

@travisdowns
Copy link
Copy Markdown
Member

@StephanDollberg wrote:

Perf changes: https://gist.github.com/StephanDollberg/a9783b84b0d0b4a95c34288f469d4864

Thanks. "Looks fine" to me, all sorts of +/- but mostly modest. Overall trend not sure but definitely not a lot worse or anything like that.

This one stuck out to me as odd, I may look at it further:

hashing_bench_rpbench.ntp_hash.absl_hash_of: inst -> -10.87pct
hashing_bench_rpbench.ntp_hash.absl_hash_value: inst -> -6.00pct
hashing_bench_rpbench.ntp_hash.boost_hash: inst -> -8.39pct
hashing_bench_rpbench.ntp_hash.ktp_absl_hash: inst -> +80.26pct
hashing_bench_rpbench.ntp_hash.ktp_any_hash_eq: inst -> +80.55pct
hashing_bench_rpbench.ntp_hash.ktp_std_hash: inst -> +80.55pct
hashing_bench_rpbench.ntp_hash.ntp_absl_hash: inst -> -6.00pct
hashing_bench_rpbench.ntp_hash.ntp_any_hash_eq: inst -> -8.22pct
hashing_bench_rpbench.ntp_hash.ntp_old_hash: inst -> -8.39pct
hashing_bench_rpbench.ntp_hash.ntp_std_hash: inst -> -8.22pct

@ivotron ivotron removed their request for review April 6, 2026 21:06
Travis already made everything build.
```
external/toolchains_llvm++llvm+current_llvm_toolchain_llvm/include/clang-tidy/ClangTidyModuleRegistry.h:15:2: error: The ClangTidyModuleRegistry.h header is deprecated and will be removed in LLVM 24. All of the symbols it used to define have been moved into ClangTidyModule.h. [-Werror,-W#warnings]
   15 | #warning The ClangTidyModuleRegistry.h header is deprecated and will be removed in LLVM 24. All of the symbols it used to define have been moved into ClangTidyModule.h.
      |  ^
1 error generated.
```
@StephanDollberg StephanDollberg force-pushed the stephan/clang-22-default branch from 748272f to e299de9 Compare April 7, 2026 13:49
Our bazel clang-tidy wrapper is very weird and causes errors with
clang-tidy-22:

 - We seem to be building compile flags manually in our bazel wrapper.
   This means we are somehow passing defines multiple times with
   different values (BAZEL_CURRENT_REPOSITORY ) - breaks now because of
   clang-diagnostic-macro-redefined. Disable that error.
 - We seem to run on headers directly which seems very odd to me and
   results in lots of unused variable warnings. clang-tidy-22 now errors
   about warnings in headers by default. Stop doing that.
Our weird bazel clang-tidy hackfest doesn't understand everything that
is set in .bazelrc. Hence, it doesn't use the per-file-copt settings
that we pass making it fail on errors that are ignored by that.

To work around that remove -Werror which it gets passed down from our
compiler opts. Instead drive -Werror completely from the .clang-tidy
`WarningsAsErrors` options.
Multiple issues with the existing header regex:

Problem 1: YAML round-trip corruption. The Python wrapper (clang_tidy.py) loads
the .clang-tidy file with yaml.safe_load, modifies the Checks field, then
writes it back with yaml.safe_dump. The dump produces:

HeaderFilterRegex: ^(?!external/.*).*

Note: no quotes. LLVM's YAML parser sees !external as a YAML tag indicator,
corrupting the regex. This silently disables header filtering — no headers get
checked for WarningsAsErrors violations.

Problem 2: Path mismatch. Even if the regex survived YAML, it anchors at
^external/. But Bazel sandbox paths look like
bazel-out/k8-fastbuild/bin/external/protobuf+/... — they don't start with
external/, so the negative lookahead never triggers.

The new config:

 - HeaderFilterRegex: '.*': check diagnostics from all headers -
 - ExcludeHeaderFilterRegex: clang-tidy 18+ feature that excludes
   matching headers:
    - (^|/)external/ — matches external/ anywhere in the path (handles
      Bazel's bazel-out/.../external/... paths)
    - \.json\.hh$ — excludes Seastar-generated swagger headers
      (auto-generated code we can't fix)

Neither value contains !, so they survive YAML round-tripping safely.
 - src/v/utils/retry_chain_node.h — Fixed bugprone-use-after-move:
   format message once upfront instead of double-forwarding args.
 - src/v/cluster/partition_leaders_table.h — Fixed
   bugprone-use-after-move: capture f by reference instead of forwarding
   into a lambda inside a loop.
 - src/v/test_utils/randoms.h — Fixed bugprone-use-after-move: don't
   forward args in a loop, just pass them as lvalues.
@StephanDollberg StephanDollberg force-pushed the stephan/clang-22-default branch from e299de9 to ef3fac5 Compare April 7, 2026 19:22

try:
extra_args = [
"--extra-arg=-Wno-error",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have a feeling there is a better way to fix this, but shouldn't block this PR

@StephanDollberg StephanDollberg merged commit aa6479f into dev Apr 8, 2026
29 checks passed
@StephanDollberg StephanDollberg deleted the stephan/clang-22-default branch April 8, 2026 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants