-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Query of clang-cl
compiler fails with pre-release v17
#11207
Comments
Hi @jineens . The error you are seeing appears to be due to failing to 'query' your compiler (for system include paths and system defines). It's falling back to defaults, separately for each file in your compile_commands.json, which is why you're seeing duplicate messages. Note that use of In your case, your We don't currently support You may be able to work around the issue by specifying a For more clarify, you might want to set |
I linked the logs with debug in language_server_logging.txt in the bug.
I think at least some of the issue is about clang-cl, if I change it to cl.exe I get much less errors, and it looks like the args passed to clang-cl aren’t recognized, because the first issue is that compilerPath can’t be used and so it defaults back to cl.exe ☹
So as far as I can tell, the compilerPath can’t override compile_commands.json because by the time the parser gets there, it’s given up on clang-cl.
Jineen
Excerpt:
Querying compiler for default C++ language standard using command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe /clang:-xc++ /clang:-E /clang:-dM nul
Querying compiler for default C++ language standard using command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe /clang:-xc++ /clang:-E /clang:-dM /dev/null
Detected language standard version: c++98
Querying compiler's default target using command line: "D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe" /clang:-dumpmachine
Compiler returned default target value: x86_64-pc-windows-msvc
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=c++20 -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=c++2a -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=c++17 -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=c++1z -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=c++14 -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=c++1y -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=c++11 -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=c++0x -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=c++03 -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=c++98 -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu++23 -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu++2b -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu++20 -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu++2a -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu++17 -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu++1z -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu++14 -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu++1y -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu++11 -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu++0x -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu++03 -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu++98 -m64 -Wp,-v -E -dM -x c++ nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -m64 -Wp,-v -E -dM -x c++ nul
Failed to query compiler. Falling back to 32-bit intelliSenseMode.
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -m32 -Wp,-v -E -dM -x c++ nul
Failed to query compiler. Falling back to no bitness.
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -Wp,-v -E -dM -x c++ nul
clang-cl: warning: unknown argument ignored in clang-cl: '-dM' [-Wunknown-argument]
clang-cl: warning: unknown argument ignored in clang-cl: '-x' [-Wunknown-argument]
clang-cl: error: no such file or directory: 'c++'
Attempting to get defaults from C++ compiler in "compilerPath" property: 'D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe'
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=c17 -m64 -Wp,-v -E -dM -x c nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=c11 -m64 -Wp,-v -E -dM -x c nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=c99 -m64 -Wp,-v -E -dM -x c nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=c89 -m64 -Wp,-v -E -dM -x c nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu23 -m64 -Wp,-v -E -dM -x c nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu2x -m64 -Wp,-v -E -dM -x c nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu18 -m64 -Wp,-v -E -dM -x c nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu17 -m64 -Wp,-v -E -dM -x c nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu11 -m64 -Wp,-v -E -dM -x c nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu1x -m64 -Wp,-v -E -dM -x c nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu99 -m64 -Wp,-v -E -dM -x c nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu9x -m64 -Wp,-v -E -dM -x c nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -std=gnu89 -m64 -Wp,-v -E -dM -x c nul
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -m64 -Wp,-v -E -dM -x c nul
Failed to query compiler. Falling back to 32-bit intelliSenseMode.
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -m32 -Wp,-v -E -dM -x c nul
Failed to query compiler. Falling back to no bitness.
Compiler query command line: D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe -Wp,-v -E -dM -x c nul
clang-cl: warning: unknown argument ignored in clang-cl: '-dM' [-Wunknown-argument]
clang-cl: warning: unknown argument ignored in clang-cl: '-x' [-Wunknown-argument]
clang-cl: error: no such file or directory: 'c'
Attempting to get defaults from C compiler in "compilerPath" property: 'D:\purple\src/third_party/llvm-build/Release+Asserts/bin/clang-cl.exe'
From: Colen Garoutte-Carson ***@***.***>
Sent: Monday, July 17, 2023 2:03 PM
To: microsoft/vscode-cpptools ***@***.***>
Cc: Mention ***@***.***>; Author ***@***.***>
Subject: Re: [microsoft/vscode-cpptools] Intellisense: cannot get error-squiggles to work; intellisense is convinced we're in c++99 so it can't find std::string; (Issue #11207)
Hi @jineens<https://github.com/jineens> .
The error you are seeing appears to be due to failing to 'query' your compiler (for system include paths and system defines). It's falling back to defaults, separately for each file in your compile_commands.json, which is why you're seeing duplicate messages.
Note that use of compileCommands overrides all other fields in your c_cpp_properties.json, except for the compilerPath, which overrides the compiler(s) used in compile_commands.json.
In your case, your compile_commands.json uses gomacc.exe. which appears to accept arguments similar to ccache, in that it's passed a command line with the actual compiler as the first argument. As a result, the compilerPath specified is replacing gomacc.exe and being passed the path to clang-cl.exe as an argument. Passing that to clang-cl.exe is likely causing it to return an error instead of the expected output.
We don't currently support gomacc, but we do support ccache, and could likely extend that support to gomacc. Would you like to use this issue as a feature request to track adding support for gomacc?
You may be able to work around the issue by specifying a compilerPath that refers to a bat/cmd file that simply strips the first argument passed to it (clang-cl.exe) and passes the remaining arguments to that.
For more clarify, you might want to set "C_Cpp.loggingLevel": "Debug" and check the C/C++ output channel for the command lines it's using to query your compiler.
—
Reply to this email directly, view it on GitHub<#11207 (comment)> or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKS4N5XYA3PGXMFMRMDL4RDXQWSAVBFKMF2HI4TJMJ2XIZLTSOBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDUOJ2WLJDOMFWWLLTXMF2GG2C7MFRXI2LWNF2HTAVFOZQWY5LFUVUXG43VMWSG4YLNMWVXI2DSMVQWIX3UPFYGLLDTOVRGUZLDORPXI6LQMWWES43TOVSUG33NNVSW45FGORXXA2LDOOJIFJDUPFYGLKTSMVYG643JORXXE6NFOZQWY5LFVA2TIOBQGAZTINUCUR2HS4DFUVUXG43VMWSXMYLMOVS2UMJYGA4DKOBYHA2TJJ3UOJUWOZ3FOKTGG4TFMF2GK>.
You are receiving this email because you were mentioned.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
This appears to be related to use of a |
clang-cl
compiler fails with pre-release v17
Update: This appears to be related to our use of |
Fix available in pre-release https://github.com/microsoft/vscode-cpptools/releases/tag/v1.17.0. |
Fixed in release version https://github.com/microsoft/vscode-cpptools/releases/tag/v1.17.2. |
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
Error squiggles do not work, I think this is because the build configuration does not work with clang-cl, but I don't know what's going on there either. Regular intellisense (definition lookup, auto complete, etc) works fine.
languate_server_logging.txt
diagnostics_logging.txt
Configuration and Logs
Other Extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: