5

My cabal dependencies are listed as

base ==4.6.*, containers ==0.5.*, bytestring ==0.10.*, binary ==0.5.*, parsec ==3.1.*

i did,

cabal sandbox init
wget http://www.stackage.org/lts/cabal.config
cabal install --only-dependencies

To overcome dependency conflicts, i am using sandbox installation. But still, cabal is talking about some global constraints which is confusing for me.

Cabal dependency tree resolution gets screwed as,

    trying: parsec-3.1.8 (dependency of myproj-0.1.0.0)
next goal: mtl (dependency of parsec-3.1.8)
rejecting: mtl-2.2.1, 2.2.0.1, 2.2 (global constraint requires ==2.1.3.1)
trying: mtl-2.1.3.1
next goal: transformers (dependency of mtl-2.1.3.1)
rejecting: transformers-0.4.2.0, 0.4.1.0, 0.3.0.0, 0.2.2.1, 0.2.2.0, 0.2.1.0,
0.2.0.0, 0.1.4.0, 0.1.3.0, 0.1.1.0, 0.1.0.1, 0.1.0.0, 0.0.1.0, 0.0.0.0,
0.4.0.0 (global constraint requires installed instance)
  • I believe `global constraint requires ==2.1.3.1` means that mtl-2.1.3.1 is installed in the global package db and cabal says "we are going to use that version", but that version isn't compatible with the other constraints. This can perhaps be solved by placing an appropriate mtl dependency in your cabal file. – user2407038 Feb 26 '15 at 15:34
  • 1
    but, i don't see haskell libs sitting in `usr/local/lib/x86_64-linux-ghc-7.6.3/`? am i searching in the wrong place? –  Feb 26 '15 at 15:47
  • 1
    The "global constraints" are the ones the Stackage LTS config file specifies. – kosmikus Feb 26 '15 at 18:17
  • 5
    So the Stackage LTS config file contains the constraint `transformers installed`, meaning that only an already present version of `transformers` can be used. This is reasonable, because GHC ships with a specific version of `transformers`. For `ghc-7.8`, this is `transformers-0.3.0.0`. For some reason, this installed version is not considered by `cabal-install`. Your partial log doesn't contain sufficient info to see why. – kosmikus Feb 26 '15 at 19:35

1 Answers1

2

You should have a cabal.config file in your current directory. Open it with any text editor and serach for the transformers installed string.

Once you have found it, replace it with transformers ==0.4.3.0 or any other version you like.

Vitaly Olegovitch
  • 3,509
  • 6
  • 33
  • 49