On Wednesday 04 September 2013 at 09:10:00, Philip wrote:
On 09/04/2013 08:40 AM, Ivan Shapovalov wrote:
On Wednesday 04 September 2013 at 15:31:32, Alexandre wrote:
On Sep 4, 2013 3:15 PM, "Ivan Shapovalov" <intelfx100@gmail.com> wrote:
On Wednesday 04 September 2013 at 07:47:29, Philip wrote:
Hi Alexandre,
Wouldn't it be possible in the PKGBUILD to use sed to remove /opt/android-sdk from the $PATH and export the PATH again?
Regards, Philip
On 09/04/2013 04:21 AM, Alexandre Ferrando wrote:
First of all, excuse me if this is not the appropriate place for this issue, didn't know where it could fit better.
Now, the issue.
As said in the title, vim-youcompleteme-git [ 0 ] does not build when android-studio [ 1 ] is installed throwing this error:
Linking CXX shared library /dev/shm/vim-youcompleteme-git/src/YouCompleteMe/python/ycm_core.so
/opt/android-sdk/build-tools/18.0.1/libclang.so: could not read symbols:
File in wrong format collect2: error: ld returned 1 exit status make[3]: *** [/dev/shm/vim-youcompleteme-git/src/YouCompleteMe/python/ycm_core.so]
Error 1 make[2]: *** [ycm/CMakeFiles/ycm_core.dir/all] Error 2
make[1]: *** [ycm/CMakeFiles/ycm_core.dir/rule] Error 2 make: *** [ycm_core] Error 2 ==> ERROR: A failure occurred in build(). Aborting...
This happens because android-studio adds /opt/android-sdk to the PATH.
Building in a clean chroot or without /opt/android-sdk added to the PATH or android-studio uninstalled is ok.
This, however, does not seem the ideal situation.
I don't know if other packages are affected by this as well because I can't think of another package that links against libclang.so at the moment, but, in this case, what could be done to solve it rather than using workarounds as mentioned?
Thank you in advance
[ 0 ] https://aur.archlinux.org/packages/vim-youcompleteme-git/ [ 1 ] https://aur.archlinux.org/packages/android-studio/
I'd suggest just resetting the PATH to "/usr/local/sbin:/usr/local/bin:/usr/bin", which seems to be the sane default on all uptodate Arch installations.
However, I can see that Android SDK/NDK add their entries to the end of PATH, and AFAIK entries are sorted by priority, so something should be wrong...
-- // intelfx
That's exactly what bothers me. In my PATH the Android stuff is after the /usr/lib, so why is it linking against the clang.so in /opt?
Any idea on how to find the culprit?
Actually, I find it odd that it tries to find a *library* in an *executable* directory.
I did not look at the CMakeLists.txt for the project itself, but I guess it's buried deep there (or it could be CMake's own logic, FWIW).
Just reset the PATH. :)
I think PATH is for executables and not libraries. maybe looking into what LD_LIBRARY_PATH does or the output of ldconfig -p | grep clang Also look at the files /etc/ld.so.conf /etc/ld.so.conf.d/* I've seen cmake or configure scripts having there own way of finding libraries to link to. I have had to do something like this a couple of times. export LIBPNG_CFLAGS="-I/usr/include/libpng16" export LIBPNG_LDFLAGS="-L/usr/lib -lpng16" I hope this gives you a little idea of what to search for.
Alexandre says that the problem is fixed by removing /opt/android-sdk from PATH, so it really seems like some custom logic in project's CMakeLists.txt or in CMake itself. I suggested to set a clean PATH as that's easier than to fiddle with the project's build system. -- // intelfx