haskell / haskeline

A Haskell library for line input in command-line programs.
https://hackage.haskell.org/package/haskeline
BSD 3-Clause "New" or "Revised" License
223 stars 75 forks source link

libtinfo building errors #128

Open jazzyeagle opened 4 years ago

jazzyeagle commented 4 years ago

Hello -

I wanted to report that I have had issues with libtinfo building issues on Solus:

/usr/bin/ld: cannot find -ltinfo

I took a look through the tickets that have been closed, and I know this has been a ticket that has been opened and closed numerous times. I'm opening another one, though, to ask that the project actually be updated to use libncurses 6 instead of relying on manual symlink creation or packages that create the symlinks? libncurses 6 came out back in 2015, so I'm not sure why Haskeline still requires libtinfo. It would help out everyone on systems that do not have the appropriate symlinks if Haskeline itself was simply updated to use the new libs. Is there some reason that's preventing the update of Haskeline to use libncurses directly vs. libtinfo?

Thanks.

judah commented 4 years ago

Haskeline (really, the terminfo package that it depends on) does work with ncurses. Indeed, it has a configure script that selects between them: https://github.com/judah/terminfo/blob/b7f0ba83df4abbf05e5c61f3ef62158afcdc608b/configure.ac#L18 When building it defaults to tinfo first (for historical reasons), but if that's not available it'll use ncurses instead.

I confess I don't have any experience with Solus. What's the exact command that's failing for you?

jazzyeagle commented 4 years ago

The command was simply stack install darcs, and when that failed, I tried cabal install darcs, as the project I'm helping with is using a darcs repository, and Haskeline and terminfo are both dependencies for darcs. I know someone else was mentioning Snap using them as a dependency, and I believe it is a dependency for some other dependency for Yesod as well, though I haven't found it yet. I'll keep looking as time permits.

In terms of Solus, I read on a post that the Solus team was avoiding putting in links for libtinfo given its age. They ultimately broke down and added a soft link for libtinfo.so.5 due to many requests by other users, but I still had to add another soft link for libtinfo.so in order for Haskeline to compile. It did not appear to switch over to libncurses, as you indicated in your reply.

judah commented 4 years ago

Thanks for the information. One possibility is that the problem is with how your build of GHC was created. GHC itself distributes (and depends on) a version of terminfo (which haskeline depends on), which may have hard-coded in the ncurses/tinfo choice based on what was installed on the machine building GHC. Please try running:

ghc-pkg describe terminfo

And paste the output, looking in particular at the extra-libraries field which will say what libraries GHC build expects to be installed.

Alternately, let's try to confirm whether there's a problem in the configuration step. Can you please try building the terminfo package manually, after removing the libtinfo symlink you mentioned (to see why ncurses alone wasn't enough)?

cabal unpack terminfo
cd terminfo-*
cabal build

And paste the output, as well as attaching the file at dist/build/config.log?