Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libtinfo.so.* missing in Arch Linux #778

Closed
bok opened this issue Jan 14, 2014 · 44 comments
Closed

libtinfo.so.* missing in Arch Linux #778

bok opened this issue Jan 14, 2014 · 44 comments

Comments

@bok
Copy link

bok commented Jan 14, 2014

In some distributions, like Arch Linux, libtinfo.so is compiled as a part of libncurses.so.

As a result, ycmd will not start:

on Arch Linux x86_64 up to date with YCM @ b1bba2e

Traceback (most recent call last):
  File "/home/apierlot/.vim/bundle/YouCompleteMe/python/ycm/server/ycmd.py", line 98, in <module>
    Main()
  File "/home/apierlot/.vim/bundle/YouCompleteMe/python/ycm/server/ycmd.py", line 87, in Main
    from ycm.server import handlers
  File "/home/apierlot/.vim/bundle/YouCompleteMe/python/ycm/server/../../ycm/server/handlers.py", line 30, in <module>
    str( e ) ) )
RuntimeError: Error importing ycm_core. Are you sure you have placed a version 3.2+ libclang.[so|dll|dylib] 
in folder "/home/apierlot/.vim/bundle/YouCompleteMe/python"? See the Installation Guide in the docs. 
Full error: libtinfo.so.5: cannot open shared object file: No such file or directory

see rust-lang/rust@597e96b for a possible fix.

@crepererum
Copy link

I had the same problem and fixed it by install a symlinked version via AUR. But it would be nice if YCM can provide some kind of fallback to libncurses.

@Valloric
Copy link
Member

I'm guessing libclang links to that lib; if the libclang downloaded by the install script is not good enough on your system, it's up to the user to provide one (compile clang etc).

@rpolasek
Copy link

a solution for gentoo users: re-emerge sys-libs/ncurses with tinfo use flag

@alexandernst
Copy link

@Valloric Why not fix the install.sh script instead? The change is as small as passing one extra argument

@ghost
Copy link

ghost commented Apr 18, 2014

I agree with alexandernst. I spent a few hours googling over this issue before I came across this. It would be a great help to us Arch users if we could get a fix for this or at least a heads up.

@Valloric
Copy link
Member

@alexandernst What exactly needs to be added? I'd love to see a pull request.

@alexandernst
Copy link

@Valloric Adding LLVM_OPTS="$LLVM_OPTS --disable-terminfo" to the build step should fix it, if I haven't misunderstood the bug.

MaryHal added a commit to MaryHal/vimconfig that referenced this issue May 15, 2014
Had to install libtinfo from AUR to fix update issue.
ycm-core/YouCompleteMe#778
@Houndie
Copy link

Houndie commented Jul 21, 2014

@Valloric I think your original advice (from January) was the best one. I came across this problem, and replacing the downloaded libclang.so with a symlink to /usr/lib/libclang.so solved the issue.

@Dieterbe
Copy link

@alexandernst I made this change:

--- a/install.sh
+++ b/install.sh
@@ -14,4 +14,7 @@ if command_exists python2; then
   PYTHON_BINARY=python2
 fi

+# https://github.com/Valloric/YouCompleteMe/issues/778
+export LLVM_OPTS="$LLVM_OPTS --disable-terminfo" 
+
 $PYTHON_BINARY "$SCRIPT_DIR/install.py" "$@" || exit $?

and then ran ./install.sh --clang-completer. this did not fix this for me.

@jacopoantonello
Copy link

Assuming that disabling terminfo works, the option seems to be LLVM_ENABLE_TERMINFO=OFF, but I'm not sure where this should be added. Perhaps somewhere in third_party/ycmd/cpp/ycm/CMakeLists.txt? Is YouCompleteMe actually building LLVM at all?

@vheon
Copy link
Contributor

vheon commented Apr 16, 2016

Is YouCompleteMe actually building LLVM at all?

No it doesn't. We use precompiled version of LLVM from the site. So if you actually need that option you should compile it yourself.

@oblitum
Copy link
Contributor

oblitum commented Apr 18, 2016

Just upgraded my Arch system and got into this. System's libtinfo now (from AUR) is version 6, and the legacy compatibility package is currently broken at this moment (https://aur.archlinux.org/packages/libtinfo-5). --system-libclang is also not working since current version of Clang for Arch is 3.7.

For reference:

With provided libclang:

Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/francisco/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/__main__.py", line 183, in <module>
    Main()
  File "/home/francisco/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/__main__.py", line 158, in Main
    extra_conf_store.CallGlobalExtraConfYcmCorePreloadIfExists()
  File "/home/francisco/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/extra_conf_store.py", line 73, in CallGlobalExtraConfYcmCorePreloadIfExists
    _CallGlobalExtraConfMethod( 'YcmCorePreload' )
  File "/home/francisco/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/extra_conf_store.py", line 91, in _CallGlobalExtraConfMethod
    module = Load( global_ycm_extra_conf, force = True )
  File "/home/francisco/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/extra_conf_store.py", line 149, in Load
    module = LoadPythonSource( _RandomName(), module_file )
  File "/home/francisco/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/utils.py", line 326, in LoadPythonSource
    return imp.load_source( name, pathname )
  File "/home/francisco/.ycm_extra_conf.py", line 2, in <module>
    import ycm_core
ImportError: libtinfo.so.5: cannot open shared object file: No such file or directory

Reason of error:

(ycm) ~/.v/p/YouCompleteMe ❯❯❯ readelf -d third_party/ycmd/libclang.so.3.8                                                                 swift-completer ✱ ◼

Dynamic section at offset 0x279b1b0 contains 37 entries:
  Tag        Type                         Name/Value
 0x0000000000000003 (PLTGOT)             0x279ffe8
 0x0000000000000002 (PLTRELSZ)           7224 (bytes)
 0x0000000000000017 (JMPREL)             0x30dd40
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000007 (RELA)               0x8568
 0x0000000000000008 (RELASZ)             3168216 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffff9 (RELACOUNT)          131761
 0x0000000000000006 (SYMTAB)             0x260
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000005 (STRTAB)             0x3b60
 0x000000000000000a (STRSZ)              14680 (bytes)
 0x000000006ffffef5 (GNU_HASH)           0x74b8
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libtinfo.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [ld-linux-x86-64.so.2]
 0x000000000000000e (SONAME)             Library soname: [libclang.so.3.8]
 0x000000000000000c (INIT)               0x30f978
 0x000000000000000d (FINI)               0x1c50498
 0x000000000000001a (FINI_ARRAY)         0x246d738
 0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)
 0x0000000000000019 (INIT_ARRAY)         0x246d740
 0x000000000000001b (INIT_ARRAYSZ)       1656 (bytes)
 0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib]
 0x000000006ffffff0 (VERSYM)             0x7ef8
 0x000000006ffffffc (VERDEF)             0x83b8
 0x000000006ffffffd (VERDEFNUM)          1
 0x000000006ffffffe (VERNEED)            0x83d4
 0x000000006fffffff (VERNEEDNUM)         7
 0x0000000000000000 (NULL)               0x0

After a --system-libclang installation:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/francisco/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/__main__.py", line 183, in <module>
    Main()
  File "/home/francisco/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/__main__.py", line 158, in Main
    extra_conf_store.CallGlobalExtraConfYcmCorePreloadIfExists()
  File "/home/francisco/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/extra_conf_store.py", line 73, in CallGlobalExtraConfYcmCorePreloadIfExists
    _CallGlobalExtraConfMethod( 'YcmCorePreload' )
  File "/home/francisco/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/extra_conf_store.py", line 91, in _CallGlobalExtraConfMethod
    module = Load( global_ycm_extra_conf, force = True )
  File "/home/francisco/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/extra_conf_store.py", line 149, in Load
    module = LoadPythonSource( _RandomName(), module_file )
  File "/home/francisco/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/utils.py", line 326, in LoadPythonSource
    return imp.load_source( name, pathname )
  File "/home/francisco/.ycm_extra_conf.py", line 2, in <module>
    import ycm_core
ImportError: /home/francisco/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycm_core.so: undefined symbol: clang_parseTranslationUnit2FullArgv

Reason of error:

(ycm) ~/.v/p/YouCompleteMe ❯❯❯ pacman -Qs clang                                                                                            swift-completer ✱ ◼
local/bear 2.1.3-1
    tool to generate compilation database for clang tooling
extra/clang 3.7.1-1
    C language family frontend for LLVM
extra/clang-tools-extra 3.7.1-1
    Extra tools built using Clang's tooling APIs

@oblitum
Copy link
Contributor

oblitum commented Apr 18, 2016

I've found a fix for libtinfo-5 installation problems related to GPG verification. This is the prelude recipe for successful YCM installation (without --system-libclang):

❯❯❯ sudo pacman-key --refresh-keys
❯❯❯ gpg --keyserver pgp.mit.edu --recv-keys C52048C0C0748FEE227D47A2702353E0F7E48EDB
❯❯❯ yaourt -S libtinfo-5

@krux02
Copy link

krux02 commented Apr 28, 2016

I also have this problem. @oblitum can you please leave a comment on what your three lines are supposed to do? I don't really like to blindly copy paste code from the internet in my command line.

@oblitum
Copy link
Contributor

oblitum commented Apr 28, 2016

@krux02 well, I more or less just copied and pasted too, and also, I don't like to do that, but they seem reasonably harmless. The first is just an update, the second add a key server I think, but it's on mit.edu, so, seem ok I guess, the other is just to install the old lib. So, all in all, it didn't scare me.

@fplust
Copy link

fplust commented Apr 28, 2016

@krux02 you can download the opensuse version prebuilt binary from llvm download page, and compile ycm with it. the opensuse version clang does not need the old libtinfo.

@krux02
Copy link

krux02 commented Apr 28, 2016

@fplust Ok, I am downloading it at the moment. Do I just need to replace the version in the ycm folder with the downloaded one? Will I have to redo it after each update?

@fplust
Copy link

fplust commented Apr 28, 2016

@krux02 you should not replace it, because the install script will check the hash code to make sure the downloaded one is a right one, so you have to follow the Full Installation Guide in readme.

@krux02
Copy link

krux02 commented Apr 28, 2016

I feel I spend more time fixing issues problems after it break yet again than actually using it productively.

@oblitum
Copy link
Contributor

oblitum commented Apr 28, 2016

@krux02 exactly what, there're many things here to point out, ArchLinux?, YCM?, Clang? :-D

@oblitum
Copy link
Contributor

oblitum commented Apr 28, 2016

You may also opt for the former solution, it's a no brainer... Execute the prelude since without it you're unable to get libtinfo-5 from AUR (the solution comes from there). After that, python2 ./install.py --your-completers-here, done.

@oblitum
Copy link
Contributor

oblitum commented Apr 28, 2016

Well, the guys on AUR are still battling over this, the mit.edu link may have become dead: https://aur.archlinux.org/packages/ncurses5-compat-libs.

@lbartoletti
Copy link

Same error on FreeBSD 10.3 with llvm37
Traceback (most recent call last): File "/usr/local/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/local/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/usr/home/Loic/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/__main__.py", line 183, in <module> Main() File "/usr/home/Loic/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/__main__.py", line 158, in Main extra_conf_store.CallGlobalExtraConfYcmCorePreloadIfExists() File "/usr/home/Loic/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/extra_conf_store.py", line 73, in CallGlobalExtraConfYcmCorePreloadIfExists _CallGlobalExtraConfMethod( 'YcmCorePreload' ) File "/usr/home/Loic/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/extra_conf_store.py", line 91, in _CallGlobalExtraConfMethod module = Load( global_ycm_extra_conf, force = True ) File "/usr/home/Loic/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/extra_conf_store.py", line 149, in Load module = LoadPythonSource( _RandomName(), module_file ) File "/usr/home/Loic/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/utils.py", line 358, in LoadPythonSource return imp.load_source( name, pathname ) File "/home/Loic/.vim/.ycm_extra_conf.py", line 3, in <module> import ycm_core ImportError: /usr/home/Loic/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycm_core.so: Undefined symbol "clang_parseTranslationUnit2FullArgv"

@krux02
Copy link

krux02 commented May 8, 2016

By the way, for me it works now, after I installed libtinfo-5.

@TheDataLeek
Copy link

Yep, that libtinfo-5 fix works great. Just worked for me from a non-system clang install. (Keepin thread alive for future people)

@theJian
Copy link

theJian commented Jul 13, 2016

Solved on Arch after installing ncurses5-compat-libs.
also see this if you got error ERROR: One or more PGP signatures could not be verified! when installing.

@lsahn-gh
Copy link

On Fedora 24 64bits system, solve libtinfo.so.5 not found error without ncurses5-compat-libs.
because i wouldn't like to install any extra libraries for using YCM.

make a symbolic link for libtinfo.so.5 via libtinfo.so.6

$ sudo ln -s /lib64/libtinfo.so.6.0 /lib64/libtinfo.so.5

then, you can see like below:

lrwxrwxrwx. 1 root root     15  7월 24 02:06 libtinfo.so.5 -> libtinfo.so.6.0
lrwxrwxrwx. 1 root root     15  4월  8 19:33 libtinfo.so.6 -> libtinfo.so.6.0
-rwxr-xr-x. 1 root root 180192  4월  8 19:33 libtinfo.so.6.0

working well.

homu added a commit to ycm-core/ycmd that referenced this issue Sep 6, 2016
[READY] Bump Clang version to 3.9.0

This PR currently updates Clang to 3.9.0 **RC2** (not RC3 because prebuilt binaries for OS X are not available). This is why it is marked as not ready.

We are not using the Ubuntu 16.04 prebuilt binaries on Linux because they are not working on Ubuntu 14.04 (and 12.04 which is needed for our Travis runs). Only the Debian 8 and openSUSE 13.2 ones are working. We use the openSUSE prebuilt binaries instead of the Debian 8 ones because the openSUSE ones do not have the terminfo library (libtinfo) dependency, which is not needed and often a source of issues on Arch Linux (see ycm-core/YouCompleteMe#778 for instance), and are available on both architectures.

I'll update the PR with the final version of 3.9.0 when it is released.

Closes #471.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/588)
<!-- Reviewable:end -->
@jappeace
Copy link

For gentoo emerge ncurses at slot 5:

emerge -a ncurses:5

And enable tinfo use flag as @rpolasek said

@glowcone
Copy link

Update: libtinfo-5 is no longer on AUR. Install ncurses5-compat-libs instead.

@kevinkjt2000
Copy link

Adding "--system-libclang" to my ./install.py command fixed this for me on Arch Linux. 4.0.0 clang is the current version available on Arch at the time of writing this.

@droghio
Copy link

droghio commented Jun 16, 2017

For Fedora 26 it's:

sudo dnf install clang
./install.py --system-libclang --all

@flavono123
Copy link

@kevinkjt2000 Thanks! It also worked now for clang version 5.0.0!

How about commit to install.py this part fixed?

@bl4ck5un
Copy link

bl4ck5un commented Nov 9, 2017

@kevinkjt2000 Thanks! Yours is indeed a nicer solution than using AUR libs.

xpac27 added a commit to xpac27/dotfiles that referenced this issue Nov 23, 2017
@01BTC10
Copy link

01BTC10 commented Dec 15, 2017

This work on Arch.
python3 install.py --system-libclang --all

zzbot added a commit to ycm-core/ycmd that referenced this issue Jan 7, 2018
Fix --system-libclang on Gentoo amd64, if llvm is compiled with ABI_X86="32 64"

$ ls -ld /usr/lib64/llvm/4/l*
drwxr-xr-x 3 root root  20K Dec 16 02:37 lib32
drwxr-xr-x 3 root root  20K Dec 16 02:37 lib64
drwxr-xr-x 2 root root 4.0K Dec 16 02:37 libexec

This results in GLOB finding the wrong library.

$ ./install.py --clang-completer --system-libclang
...
Using external libclang: /usr/lib64/llvm/4/lib32/libclang.so.4.0
...
/usr/lib64/llvm/4/lib32/libclang.so.4.0: error adding symbols: File in wrong format

FTR, I had to use --system-libclang because of libtinfo.so.5 issue (ycm-core/YouCompleteMe#778)

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/891)
<!-- Reviewable:end -->
zzbot added a commit to ycm-core/ycmd that referenced this issue Jan 7, 2018
Fix --system-libclang on Gentoo amd64, if llvm is compiled with ABI_X86="32 64"

$ ls -ld /usr/lib64/llvm/4/l*
drwxr-xr-x 3 root root  20K Dec 16 02:37 lib32
drwxr-xr-x 3 root root  20K Dec 16 02:37 lib64
drwxr-xr-x 2 root root 4.0K Dec 16 02:37 libexec

This results in GLOB finding the wrong library.

$ ./install.py --clang-completer --system-libclang
...
Using external libclang: /usr/lib64/llvm/4/lib32/libclang.so.4.0
...
/usr/lib64/llvm/4/lib32/libclang.so.4.0: error adding symbols: File in wrong format

FTR, I had to use --system-libclang because of libtinfo.so.5 issue (ycm-core/YouCompleteMe#778)

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/891)
<!-- Reviewable:end -->
zzbot added a commit to ycm-core/ycmd that referenced this issue Jan 8, 2018
Fix --system-libclang on Gentoo amd64, if llvm is compiled with ABI_X86="32 64"

$ ls -ld /usr/lib64/llvm/4/l*
drwxr-xr-x 3 root root  20K Dec 16 02:37 lib32
drwxr-xr-x 3 root root  20K Dec 16 02:37 lib64
drwxr-xr-x 2 root root 4.0K Dec 16 02:37 libexec

This results in GLOB finding the wrong library.

$ ./install.py --clang-completer --system-libclang
...
Using external libclang: /usr/lib64/llvm/4/lib32/libclang.so.4.0
...
/usr/lib64/llvm/4/lib32/libclang.so.4.0: error adding symbols: File in wrong format

FTR, I had to use --system-libclang because of libtinfo.so.5 issue (ycm-core/YouCompleteMe#778)

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/891)
<!-- Reviewable:end -->
@kettro
Copy link

kettro commented Apr 17, 2018

Fedora 27, installing ncurses-compat-libs works when not using --system-libclang

@andrea993
Copy link

On Arch I've solved installing ncurses and then
sudo ln -s /usr/lib/libtinfo.so.6 /usr/lib/libtinfo.so.5

@bstaletic
Copy link
Collaborator

Symlinking ABI incompatible shared objects is a terrible idea.

@DougBeney
Copy link

DougBeney commented Jun 5, 2018

In Fedora, the command to fix it was:
sudo ln -s /usr/lib64/libtinfo.so.6 /usr/lib64/libtinfo.so.5

For Fedora, just pass the --system-libclang option when running install.py
(./install.py --clang-completer --system-libclang)

@bstaletic
Copy link
Collaborator

bstaletic commented Jun 5, 2018

Symlinking ABI incompatible shared objects is never a good idea. The only actualy solutions are installing libtinfo.so.5, using the system libclang or building clang from source and using that.

@puremourning
Copy link
Member

@bstaletic answer is the right answer to this problem. To avoid further confusion, I'm locking this thread. If users have further problems, feel free to raise a new issue.

@ycm-core ycm-core locked as resolved and limited conversation to collaborators Jun 5, 2018
doronbehar added a commit to doronbehar/YouCompleteMe that referenced this issue Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests