Skip to content

Fix clang-tidy failures in CUDA 13.2 CI - #8251

Merged
rapids-bot[bot] merged 2 commits into
NVIDIA:mainfrom
dantegd:fea-fix-clang-tidy
Jun 11, 2026
Merged

Fix clang-tidy failures in CUDA 13.2 CI#8251
rapids-bot[bot] merged 2 commits into
NVIDIA:mainfrom
dantegd:fea-fix-clang-tidy

Conversation

@dantegd

@dantegd dantegd commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Fixes the clang-tidy PR job by:

  • Remove the obsolete AnalyzeTemporaryDtors key from .clang-tidy, which clang-tidy 20 rejects.
  • Filter the GCC-only -fno-merge-constants flag before invoking clang-tidy, since CUDA 13.2 toolchain commands can include it and clang treats it as an error under WarningsAsErrors.

@copy-pr-bot

copy-pr-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@dantegd

dantegd commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test b0f0a85

@dantegd

dantegd commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test fff675a

@dantegd dantegd added bug Something isn't working non-breaking Non-breaking change labels Jun 10, 2026
@dantegd
dantegd marked this pull request as ready for review June 10, 2026 22:10
@dantegd
dantegd requested a review from a team as a code owner June 10, 2026 22:10
@dantegd
dantegd requested review from divyegala and tarang-jain June 10, 2026 22:10
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated development tooling configuration and copyright year.
    • Enhanced clang-tidy script to filter out unsupported compiler flags during analysis runs.

Walkthrough

This PR updates clang-tidy configuration and the clang-tidy runner script for improved compiler flag compatibility. The .clang-tidy config removes an analysis option, while run-clang-tidy.py now filters unsupported compiler flags from the command line during argument construction.

Changes

Clang-tidy configuration and compiler flag handling

Layer / File(s) Summary
Clang-tidy configuration cleanup
cpp/.clang-tidy
Removed the AnalyzeTemporaryDtors: false option from clang-tidy configuration.
Compiler flag filtering in run-clang-tidy.py
cpp/scripts/run-clang-tidy.py
Copyright year updated, UNSUPPORTED_CLANG_FLAGS constant added containing -fno-merge-constants, and flag removal loop implemented in get_tidy_args to strip occurrences of unsupported flags from the tokenized compiler command.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main purpose of the changeset: fixing clang-tidy failures in CUDA 13.2 CI by removing obsolete configuration and filtering unsupported compiler flags.
Description check ✅ Passed The description is directly related to the changeset, providing clear details about both changes: removing AnalyzeTemporaryDtors from .clang-tidy and filtering the -fno-merge-constants flag.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cpp/scripts/run-clang-tidy.py`:
- Around line 184-186: The current loop using UNSUPPORTED_CLANG_FLAGS and
remove_item(command, flag) only removes exact tokens and can leave wrapper
tokens (e.g., "-Xcompiler") or inline forms ("-Xcompiler=-fno-merge-constants")
orphaned; update the filtering to remove (a) exact matches of each unsupported
flag, (b) tokens of the form "<wrapper>=<flag>" (check startswith for wrappers
like "-Xcompiler="), and (c) wrapper tokens that are separate arguments followed
by the flag (e.g., remove the "-Xcompiler" token when the next token equals the
unsupported flag). Implement this logic around the existing
UNSUPPORTED_CLANG_FLAGS and remove_item usage so command ends up free of both
standalone and wrapped forms of unsupported flags.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c9f0af32-a0fc-4346-b566-5b15fc19e021

📥 Commits

Reviewing files that changed from the base of the PR and between f2776c1 and fff675a.

📒 Files selected for processing (2)
  • cpp/.clang-tidy
  • cpp/scripts/run-clang-tidy.py
💤 Files with no reviewable changes (1)
  • cpp/.clang-tidy

Comment on lines +184 to +186
for flag in UNSUPPORTED_CLANG_FLAGS:
while remove_item(command, flag) >= 0:
pass

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Flag filtering can leave malformed compiler args.

At Line 185, removing only -fno-merge-constants by exact token can leave wrapper args like -Xcompiler orphaned (or miss inline forms like -Xcompiler=-fno-merge-constants), which can still break clang-tidy invocation.

Proposed fix
-    for flag in UNSUPPORTED_CLANG_FLAGS:
-        while remove_item(command, flag) >= 0:
-            pass
+    i = 0
+    while i < len(command):
+        token = command[i]
+        removed = False
+        for flag in UNSUPPORTED_CLANG_FLAGS:
+            # direct token: ... -fno-merge-constants ...
+            if token == flag:
+                del command[i]
+                removed = True
+                break
+            # wrapped single token: ... -Xcompiler=-fno-merge-constants ...
+            if token == f"-Xcompiler={flag}":
+                del command[i]
+                removed = True
+                break
+            # wrapped pair: ... -Xcompiler -fno-merge-constants ...
+            if (
+                token == "-Xcompiler"
+                and i + 1 < len(command)
+                and command[i + 1] == flag
+            ):
+                del command[i : i + 2]
+                removed = True
+                break
+        if not removed:
+            i += 1
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cpp/scripts/run-clang-tidy.py` around lines 184 - 186, The current loop using
UNSUPPORTED_CLANG_FLAGS and remove_item(command, flag) only removes exact tokens
and can leave wrapper tokens (e.g., "-Xcompiler") or inline forms
("-Xcompiler=-fno-merge-constants") orphaned; update the filtering to remove (a)
exact matches of each unsupported flag, (b) tokens of the form
"<wrapper>=<flag>" (check startswith for wrappers like "-Xcompiler="), and (c)
wrapper tokens that are separate arguments followed by the flag (e.g., remove
the "-Xcompiler" token when the next token equals the unsupported flag).
Implement this logic around the existing UNSUPPORTED_CLANG_FLAGS and remove_item
usage so command ends up free of both standalone and wrapped forms of
unsupported flags.

@divyegala

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot
rapids-bot Bot merged commit 9a1664a into NVIDIA:main Jun 11, 2026
157 of 177 checks passed
@jcrist jcrist mentioned this pull request Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CUDA/C++ non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants