-
Notifications
You must be signed in to change notification settings - Fork 162
Errors using cquery on Windows #460
Comments
Please ignore the random spaces in the pastes, copying from PowerShell is awful. |
This is weird. The compiler driver is missing in the list of https://github.com/cquery-project/cquery/blob/master/src/clang_translation_unit.cc#L88 https://github.com/cquery-project/cquery/blob/master/src/project.cc#L147 Is the compiler driver |
See ycm-core/ycmd#789, you may need to have |
Okay, so I got a bit further. Using Passing extra
However, @MaskRay is also correct, it is bizarre that the arguments don't have the compile driver itself (e.g.
So far with this I can properly keep all the arguments, and replace Another problem is that I have an argument, Similarly, cquery assumes the compile driver is clang, not clang in cl-mode. So it adds the arguments Finally, the Windows absolute-path logic assumes the paths always use |
Indeed. Ah man but I want to get this working so bad since pretty much nothing else works with Mesos well. Especially on Windows. |
I actually want to remove these The compiler driver detection logic may be replaced by detecting if the first few arguments are executable. I wonder if We may add an option to invoke an external script to give us the processed How does |
You may also use emacs-cquery locates the project root with |
Please add the support for Windows |
I am not sure if that's a good idea. Last year I had a project for which I intentionally supplied
What about the following:
|
I think we are on the same page :) Before yesterday, cquery adds
The "Strip all arguments consisting the compiler command," logic is used to support goma or other compiler scheduler. |
Re:
Produce this error:
Re: compiledb
This could be interesting, given this extension. That said, I'm happy to use Ninja and therefore CMake's But I'll also try a compiledb. It might work better. |
At the cost of extra 3 lines, e15f57f, These should work.
[
{ "arguments": [ "clang-cl", "/Iinc", "a.cc" ], "directory": "/tmp/c", "file": "a.cc" }
] Please add support for Windows for this commit eadc53a and use |
Welcome to discuss Windows support in https://gitter.im/cquery-project/Lobby Also see #501 |
That's not correct. |
I guess cl mode takes |
Exactly this. |
Sorry, I had to put this on hold for a bit. I'll try this out next. I really want to get this working. Ironically I need to implement the same semantics here as in Mesos. Should be doing it this week. |
Note that CL driver support is relatively new and has not seen much use, so bugs are to be expected. Someone should report the |
Back to the original topic of parsing command line, yes it's quite hard and annoying. @andschwa Ycmd isn't as feature rich, but maybe you'd have less troubles getting it to work with your project. @MaskRay I hope you won't mind me "promoting" ycmd. |
#501 Changes cquery to do the same. Has ycmd had any issues with this approach? |
Not at all. At least not with the absolute paths part of the code. Ycmd is more aggressive when it comes to sanitising flags. It will remove all positional parameters that are not include paths. This caused some issues with recognising when |
That's fine :) |
Thanks @jacobdufault for implementing |
Sure :) |
@MaskRay With the latest version of cquery (built with bundled Clang 6.0.0 after reading #219), this is now working for me with Mesos on Windows. I am so happy. I can jump to definitions, find references, have syntax errors highlighted, preprocessor guards are greyed, completions are available, the works! I'm sorry I wasn't more helpful. I think where I left off was trying to get cquery built with my own system clang, and then llvm-config wasn't working (and 6.0.0 wasn't bundle yet... or even released), and I had to get back to work. I saw several things go in that I'd (sort of) fixed in a WIP branch I never posted :( But anyway, thank you all. This is f***ing fantastic. |
Oh, and my setup is just using Ninja to generate a |
:), cquery has had some quality-of-life improvements for windows recently (such as automatically discovering system include headers). You may still run into some issues with vscode opening duplicate files with different path casing. |
Hello,
I am trying to get
cquery
up and running for Mesos on Windows. I've succesfully builtcquery
and got Emacs setup to use it; and I have Mesos successfully building with Ninja on Windows (which lets me use the CMake generatedcompile_commands.json
. However, whencquery
tries to index one of my files, I get this error:I've tried doing what it said, and under
clang++.exe
directly, it fails because the syntax iscl.exe
syntax. (Note: I cannot compile the whole project withclang
on Windows, some our dependencies e.g. GoogleTest don't support it, but the Mesos sources themselves compile withclang
on other platforms).Running the same arguments under
clang-cl.exe
gets me a bit further (after putting double quotes around the paths because the embedded dashes otherwise cause more syntax errors), and finally I got to this error and am stumped:There is only one source file specified, so the error doesn't make sense to me.
Has anyone gotten
cquery
to work on Windows with a CMake-generated Ninja-driven MSVC project?The text was updated successfully, but these errors were encountered: