This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix test failure when it's built with compiler flags unknown by clang
ClosedPublic

Authored by xry111 on May 15 2023, 8:57 AM.

Details

Summary

If LLVM is built with a compiler other than clang, the compile_commands.json
file may contain compiler flags unknown by clang. When a clangd test is copied
into the build directory and checked, clangd will pick the unknown flag from
the file and cause a test failure. Create an empty compile_commands.json in
the test directory nested in the build directory to override it.

Diff Detail

Event Timeline

xry111 created this revision.May 15 2023, 8:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2023, 8:57 AM
xry111 requested review of this revision.May 15 2023, 8:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2023, 8:57 AM
thesamesam accepted this revision.May 15 2023, 7:55 PM

(I even struggled to find docs for the fix we used for clang-tidy, although it obviously works.)

Thank you!

This revision is now accepted and ready to land.May 15 2023, 7:55 PM
This revision was landed with ongoing or failed builds.May 15 2023, 7:56 PM
This revision was automatically updated to reflect the committed changes.
kadircet added a comment.EditedMay 15 2023, 11:47 PM

This broke buildbots because compile_commands.json being empty has other consequences.
Fixing forward in 9ffef0f24de0fc05b946e662a7b233a32ad058e3. Please don't land such infrastructure changes without approvals from code owners in the future.

Sure & thanks.

Hmm, I'd tested the change before creating this but it seems those tests are "UNSUPPORTED" on my system :(.