Stack unsupported version

453 Views Asked by At

I'm trying to build libssh2-hs with stack (lts-3.20) and I get some errors:

$ stack build
No compiler found, expected minor version match with ghc-7.10.2 (x86_64-ncurses6) (based on resolver setting in /home/black/programmation/haskell/libssh2-hs/stack.yaml).
To install the correct GHC into /home/black/.stack/programs/x86_64-linux/, try running "stack setup" or use the "--install-ghc" flag.
$ stack setup
No information found for ghc-7.10.2.
Supported versions for OS key 'linux64-ncurses6': GhcVersion 7.10.3, GhcVersion 8.0.1, GhcVersion 8.0.2

I use archlinux 64 bits, what happens here and what can I do?

1

There are 1 best solutions below

0
On BEST ANSWER

The source of the problem is hinted at by this error message:

No information found for ghc-7.10.2.
  Supported versions for OS key 'linux64-ncurses6': GhcVersion 7.10.3, GhcVersion 8.0.1, GhcVersion 8.0.2

Arch Linux provides by default libncurses6, while the standard builds of GHC expect libncurses5/libtinfo5. Stack can fetch alternative GHC builds that use libncurses6; however, they are only available from GHC 7.10.3 onward, which explains why you are having this issue with a snapshot that uses GHC 7.10.2. The following suggestion, taken from Stack issue #3177, should solve it:

Install ncurses5-compat-libs from AUR and then force Stack to use the standard GHC bindist by doing something like stack --ghc-build=standard setup.

(Note that the --ghc-build=standard might not be necessary -- if I remember correctly, when I ran into this issue several months ago stack setup detected the appropriate GHC build once I installed ncurses5-compat-libs, with no need to specify it explicitly.)