microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.53k stars 1.56k forks source link

Failed to query default include paths for use with compile_commands.json #1608

Closed 3v1n0 closed 6 years ago

3v1n0 commented 6 years ago

Running vscode in ubuntu 16.04 (from snap package), when providing my compile_commands.json this extension complains about that, with no other infos.

So I can't really debug it (nor I can't find where this is emitted from, I only notice is in bin/Microsoft.VSCode.CPP.Extension.linux

This is weird, since clangd doesn't seem to complain about that when using vscode-clang.

Not sure if this is related, but I'm also having #1202 otherwise, but my includes look fine

gcc -Wp,-v -E -xc -x c++ /dev/null
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/5
 /usr/include/x86_64-linux-gnu/c++/5
 /usr/include/c++/5/backward
 /usr/lib/gcc/x86_64-linux-gnu/5/include
 /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
# 1 "/dev/null"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "/dev/null"

I've now noticed that I was getting a similar error an broken installation of clangd that I had locally, once I've properly installed the clang libraries, clangd worked fine. This is not still happening for this extension though, and it tries to load a definition where it should not:

immagine

sean-mcmanus commented 6 years ago

@FreddieChopin We found a repro in the chromium source code, and a 1 line change that fixes that case (not sure if it fixes all the repros though), but I'm waiting to hear back from the VC++ team on when they expect a better fix or if that fix is good enough. UPDATE: The 1 line fix was bad, but the VC++ team thinks they know how to fix the root cause soon.

sean-mcmanus commented 6 years ago

@FreddieChopin The VC++ team just fixed it. We'll try to get it into 0.17.1.

FreddieChopin commented 6 years ago

OK, great. I'm looking forward to testing the fix (;

sean-mcmanus commented 6 years ago

@FreddieChopin 0.17.1 should have the "have_member_access_from_class_scope" fix...unless you're hitting a different root cause from what we reproed and fixed.