purescript / spago

🍝 PureScript package manager and build tool
BSD 3-Clause "New" or "Revised" License
793 stars 132 forks source link

libtinfo.so.5: cannot open shared object file #104

Closed starper closed 5 years ago

starper commented 5 years ago

After the latest software update on my Pop!_OS (which is basically Ubuntu), spago started to throw an error:

spago: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

After some investigation I found out that I have libtinfo.so.6 not libtinfo.so.5 and the way to fix this problem is to create this symlink:

sudo ln -s /path/to/libtinfo.so.6 /path/to/libtinfo.so.5

I understand that it's not exactly a spago issue, but I still want to bring this up

justinwoo commented 5 years ago

Related: https://github.com/commercialhaskell/stack/issues/1012

f-f commented 5 years ago

After reading that issue I'm not sure there's a "proper way to fix it" on our side 🤔

f-f commented 5 years ago

Of course an option would be to compile a static binary for Linux.

justinwoo commented 5 years ago

I wouldn't want to impose that cost on everyone anyway. If someone really cares, they can patch the binary themselves e.g. https://github.com/justinwoo/easy-purescript-nix/blob/master/spago.nix

But many programs won't work without ncurses and other dependencies anyway

f-f commented 5 years ago

Turns out the reason why this happens is that we build spago on the fpco/stack-build Docker image, which is based on Ubuntu 16.04, which ships libtinfo.so.5, while it looks like the latest Ubuntu ships with libtinfo.so.6.

Since the latest Ubuntu has issues in compiling Haskell (source: a colleague has to use Nix to compile our Haskell stuff on his latest Ubuntu, and this is probably also the reason why FP Complete is still on Ubuntu 16), we probably cannot do anything about this. (short of statically compiling, which I'd avoid for now, as it's some effort to configure)

So I'll close this as "we cannot do much", but it's probably worth adding an entry to the FAQ?

starper commented 5 years ago

it's probably worth adding an entry to the FAQ?

Yeah, I think it's a good idea

masaeedu commented 5 years ago

This is an issue on Arch as well FWIW.

f-f commented 5 years ago

@masaeedu thanks for the report! Fix for the recommendation up in https://github.com/spacchetti/spago/pull/207

ford-prefect commented 4 years ago

As a note for Fedora users who end up here, you need to install ncurses-compat-libs

ismailsunni commented 4 years ago

Thanks @ford-prefect

drewboardman commented 4 years ago

This is an issue on Arch as well FWIW.

Did you fix this by just symlinking? @masaeedu

ford-prefect commented 4 years ago

@drewboardman you could try installing ncurses5-compat-libs

drewboardman commented 4 years ago

@ford-prefect that worked. Thank you

Charles-Schleich commented 4 years ago

What worked for me sudo apt-get install libtinfo5 Hope this helps someone

idhowardgj94 commented 3 years ago

@Charles-Schleich work for me, thank you

f-f commented 3 years ago

@idhowardgj94 which version of Spago are you on? This should not happen anymore in the latest version (0.17)

senorsmile commented 3 years ago

confirming that installing ncurses5-compat-libs from the aur (on manjaro for me, so should work on arch too) solves the problem.

f-f commented 3 years ago

@senorsmile this should not be necessary anymore since a while - which version of Spago are you using?

senorsmile commented 3 years ago

@f-f 0.19.0

hdgarrood commented 3 years ago

I guess the message about libtinfo missing is coming from the compiler rather than from spago itself now, since the compiler does still require libtinfo.

f-f commented 3 years ago

@hdgarrood oh right, that makes perfect sense. Thank you!

sevillaarvin commented 3 years ago

As a note for Fedora users who end up here, you need to install ncurses-compat-libs

For manjaro as well:

pamac install ncurses5-compat-libs

Available via the AUR repo: https://forum.manjaro.org/t/cant-find-a-way-to-install-libtinfo-so-5/35129/3?u=6205f10b80