Question

Cabal has dependency problems constantly. It's really tiring. So far I have tried to get many things working, here's my trying to install snap:

$ sudo cabal install snap-server
Resolving dependencies...
cabal: cannot configure ListLike-1.1.0. It requires mtl >=1.1.0 && 1.2
For the dependency on mtl >=1.1.0 && 1.2 there are these packages:
mtl-1.1.0.0, mtl-1.1.0.1, mtl-1.1.0.2 and mtl-1.1.1.0. However none of them
are available.
mtl-1.1.0.0 was excluded because mtl-2.0.0.0 was selected instead
mtl-1.1.0.0 was excluded because monads-fd-0.1.0.3 requires mtl ==2.*
mtl-1.1.0.1 was excluded because mtl-2.0.0.0 was selected instead
mtl-1.1.0.1 was excluded because monads-fd-0.1.0.3 requires mtl ==2.*
mtl-1.1.0.2 was excluded because mtl-2.0.0.0 was selected instead
mtl-1.1.0.2 was excluded because monads-fd-0.1.0.3 requires mtl ==2.*
mtl-1.1.1.0 was excluded because mtl-2.0.0.0 was selected instead
mtl-1.1.1.0 was excluded because monads-fd-0.1.0.3 requires mtl ==2.*

I have similar problems installing Happstack, etc. What is the procedure to make cabal...work? I've already tried:

export PATH=/home/user/.cabal/bin:$PATH
Was it helpful?

Solution

The problem is that snap-server-0.2.15 has an unbounded dependency on monads-fd. The most recent version, monads-fd-0.1.0.3, requires mtl-2.* Unfortunately this conflicts with the dependency on ListLike (via iteratee), which requires mtl < 2.0. Both of these constraints can't be fulfilled simultaneously, so cabal gives up.

Try running cabal install snap-server --constrain="monads-fd=0.1.0.2". That will force an earlier version of monads-fd that doesn't require mtl, and I think everything will work properly.

If you're having problems with a lot of packages, it's probably due to the new mtl that was recently uploaded. You can try adding --constrain="mtl<2", which might help.

Moral to maintainers: follow the Haskell PVP and always use upper dependency bounds.

N.B. Even if I do upload a new ListLike that works with mtl-2 (which I'll do very soon), that won't fix your problem because the new ListLike won't be selected due to the upper bound on iteratee.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top