Cabal constraint solver

Brandon S Allbery KF8NH allbery at
Sat Oct 2 19:12:57 EDT 2010

Hash: SHA1

On 10/2/10 18:07 , Christian Höner zu Siederdissen wrote:
> 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
> This is rather annoying: the constraint is solved (eg. syb is installed)
> but we /still/ assume that we can not continue. So obviously, I would
> like to be able to have cabal assume constraints fullfilled if the
> package is installed.

This is unsafe because the package database (which isn't maintained by
cabal, but by ghc; see the ghc-pkg command) doesn't store the constraints.
So cabal can't tell if that *particular* build was against the version of
base it needs for everything else.  (ghc can have multiple versions of base
around; see the 6.10 series.  I *think* ghc is constrained to only
supporting it for different major versions, but it can't tell Cabal that.)

Now, it is arguable that if there is no different release of base in the
package database then it should assume the visible release is the one used;
but you again run into the limitations of ghc-pkg.  If I "ghc-pkg hide" a
given package release, dependents of that package don't also get hidden
because (again) ghc-pkg doesn't store that information.  So now you end up
with the same problem except it will show up when you try to use one of the
dependents, and (worse) because Cabal can't tell this happened you will at
best get an unexpected type mismatch at compile time and at worst the
program will compile but dump core (if the mismatch is in base.  It's hard
to validate that runtimes are compatible, and base is very tightly bound to
the runtime).

- -- 
brandon s. allbery     [linux,solaris,freebsd,perl]      allbery at
system administrator  [openafs,heimdal,too many hats]  allbery at
electrical and computer engineering, carnegie mellon university      KF8NH
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla -


More information about the Glasgow-haskell-users mailing list