hsdev icon indicating copy to clipboard operation
hsdev copied to clipboard

Cabal failes to install under clean haskell platform

Open yohad opened this issue 7 years ago • 1 comments

Hi, On a windows 10 I just installed haskell platform, them tried installing hsdev with the following result:

C:\Users\yotam>cabal install hsdev
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: hsdev-0.3.1.4 (user goal)
[__1] trying: hlint-2.1.10 (dependency of hsdev)
[__2] trying: haskell-src-exts-1.20.2 (dependency of hsdev)
[__3] next goal: ghc-syb-utils (dependency of hsdev)
[__3] rejecting: ghc-syb-utils-0.3.0.0 (conflict: hsdev =>
ghc-syb-utils>=0.2.3 && <0.3)
[__3] trying: ghc-syb-utils-0.2.3.3
[__4] next goal: ghc (dependency of hsdev)
[__4] rejecting: ghc-8.4.3/installed-8.4..., ghc-8.4.3, ghc-8.4.1 (conflict:
ghc-syb-utils => ghc>=7.0 && <8.4)
[__4] rejecting: ghc-8.2.2, ghc-8.2.1 (conflict: hsdev => ghc==8.4.*)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: hsdev, haskell-src-exts, ghc-mod,
hlint, base, ghc, ghc-syb-utils

Which I found odd, as it seems to me that I need to versions of ghc.

yohad avatar Aug 31 '18 11:08 yohad

It just can not be build with the latest GHC (8.4.3 at the moment of writing), so use stack to get older lts snapshot and build hsdev inside that environment.

~~lts-11.22 / ghc-8.2.2 works well.~~

~~> stack --resolver=lts-11.22 install hsdev-0.3.1.4 haddock-api-2.17.4 hdocs-0.5.2~~

Note that some other packages must be specified with fixed version. This is because stack refuses to resolve fuzzy dependency ranges by itself. There is some theory around predictable builds around it, but just skip it for now. Generally, when you see in Haskell package requirements version range like >= x.y.z it's probably a good idea to stick with x.y.z, as it was tested for sure and most likely won't cause troubles.

Update: False alarm

No, version above actually didn't work for me.

Working version is: clone the repo & stack install using whichever yaml file you like.

Complete working example:

git clone https://github.com/mvoidex/hsdev.git
cd hsdev
git checkout 0.3.1.4
stack --stack-yaml=stack-ghc-8.0.2.yaml install

ratijas avatar Sep 09 '18 17:09 ratijas