================
@@ -1,3 +1,3 @@
-// RUN: clang-tidy -checks=-*,google-explicit-constructor %s 2>&1 | FileCheck 
%s
+// RUN: clang-tidy -checks=-*,google-explicit-constructor %s -- 2>&1 | 
FileCheck %s
----------------
localspook wrote:

> Does it happen in CI or only locally?

I see it locally, and judging by [this 
comment](https://github.com/llvm/llvm-project/pull/182529#issuecomment-3935900528),
 it happens in CI on at least some buildbots.
> The "proper" fix could be a fake compiler_commands.json file in tests 
> subfolder.

I tried doing this, but ran into problems:

1. It doesn't fix any tests that run clang-tidy over temporary files created 
with `%t`, because those files are created somewhere in the build directory, 
not under `test/clang-tidy/`. We would need to somehow generate a 
`compile_commands.json` there too.
2. ClangTooling seems to not like fake `compile_commands.json`. Its precise 
behaviour is really confusing, so here's my best attempt to describe it. It 
seems to want at least one compile commands entry, which must be for a file 
(any file) that actually exists on disk, and it must be specified using an 
absolute path. If there's no such entry, it refuses to process any file and 
gives this error: 
https://github.com/llvm/llvm-project/blob/578ba5f3039e7a1e4e6f3a82891b3838823e37c2/clang/lib/Tooling/Tooling.cpp#L564-L567


> Can we add these workarounds/fix for this problem in a separate PR?

To make sure we're on the same page: these new failures are a direct 
consequence of this PR (before, we were exiting early, before performing the 
search for a `compile_commands.json`), so to me it makes sense to have them in 
this PR. Would you like me to add them in a separate PR anyway?

https://github.com/llvm/llvm-project/pull/194006
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to