|
|
DescriptionYouCompleteMe workaround: explicitly include system include dirs
This patch is a workaround for
https://github.com/Valloric/YouCompleteMe/issues/303
It fixes various issues where standard headers cannot be found, such as:
https://groups.google.com/a/google.com/d/msg/ycm-users/TF9dqx0G0N8/bUQPR0jON80J
Committed: https://crrev.com/8d6edba93eabb17429944ab6ea0bf302daf1c9ff
Cr-Commit-Position: refs/heads/master@{#312363}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Avoid needless isdir("") #Messages
Total messages: 25 (8 generated)
johnme@chromium.org changed reviewers: + dzhioev@chromium.org
eroman@chromium.org changed reviewers: + eroman@chromium.org
LGTM Also cc-ed Nico who would actually understand the clang side of this. Seems odd that libclang wouldn't do the right thing automatically. I expect this approach will be incomplete when switching to -std=c++11 or some such thing, but looks like an improvement. https://codereview.chromium.org/842053003/diff/1/tools/vim/chromium.ycm_extra... File tools/vim/chromium.ycm_extra_conf.py (right): https://codereview.chromium.org/842053003/diff/1/tools/vim/chromium.ycm_extra... tools/vim/chromium.ycm_extra_conf.py:67: if os.path.isdir(path): You may want to skip if len(path) == 0 (Haven't though through the regexp enough, but might be possible with the splitting and whitespace stripping?)
thakis@chromium.org changed reviewers: + thakis@chromium.org
Wow, this is horrible. From looking at the upstream bug, it sounds like nobody has any idea why this isn't working. I'll try to make some time to figure that out.
The CQ bit was checked by johnme@chromium.org
The CQ bit was unchecked by johnme@chromium.org
The CQ bit was checked by johnme@chromium.org
The CQ bit was unchecked by johnme@chromium.org
Nico wrote: > Wow, this is horrible. From looking at the upstream bug, it sounds like nobody > has any idea why this isn't working. I'll try to make some time to figure that > out. Thanks - sounds like this'd be helpful to other users of libclang as well. https://codereview.chromium.org/842053003/diff/1/tools/vim/chromium.ycm_extra... File tools/vim/chromium.ycm_extra_conf.py (right): https://codereview.chromium.org/842053003/diff/1/tools/vim/chromium.ycm_extra... tools/vim/chromium.ycm_extra_conf.py:67: if os.path.isdir(path): On 2015/01/21 02:33:00, eroman wrote: > You may want to skip if len(path) == 0 > > (Haven't though through the regexp enough, but might be possible with the > splitting and whitespace stripping?) It was possible, but os.path.isdir('') returns False so it doesn't matter. I've tweaked the regex and replaced split('\n') with splitlines() so we won't needlessly call isdir with an empty string (and to avoid hardcoding unix line endings).
The CQ bit was checked by johnme@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/842053003/20001
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/8d6edba93eabb17429944ab6ea0bf302daf1c9ff Cr-Commit-Position: refs/heads/master@{#312363}
Message was sent while issue was closed.
Hmm, I get the following error when including these extra headers: use of undeclared identifier '__builtin_ia32_addcarry_u32' In src/third_party/llvm-build/Release+Asserts/lib/clang/3.6.0/include/adxintrin.h:55
Message was sent while issue was closed.
On 2015/02/05 20:07:20, eroman wrote: > Hmm, I get the following error when including these extra headers: > > use of undeclared identifier '__builtin_ia32_addcarry_u32' > > In > src/third_party/llvm-build/Release+Asserts/lib/clang/3.6.0/include/adxintrin.h:55 Can you include the relevant part of your `echo | clang -v -E -x c++ -` output? e.g. I get: #include "..." search starts here: #include <...> search starts here: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8 /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8 /usr/local/include /usr/bin/../lib/clang/3.4/include /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/include /usr/include/x86_64-linux-gnu /usr/include End of search list. And does this happen for all files?
Message was sent while issue was closed.
On Thu, Feb 5, 2015 at 12:42 PM, <johnme@chromium.org> wrote: > On 2015/02/05 20:07:20, eroman wrote: > >> Hmm, I get the following error when including these extra headers: >> > > use of undeclared identifier '__builtin_ia32_addcarry_u32' >> > > In >> > > src/third_party/llvm-build/Release+Asserts/lib/clang/3.6. > 0/include/adxintrin.h:55 > > Can you include the relevant part of your `echo | clang -v -E -x c++ -` > output? > http://pastebin.com/aXDxkZxd > e.g. I get: > > #include "..." search starts here: > #include <...> search starts here: > /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8 > /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../ > include/c++/4.8/backward > > /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../ > include/x86_64-linux-gnu/c++/4.8 > /usr/local/include > /usr/bin/../lib/clang/3.4/include > /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/include > /usr/include/x86_64-linux-gnu > /usr/include > End of search list. > > And does this happen for all files? > Interesting. Not sure exactly where this is coming from. I was using a remapping to force YCM refresh: nnoremap <leader>y :YcmForceCompileAndDiagnostics<CR><CR>:lfirst<CR> It is when I run :lfirst after this that I see the error. oddly also not seeing it when i open the quickfix list, unless I am misusing quickfix.. > > https://codereview.chromium.org/842053003/ > To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
Message was sent while issue was closed.
On 2015/02/05 20:58:34, eroman wrote: > On Thu, Feb 5, 2015 at 12:42 PM, <mailto:johnme@chromium.org> wrote: > > > On 2015/02/05 20:07:20, eroman wrote: > > > >> Hmm, I get the following error when including these extra headers: > >> > > > > use of undeclared identifier '__builtin_ia32_addcarry_u32' > >> > > > > In > >> > > > > src/third_party/llvm-build/Release+Asserts/lib/clang/3.6. > > 0/include/adxintrin.h:55 > > > > Can you include the relevant part of your `echo | clang -v -E -x c++ -` > > output? > > > > http://pastebin.com/aXDxkZxd > Wow, that's a much more recent version of Clang. I'm on 3.4. Full output: http://pastebin.com/svarMNiM It seems the main difference is that you have this directory included: /work/src/chromegit/src/third_party/llvm-build/Release+Asserts/bin/../lib/clang/3.6.0/include And indeed, that's where your error message is coming from. Do you know what that directory is? Do you self-build clang?
Message was sent while issue was closed.
No clue. I am using the clang that is bundled with chromium. And libclang in use by YCM was downloaded as part of running cd ~/.vim/bundle/YouCompleteMe ./install.sh --clang-completer On Thu, Feb 5, 2015 at 1:03 PM, <johnme@chromium.org> wrote: > On 2015/02/05 20:58:34, eroman wrote: > >> On Thu, Feb 5, 2015 at 12:42 PM, <mailto:johnme@chromium.org> wrote: >> > > > On 2015/02/05 20:07:20, eroman wrote: >> > >> >> Hmm, I get the following error when including these extra headers: >> >> >> > >> > use of undeclared identifier '__builtin_ia32_addcarry_u32' >> >> >> > >> > In >> >> >> > >> > src/third_party/llvm-build/Release+Asserts/lib/clang/3.6. >> > 0/include/adxintrin.h:55 >> > >> > Can you include the relevant part of your `echo | clang -v -E -x c++ -` >> > output? >> > >> > > http://pastebin.com/aXDxkZxd >> > > > Wow, that's a much more recent version of Clang. I'm on 3.4. Full output: > http://pastebin.com/svarMNiM > > It seems the main difference is that you have this directory included: > > /work/src/chromegit/src/third_party/llvm-build/Release+ > Asserts/bin/../lib/clang/3.6.0/include > > And indeed, that's where your error message is coming from. Do you know > what > that directory is? Do you self-build clang? > > https://codereview.chromium.org/842053003/ > To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
Message was sent while issue was closed.
On 2015/02/05 21:03:35, johnme wrote: > On 2015/02/05 20:58:34, eroman wrote: > > On Thu, Feb 5, 2015 at 12:42 PM, <mailto:johnme@chromium.org> wrote: > > > > > On 2015/02/05 20:07:20, eroman wrote: > > > > > >> Hmm, I get the following error when including these extra headers: > > >> > > > > > > use of undeclared identifier '__builtin_ia32_addcarry_u32' > > >> > > > > > > In > > >> > > > > > > src/third_party/llvm-build/Release+Asserts/lib/clang/3.6. > > > 0/include/adxintrin.h:55 > > > > > > Can you include the relevant part of your `echo | clang -v -E -x c++ -` > > > output? > > > > > > > http://pastebin.com/aXDxkZxd > > > > Wow, that's a much more recent version of Clang. I'm on 3.4. Full output: > http://pastebin.com/svarMNiM > > It seems the main difference is that you have this directory included: > > /work/src/chromegit/src/third_party/llvm-build/Release+Asserts/bin/../lib/clang/3.6.0/include > > And indeed, that's where your error message is coming from. Do you know what > that directory is? Do you self-build clang? That's the clang binary that every engineer on Chromium uses. (Except on Windows. On Android it's only used for host builds.)
Message was sent while issue was closed.
On 2015/02/05 21:14:51, Nico wrote: > On 2015/02/05 21:03:35, johnme wrote: > /work/src/chromegit/src/third_party/llvm-build/Release+Asserts/bin/../lib/clang/3.6.0/include > > That's the clang binary that every engineer on Chromium uses. (Except on > Windows. On Android it's only used for host builds.) Which clang is YouCompleteMe using? My patch just uses whichever clang is on the PATH*, when getting the include directories; if that's different from the clang that YCM uses it would make sense for things to go wrong. *: (as observed from that Python script, so it may or may not include paths added in .bashrc)
Message was sent while issue was closed.
Maybe the ycm config should point ycm at our clang? …I think ycm maybe needs a libclang.so, not the actual compiler, and I think we don't ship that with chromium's clang though. (I don't use YCM myself and don't use it much, so I have little knowledge on what to do here)
Message was sent while issue was closed.
On 2015/02/05 21:21:11, johnme wrote: > On 2015/02/05 21:14:51, Nico wrote: > > On 2015/02/05 21:03:35, johnme wrote: > > > /work/src/chromegit/src/third_party/llvm-build/Release+Asserts/bin/../lib/clang/3.6.0/include > > > > That's the clang binary that every engineer on Chromium uses. (Except on > > Windows. On Android it's only used for host builds.) > > Which clang is YouCompleteMe using? My patch just uses whichever clang is on the > PATH*, when getting the include directories; if that's different from the clang > that YCM uses it would make sense for things to go wrong. > > *: (as observed from that Python script, so it may or may not include paths > added in .bashrc) By default YouCompleteMe downloads prebuild copy of libclang.so and uses it for completion.
Message was sent while issue was closed.
On 2015/02/06 12:45:32, dzhioev wrote: > On 2015/02/05 21:21:11, johnme wrote: > > On 2015/02/05 21:14:51, Nico wrote: > > > On 2015/02/05 21:03:35, johnme wrote: > > > > > > /work/src/chromegit/src/third_party/llvm-build/Release+Asserts/bin/../lib/clang/3.6.0/include > > > > > > That's the clang binary that every engineer on Chromium uses. (Except on > > > Windows. On Android it's only used for host builds.) > > > > Which clang is YouCompleteMe using? My patch just uses whichever clang is on > the > > PATH*, when getting the include directories; if that's different from the > clang > > that YCM uses it would make sense for things to go wrong. > > > > *: (as observed from that Python script, so it may or may not include paths > > added in .bashrc) > > By default YouCompleteMe downloads prebuild copy of libclang.so and uses it for > completion. Version of libclang is specified in YCM's CMakeFile. See here: https://github.com/Valloric/ycmd/blob/master/cpp/ycm/CMakeLists.txt#L56 |