YCM-Generator icon indicating copy to clipboard operation
YCM-Generator copied to clipboard

Incompatibility with ccache

Open Rubonnek opened this issue 8 years ago • 7 comments

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

Rubonnek avatar Jul 09 '17 19:07 Rubonnek

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.

rdnetto avatar Jul 12 '17 09:07 rdnetto

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

Rubonnek avatar Jul 12 '17 15:07 Rubonnek

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'}

liyinsg avatar Jul 18 '17 02:07 liyinsg

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

Rubonnek avatar Jul 18 '17 03:07 Rubonnek

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

liyinsg avatar Jul 18 '17 03:07 liyinsg

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.

rdnetto avatar Jul 18 '17 09:07 rdnetto

@liyinsg Thanks a lot! That works too.

Rubonnek avatar Jul 19 '17 03:07 Rubonnek