-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clang-tidy broken with llvm v19.1.3 #196344
Comments
I get the same errors when I run clang-tidy from pip (latest version is 19.1.0) when brew llvm 19.1.3 is installed. |
Oh, that's annoying. Looks like As a workaround, try
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
For the
|
This seems to be why:
It doesn't know where the driver is, so it can't resolve the path to the config file. |
This comment was marked as resolved.
This comment was marked as resolved.
Not quite, since In any case, we also do set |
LLVM is designed to be relocatable so it does not bake in install prefixes. |
@Congyuwang, I think your issue should have been fixed by #197410. You'll need to |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
The missing Patchdiff --git a/clang/lib/Tooling/CompilationDatabase.cpp b/clang/lib/Tooling/CompilationDatabase.cpp
index af18194ae0fe..493d9657f988 100644
--- a/clang/lib/Tooling/CompilationDatabase.cpp
+++ b/clang/lib/Tooling/CompilationDatabase.cpp
@@ -251,18 +251,16 @@ static bool stripPositionalArgs(std::vector<const char *> Args,
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()),
&*DiagOpts, &DiagClient, false);
- // The clang executable path isn't required since the jobs the driver builds
- // will not be executed.
- std::unique_ptr<driver::Driver> NewDriver(new driver::Driver(
- /* ClangExecutable= */ "", llvm::sys::getDefaultTargetTriple(),
- Diagnostics));
- NewDriver->setCheckInputsExist(false);
-
// This becomes the new argv[0]. The value is used to detect libc++ include
// dirs on Mac, it isn't used for other platforms.
std::string Argv0 = GetClangToolCommand();
Args.insert(Args.begin(), Argv0.c_str());
+ std::unique_ptr<driver::Driver> NewDriver(new driver::Driver(
+ Argv0, llvm::sys::getDefaultTargetTriple(),
+ Diagnostics));
+ NewDriver->setCheckInputsExist(false);
+
// By adding -c, we force the driver to treat compilation as the last phase.
// It will then issue warnings via Diagnostics about un-used options that
// would have been used for linking. If the user provided a compiler name as Unfortunately, this produces different errors, and doesn't seem to change the include path: clang-tidy helloworld.cpp -- -v
Weirdly enough, dropping the clang-tidy helloworld.cpp
But the source of all these errors should be the same. |
Ah, that'll be because the config files aren't loaded until https://github.com/llvm/llvm-project/blob/0c21ed48f40b2a6e3aa7e5d1873cf2455e847786/clang/lib/Driver/Driver.cpp#L1249-L1256. Edit: No, I don't think that's it, since |
Ah, wait. I forgot to add the right config file in the configured location. If I create one with the appropriate
succeeds. But dropping the |
If you try to target a macOS version that is older than the host machine, our config files will point to an SDK that is likely not available on the host.[^1] We can fix this by defaulting to the unversioned SDK in these cases. [^1]: See, for example, #196344 (comment)
If you try to target a macOS version that is older than the host machine, our config files will point to an SDK that is likely not available on the host.[^1] We can fix this by defaulting to the unversioned SDK in these cases. [^1]: See, for example, #196344 (comment)
If you try to target a macOS version that is older than the host machine, our config files will point to an SDK that is likely not available on the host.[^1] We can fix this by defaulting to the unversioned SDK in these cases. [^1]: See, for example, #196344 (comment)
If you try to target a macOS version that is older than the host machine, our config files will point to an SDK that is likely not available on the host.[^1] We can fix this by defaulting to the unversioned SDK in these cases. [^1]: See, for example, #196344 (comment)
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
clang-tidy is no longer finding system headers since the llvm 19.1.3 update (#196094)
What happened (include all command output)?
What did you expect to happen?
Using llvm 19.1.2 formula, the output is:
(Some warnings but no error finding <iostream>).
Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: