Skip to content

build: accept "/Fo obj/x.obj" when reading compile_commands.json - #53573

Merged
codebytere merged 1 commit into
mainfrom
build/clang-tidy-fo-space
Sep 5, 2026
Merged

codebytere merged 1 commit into
mainfrom
build/clang-tidy-fo-space

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

Follow-up to #53447, found on its 42/43/44 backports (#53568 #53569 #53570), where the Windows clang-tidy job failed with multiple rules generates .tidy.

  • GN's compile-commands writer puts a space before every substituted path, so a toolchain command written /Fo{{output}} lands in compile_commands.json as /Fo obj/x.obj. Chromium's Windows cc/cxx tools used that form until 155 changed them to /Fo$output (a plain string, so /Foobj/x.obj). gen-clang-tidy-ninja.py only handled the joined form; with the spaced one every clang-cl entry parsed to an empty object path and every step got the output .tidy.
  • Accept both forms, and exit naming the source file if an entry has no object path at all rather than writing a broken ninja file.
  • No effect on main today (155 uses the joined form); this keeps main and the release branches on the same script and guards against the toolchain string changing again.

Notes: none

GN writes "/Fo{{output}}" to compile_commands.json with a space before the
substituted path; Chromium's Windows toolchain used that form until 155
switched to "/Fo$output". gen-clang-tidy-ninja.py only handled the
joined form, so with the spaced one every clang-cl entry parsed to an
empty object path, every step got the output ".tidy", and siso rejected
the file with "multiple rules generates .tidy" (seen on the 42/43/44
backports of #53447). Accept both, and fail with the source file name if
an entry has no object path at all.
@MarshallOfSound MarshallOfSound added semver/none target/45-x-y PR should also be added to the "45-x-y" branch. labels Sep 5, 2026
@MarshallOfSound MarshallOfSound self-assigned this Sep 5, 2026
@codebytere
codebytere merged commit 2e9208d into main Sep 5, 2026
139 of 141 checks passed
@codebytere
codebytere deleted the build/clang-tidy-fo-space branch September 5, 2026 08:58
@release-clerk

release-clerk Bot commented Sep 5, 2026

Copy link
Copy Markdown

No Release Notes

@github-actions github-actions Bot added the 46-x-y label Sep 5, 2026
@trop

trop Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "45-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot added needs-manual-bp/45-x-y and removed target/45-x-y PR should also be added to the "45-x-y" branch. labels Sep 5, 2026
@trop

trop Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

claude[bot] has manually backported this PR to "45-x-y", please check out #53587

claude Bot pushed a commit that referenced this pull request Sep 5, 2026
)

GN writes "/Fo{{output}}" to compile_commands.json with a space before the
substituted path; Chromium's Windows toolchain used that form until 155
switched to "/Fo$output". gen-clang-tidy-ninja.py only handled the
joined form, so with the spaced one every clang-cl entry parsed to an
empty object path, every step got the output ".tidy", and siso rejected
the file with "multiple rules generates .tidy" (seen on the 42/43/44
backports of #53447). Accept both, and fail with the source file name if
an entry has no object path at all.

(cherry picked from commit 2e9208d)
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KsGbFEEncB9pNtHMRTPj5Z
MarshallOfSound pushed a commit that referenced this pull request Sep 5, 2026
)

build: accept "/Fo obj/x.obj" when reading compile_commands.json (#53573)

GN writes "/Fo{{output}}" to compile_commands.json with a space before the
substituted path; Chromium's Windows toolchain used that form until 155
switched to "/Fo$output". gen-clang-tidy-ninja.py only handled the
joined form, so with the spaced one every clang-cl entry parsed to an
empty object path, every step got the output ".tidy", and siso rejected
the file with "multiple rules generates .tidy" (seen on the 42/43/44
backports of #53447). Accept both, and fail with the source file name if
an entry has no object path at all.

(cherry picked from commit 2e9208d)

Claude-Session: https://claude.ai/code/session_01KsGbFEEncB9pNtHMRTPj5Z

Co-authored-by: Claude <[email protected]>
@trop trop Bot added merged/45-x-y PR was merged to the "45-x-y" branch. and removed in-flight/45-x-y labels Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y merged/45-x-y PR was merged to the "45-x-y" branch. semver/none

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants