Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Issue 1137303005: [Vim/YCM] Calculate system library paths based on Clang++ binary path. (Closed)

Created:
5 years, 7 months ago by asanka
Modified:
5 years, 6 months ago
Reviewers:
eroman
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Vim/YCM] Calculate system library paths based on Clang++ binary path. The YouCompleteMe configuration still needs to determine the list of system include paths. The current chromium.ycm_extra_conf.py logic requires that the host machine has a 'clang' binary in its PATH that can yield this information. This change calculates the system include paths based on the clang++ binary used to compile the target file. It allows the use of wrappers (E.g. goma), by looking for a clang++ command in the first and second tokens in the compile command. It's still not perfect since the Clang library used by ycmd might be different, but it should work better than the current logic. BUG=none NOTRY=true Committed: https://crrev.com/01c39d08735ba762e1788d3ce4922d46f25c4028 Cr-Commit-Position: refs/heads/master@{#330409}

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : Switch to using shlex and look at first two tokens in commandline. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -13 lines) Patch
M tools/vim/chromium.ycm_extra_conf.py View 1 2 5 chunks +34 lines, -13 lines 0 comments Download

Messages

Total messages: 12 (2 generated)
asanka
5 years, 7 months ago (2015-05-18 17:42:11 UTC) #2
eroman
https://codereview.chromium.org/1137303005/diff/20001/tools/vim/chromium.ycm_extra_conf.py File tools/vim/chromium.ycm_extra_conf.py (right): https://codereview.chromium.org/1137303005/diff/20001/tools/vim/chromium.ycm_extra_conf.py#newcode213 tools/vim/chromium.ycm_extra_conf.py:213: clang_path = clang_line.split(' ')[0] This is too simplistic, the ...
5 years, 7 months ago (2015-05-18 17:56:42 UTC) #3
asanka
https://codereview.chromium.org/1137303005/diff/20001/tools/vim/chromium.ycm_extra_conf.py File tools/vim/chromium.ycm_extra_conf.py (right): https://codereview.chromium.org/1137303005/diff/20001/tools/vim/chromium.ycm_extra_conf.py#newcode213 tools/vim/chromium.ycm_extra_conf.py:213: clang_path = clang_line.split(' ')[0] On 2015/05/18 at 17:56:42, eroman ...
5 years, 7 months ago (2015-05-18 19:36:48 UTC) #4
eroman
LGTM. I suggest also describing the wrapper allowance in the CL description (might be helpful ...
5 years, 7 months ago (2015-05-18 20:21:13 UTC) #5
asanka
On 2015/05/18 at 20:21:13, eroman wrote: > LGTM. I suggest also describing the wrapper allowance ...
5 years, 7 months ago (2015-05-18 20:37:15 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1137303005/40001
5 years, 7 months ago (2015-05-18 20:41:10 UTC) #8
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 7 months ago (2015-05-18 20:47:19 UTC) #9
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/01c39d08735ba762e1788d3ce4922d46f25c4028 Cr-Commit-Position: refs/heads/master@{#330409}
5 years, 7 months ago (2015-05-18 22:42:43 UTC) #10
eroman
This is causing some problems for me (not able to find <stddef.h> for instance). With ...
5 years, 6 months ago (2015-05-30 00:30:18 UTC) #11
asanka
5 years, 6 months ago (2015-05-30 03:31:57 UTC) #12
Message was sent while issue was closed.
On 2015/05/30 at 00:30:18, eroman wrote:
> This is causing some problems for me (not able to find <stddef.h> for
instance).
> 
> With this patch I am getting only:
> 
> '-isystem', '/usr/lib/youcompleteme/third_party/ycmd/ycmd/../clang_includes'
> 
> Whereas before I was getting all of these:
> 
> '-isystem', '/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8',
> '-isystem',
'/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8',
> '-isystem',
'/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward',
> '-isystem', '/usr/local/include',
> '-isystem',
'/work/src/chromegit/src/third_party/llvm-build/Release+Asserts/bin/../lib/clang/3.7.0/include',
> '-isystem', '/usr/include/x86_64-linux-gnu',
> '-isystem', '/usr/include',
> '-isystem', '/usr/lib/youcompleteme/third_party/ycmd/ycmd/../clang_includes'
> 
> I haven't dug into where the problem lies exactly, however a brief
investigation reveals that
"/usr/lib/youcompleteme/third_party/ycmd/ycmd/../clang_includes" is not actually
a path for me, so I am guessing that is the problem. Interestingly this is the
internally packaged YCM (by YCM author no less), so not sure what is up with
that....

Is this for a file that ninja doesn't know about? Perhaps we can try 'clang++'
as a fallback option in case ninja doesn't give us a commandline.

Powered by Google App Engine
This is Rietveld 408576698