Cabal constraint solver

Simon Marlow marlowsd at
Tue Oct 5 08:15:59 EDT 2010

On 03/10/2010 00:12, Brandon S Allbery KF8NH wrote:
> 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.

Sure it can:

$ ghc-pkg field haskell98 depends
depends: array-

> (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.

hiding packages makes no difference to Cabal, it is only for setting the 
packages that are visible to GHCi and ghc --make.

 > 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).

I'm afraid I'm not following - I thought we'd eliminated the possibilty 
of incorrect combinations of packages by using the ABI hash to identify 
dependencies (in GHC 6.12).  Could you describe exactly how you get into 
this situation?


> - --
> 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 -
> iEYEARECAAYFAkynvHgACgkQIn7hlCsL25XttACfQ+9G4bIAOnQVwJddDBizaPba
> uU4AoJjFXPkeqcloqp8w2COQ4I0bh+nk
> =sZhw
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at

More information about the Glasgow-haskell-users mailing list