haskell/haskeline

Cannot install haskeline with stack on Archlinux

Closed this issue · 4 comments

Hi,

This issue looks like #16, but I don't think there is a fix somehow.

So, trying to install haskeline gives the following output on Archlinux:

stack install haskeline
Warning: File listed in haskell-programme.cabal file does not exist: README.md
haskeline-0.7.3.1: configure
haskeline-0.7.3.1: build

--  While building package haskeline-0.7.3.1 using:
      /tmp/stack13776/haskeline-0.7.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.2.0 build --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/jiehong/Dev/haskell-programme/.stack-work/logs/haskeline-0.7.3.1.log

    [1 of 2] Compiling Main             ( /tmp/stack13776/haskeline-0.7.3.1/Setup.hs, /tmp/stack13776/haskeline-0.7.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/Main.o )
    [2 of 2] Compiling StackSetupShim   ( /home/jiehong/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /tmp/stack13776/haskeline-0.7.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/StackSetupShim.o )
    Linking /tmp/stack13776/haskeline-0.7.3.1/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/setup/setup ...
    *** Warning: running on POSIX but not building the terminfo backend. ***
    You may need to install the terminfo package manually, e.g. with
    "cabal install terminfo"; or, use "-fterminfo" when configuring or
    installing this package.
    
    Configuring haskeline-0.7.3.1...
    Building haskeline-0.7.3.1...
    Preprocessing library haskeline-0.7.3.1...
    /usr/bin/ld: cannot find -ltinfo
    collect2: error: ld returned 1 exit status
    linking .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/System/Console/Haskeline/Directory_hsc_make.o failed (exit code 1)
    command was: /usr/bin/gcc .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/System/Console/Haskeline/Directory_hsc_make.o .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/System/Console/Haskeline/Directory_hsc_utils.o -o .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/System/Console/Haskeline/Directory_hsc_make -fno-stack-protector -L/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/transformers-0.5.2.0 -Wl,-R,/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/transformers-0.5.2.0 -L/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/terminfo-0.4.0.2 -Wl,-R,/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/terminfo-0.4.0.2 -ltinfo -L/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/process-1.4.3.0 -Wl,-R,/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/process-1.4.3.0 -L/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/directory-1.3.0.0 -Wl,-R,/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/directory-1.3.0.0 -L/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/unix-2.7.2.1 -Wl,-R,/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/unix-2.7.2.1 -lrt -lutil -ldl -L/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/time-1.6.0.1 -Wl,-R,/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/time-1.6.0.1 -L/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/filepath-1.4.1.1 -Wl,-R,/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/filepath-1.4.1.1 -L/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/containers-0.5.7.1 -Wl,-R,/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/containers-0.5.7.1 -L/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/bytestring-0.10.8.1 -Wl,-R,/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/bytestring-0.10.8.1 -L/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/deepseq-1.4.2.0 -Wl,-R,/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/deepseq-1.4.2.0 -L/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/array-0.5.1.1 -Wl,-R,/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/array-0.5.1.1 -L/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/base-4.9.1.0 -Wl,-R,/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/base-4.9.1.0 -L/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/integer-gmp-1.0.0.1 -Wl,-R,/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/integer-gmp-1.0.0.1 -lgmp -L/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/ghc-prim-0.5.0.0 -Wl,-R,/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/ghc-prim-0.5.0.0 -L/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/rts -Wl,-R,/home/jiehong/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/rts -lm -lrt -ldl -lpthread

However, cabal install terminfo gives the following output:
Resolving dependencies...
All the requested packages are already installed:
terminfo-0.4.0.2
Use --reinstall if you want to reinstall anyway.

Forcing the re-installation does not help at all.
Checking for the lib itself:

ll /usr/lib/libtinfo.so.5 
lrwxrwxrwx 1 root root 24 2016-12-28 20:16 '/usr/lib/libtinfo.so.5' -> '/usr/lib/libncurses.so.5'*

I've trying with lts-7.18 instead of lts-8.3 on stack, but still with the same issue.

Could you please help on this issue?

judah commented

From what you wrote on the intero issue, this seems like a problem with the stack installation.

I found a previous stack bug which might be relevant: commercialhaskell/stack/issues/257

The last line of your output has an invocation of gcc: command was: /usr/bingcc ...
Do you know why that command isn't finding the libtinfo.so.5 that you have in your /usr/lib?

Alright, I think this is a distribution issue actually, as libtinfo is the only lib which doesn't have a symlink such as libtinfo.so --> libtinfo.so.5.
My guess is that the linker only look for *.so, and not *.so.*. I'll open a ticket on the archlinux bug tracker for that then.

Therefore I'm closing this issue as not an haskeline issue.

That bug is closed because it's not the official ncurses package that provides the "proper" libtinfo.so, it's ncurses5-compat-libs from AUR, but it in turn does not create the link libtinfo.so, only libtinfo.so.5.