MarshallOfSound

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

Merged
Created: Sep 4, 2026, 10:01:58 PM
Merged: Sep 5, 2026, 3:58:17 AM
2 comments
Target: main

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

Backports

45-x-y
Pending
Waiting for a manual backport

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron