[Haskell-beginners] Cannot install cairo with cabal...

Dave Bayer bayer at cpw.math.columbia.edu
Fri Aug 12 00:40:28 CEST 2011


Just to get this on the record (I found this message while googling [PackageDB] for a similar error):

[1] One needs a dash,

	cabal install --ghc-option=-DCABAL_VERSION_MINOR=10 cairo

[2] It's irrelevant what the "correct answer" is as to the version of Cabal; one may want the wrong answer. The Setup.hs in an older package may not have correctly predicted future development. Developers could use "micro" versions to keep variants current, but they tend not to do so.

One wants the branch of Setup.hs code that picks the right variant between [PackageDB] and PackageDB, so the install gets past hanging on this issue. One needs to look at the code. In my case, I needed

	cabal install --ghc-option=-DCABAL_VERSION_MINOR=6 glib-0.11.2

and I could only figure that out by looking at the branching code in Gtk2HsSetup.hs; the two choices in that file were 6 and 8. 6 works, 8 doesn't, I'm actually on 10, go figure.

Several days of part-time yak shaving in, I managed to get gtk+ up on OS X using fink (not manually or using MacPorts) but it's an older version. The current glib assumes it can make a call to g_mount_get_default_location, which is described online but not in the fink version of gio. This earlier glib doesn't assume it can make a call to g_mount_get_default_location. Alas, but this earlier glib triggers the [PackageDB] versus PackageDB Cabal bug, claimed to be fixed on various tickets. And that's 0.4% of the yak shaving I've been doing.

In an ideal world there'd be a glib-0.11.3 that works with contemporary versions of cabal without this hack, but doesn't assume recent advances in gtk+ such as the g_mount_get_default_location call. That's what micro versions are for.

On Jul 7, 2011, at 3:38 AM, Jack Henahan wrote:

> That looks like it might be a bug in the source. What it says, in short, is that it expects that sixth argument in (i.e., registerPackage _ _ _ _ _ O) to be a PackageDBStack, but instead it's a PackageDB.
> 
> The lines around where the error occurs are
> 
>    #if CABAL_VERSION_CHECK(1,10,0)
>                                        installedPkgInfo pkg lbi inplace [packageDb]
>    #else
>                                        installedPkgInfo pkg lbi inplace packageDb
>    #endif
> 
> So it seems that it can't infer your cabal's minor version, so it drops into the else. Do you get any different result when you call `cabal install --ghc-option=DCABAL_VERSION_MINOR=10 cairo`?



More information about the Beginners mailing list