`cabal-install` refuses to solve conflicting `ghc` and `containers` versions

269 views Asked by At

This repository contains a reproduction for an annoying error I got while using doctest in a test-suite.

cabal-installs solver fails to find a solution for this build-depends field using GHC 8.0.2:

build-depends:       
    base >= 4.7 && < 5
  , doctest == 0.11.4
  , containers == 0.5.10.2

Note that doctest depends transitively depends on ghc-8.0.2, which itself depends on containers-0.5.7.1, conflicting with my own constraints. That's basically what cabal install is trying to tell me:

Resolving dependencies...
cabal.exe: Could not resolve dependencies:
next goal: containers (dependency of repro-0.1.0.0)
rejecting: containers-0.5.7.1/installed-0.5... (conflict: repro =>
containers==0.5.10.2)
trying: containers-0.5.10.2
next goal: doctest (dependency of repro-0.1.0.0)
rejecting: doctest-0.13.0, doctest-0.12.0 (conflict: repro => doctest==0.11.4)
trying: doctest-0.11.4
next goal: ghc (dependency of doctest-0.11.4)
rejecting: ghc-8.0.2/installed-8.0... (conflict: containers==0.5.10.2, ghc =>
containers==0.5.7.1/installed-0.5...)
Dependency tree exhaustively searched.

Now, what bugs me is that stack install works just fine using lts-9 and an extra-deps for the containers version. So in theory, cabal-install could also do 'the right thing' here. How can I tell it to?

0

There are 0 answers