Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

While constructing the build plan, the following exceptions were encountered

I am trying to install

stack install ghc-mod

and I've got the following error:

In the dependencies for ghc-mod-5.8.0.0:
    Cabal-2.0.1.1 from stack configuration does not match >=1.18 && <1.25 (latest matching version is 1.24.2.0)
    base-4.10.1.0 from stack configuration does not match >=4.6.0.1 && <4.10 (latest matching version is 4.9.1.0)
    cabal-helper must match <0.8 && >=0.7.3.0, but the stack configuration has no specified version (latest matching version is 0.7.3.0)
    extra-1.6.2 from stack configuration does not match <1.6 && >=1.4 (latest matching version is 1.5.3)
    ghc-8.2.2 from stack configuration does not match >=7.6 && <8.2
    monad-journal-0.8.1 from stack configuration does not match <0.8 && >=0.4 (latest matching version is 0.7.2)
    optparse-applicative-0.14.0.0 from stack configuration does not match >=0.13.0.0 && <0.14 (latest matching version is 0.13.2.0)
needed since ghc-mod is a build target.

Some potential ways to resolve this:

  * Recommended action: try adding the following to your extra-deps in /home/developer/.stack/global-project/stack.yaml:

- Cabal-1.24.2.0
- base-4.9.1.0
- cabal-helper-0.7.3.0
- extra-1.5.3
- monad-journal-0.7.2
- optparse-applicative-0.13.2.0

  * Set 'allow-newer: true' to ignore all version constraints and build anyway.

  * You may also want to try using the 'stack solver' command.

Plan construction failed.

I am using

~/.local/bin$ stack --version
Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0

and ghc version 8.2.2. How to bypass the error?

like image 518
softshipper Avatar asked Feb 01 '18 09:02

softshipper


2 Answers

For lts-10.4 you might use a workaround mentioned here at the very bottom: Install a release candidate for ghc-mod-5.9.0.0 and some more packages in stack.yaml under extra-deps. Then do a

stack build ghc-mod
stack install ghc-mod

and you're done. At least "works for me" under ghc-8.2.2:

ghc-mod --version

$> ghc-mod version 5.9.0.0 compiled by GHC 8.2.2

I have not encountered any problems using it with atom yet. Hope this helps.

like image 84
kuttifunk Avatar answered Nov 01 '22 17:11

kuttifunk


Your version of stackage does not have that package https://www.stackage.org/lts-10.4/hoogle?q=ghc-mod . The old one has it https://www.stackage.org/lts-8.23/hoogle?q=ghc-mod . I guess package is considered unmaintained as it was last updated in July 2017.

You can read official documentation on how to add any package from hackage, particular section External Dependencies https://github.com/commercialhaskell/stack/blob/master/doc/GUIDE.md#external-dependencies

However, things might be broken with latest Haskell version.

like image 45
logcat Avatar answered Nov 01 '22 17:11

logcat