rdnetto / YCM-Generator

Generates config files for YouCompleteMe (https://github.com/Valloric/YouCompleteMe)
GNU General Public License v3.0
917 stars 129 forks source link

Incompatibility with ccache #105

Open Rubonnek opened 7 years ago

Rubonnek commented 7 years ago

Hello.

Currently when I run

ycm_generator -v .

I get the following:

ycm_generator .
Running cmake in '/tmp/tmpki57op3w'...
$ cmake /path/to/my/project

And that's it. It stays there for more than half an hour and nothing happens until I cancel it.

I'm currently using the AUR package at: https://aur.archlinux.org/packages/ycm-generator-git

rdnetto commented 7 years ago

Can you reproduce this with the Clementine project? It's possible that there's something odd about your project that waits for input from stdin, etc.

Rubonnek commented 7 years ago

Yeah, I'm able to reproduce the problem with that project too.

liyinsg commented 7 years ago

Similar issue observed caused by ccache, here's the env_config

{'YCM_CONFIG_GEN_CC_PASSTHROUGH': '/usr/lib/ccache/clang', 'CXX': 'clang++', 'YCM_CONFIG_GEN_CC_LOG': '/tmp/tmpWpiUjT', 'YCM_CONFIG_GEN_CXX_PASSTHROUGH': '/usr/lib/ccache/clang++', 'YCM_CONFIG_GEN_CXX_LOG': '/tmp/tmp5da3BG', 'HOME': '/home/ly', 'CC': 'clang', 'PATH': '/usr/local/etc/vim/plugged/YCM-Generator/fake-toolchain/Unix:/usr/local/etc/vim/plugged/fzf/bin:/usr/local/opt/android-sdk/platform-tools:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin'}
Rubonnek commented 7 years ago

@liyinsg That was it! I just uninstalled ccache and now ycm_generator works!

liyinsg commented 7 years ago

@Rubonnek No need to uninstall ccache, currently my workaround is create a wrapper script calling $YCMGENPATH/config_gen.py -v -c /usr/bin/clang++

rdnetto commented 7 years ago

Ahhh, that explains it. During the configure phase, we invoke the underlying compiler (CC/CXX) since cmake will compile some test files to determine the compiler's behaviour/functionality. Since ccache was also installed, it was getting invoked instead, and blocking for some reason.

Rubonnek commented 7 years ago

@liyinsg Thanks a lot! That works too.