7

After upgrading haskell platform package, stack command does not work.

$ stack path
No compiler found, expected minor version match with ghc-8.0.1 (x86_64) (based on resolver setting in /home/eii/exercism/haskell/linked-list/stack.yaml).
To install the correct GHC into /home/eii/.stack/programs/x86_64-linux/, try running "stack setup" or use the "--install-ghc" flag.
$

I tried stack setup but it is trying to download an old GHC (ghc-8.0.1). I just installed Haskell platform 8.0.2 (haskell-platform-8.0.2-unknown-posix--full-x86_64.tar.gz). I am using a 64 bit Linux.

$ stack setup
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
ghc-8.0.1:   15.69 MiB / 108.01 MiB ( 14.52%) downloaded...^Cuser interrupt
$

I can compile with ghc-8.0.2 and ghci is working fine.. but I can't use stack nor install new packages.

$ stack update
Downloading package index from https://s3.amazonaws.com/hackage.fpcomplete.com/00-index.tar.gz
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpcomplete.com/00-index.tar.gz) ...
$ stack upgrade
Current Stack version: 1.3.2, available download version: 1.3.2
Skipping binary upgrade, your version is already more recent
$ which stack
/usr/local/bin/stack
$ ls -la /usr/local/bin/stack
lrwxrwxrwx. 1 root root 45 Feb  1 18:39 /usr/local/bin/stack -> /usr/local/haskell/ghc-8.0.2-x86_64/bin/stack
$ which ghc
/usr/local/bin/ghc
$ ls -la /usr/local/bin/ghc
lrwxrwxrwx. 1 root root 43 Feb  1 18:39 /usr/local/bin/ghc -> /usr/local/haskell/ghc-8.0.2-x86_64/bin/ghc
$

Please help.

Jihyun
  • 883
  • 5
  • 17
  • 3
    I think the issue is that `/home/eii/exercism/haskell/linked-list/stack.yaml` still contains the same resolver which expects GHC-8.0.1. To use GHC-8.0.2 you can change the resolver to a recent nightly snapshot like [nightly-2017-02-02](https://www.stackage.org/nightly-2017-02-02). To use e.g. GHCi-8.0.2 you can simply run `stack --resolver nightly ghci`. In general, stack can have many different versions of GHC(i) installed side by side. – sjakobi Feb 02 '17 at 22:03
  • If my comment above doesn't completely dissolve your confusion, please expand a bit on how stack's behavior differs from your expectations. – sjakobi Feb 02 '17 at 23:55
  • 1
    Thank you!I I ran "stack --resolver nightly-2017-02-03 setup" and it worked! Thank you! – Jihyun Feb 05 '17 at 13:12

1 Answers1

1

I encountered this the other day on Arch Linux 4.17.4. The error was:

No setup information found for ghc-8.4.3 on your platform.
This probably means a GHC bindist has not yet been added for OS key 'linux64-ncurses6', 'linux64-tinfo6'.
Supported versions: ghc-7.8.4, ghc-7.10.2, ghc-7.10.3, ghc-8.0.1, ghc-8.0.2, ghc-8.2.1, ghc-8.2.2, ghc-8.4.1, ghc-8.4.2

As a workaround, I edited stack.yml to change

lts-12.0

to

lts-11.15
Matthias Braun
  • 32,039
  • 22
  • 142
  • 171