Cabal constraint solver

Daniel Fischer daniel.is.fischer at web.de
Sat Oct 2 19:29:37 EDT 2010


On Sunday 03 October 2010 00:07:24, Christian Höner zu Siederdissen wrote:
> Hi,
>
> does the Cabal constraint solver always try to solve the complete graph?
>
> example: (ghc-7.0.0-rc1)
>
> $ cabal install parsec-3.1.0
> cabal: cannot configure syb-0.2.1. It requires base >=4.0 && <4.3
>
> cd syb-0.2.1
> * remove base<4.3 constraint from syb.cabal
> cabal install
> * syb-0.2.1 is now installed and works!
>
> $ cabal install parsec-3.1.0
> cabal: cannot configure syb-0.2.1. It requires base >=4.0 && <4.3
>

Yes, cabal looks at the package-index to find out the required 
dependencies, it doesn't know where you have local source files.

When you edit a .cabal file, always increment the version of the package, 
in this case making the version 0.2.1.1 or 0.2.1.0.1 would be a good 
choice.

Then cabal sees you have a newer version of syb installed and unless 
parsec-3.1.0 asks explicitly for version 0.2.1 (or <= 0.2.1), it will 
choose the newer installed version (since the package index knows nothing 
about that, it doesn't see an inconsistency and assumes it'll be alright).


More information about the Glasgow-haskell-users mailing list