[Haskell-cafe] Re: Re: cabal-install

Ben Franksen ben.franksen at online.de
Thu Nov 29 17:56:47 EST 2007

Duncan Coutts wrote:
> On Wed, 2007-11-28 at 21:00 +0100, Thomas Schilling wrote:
>> On Wed, 2007-11-28 at 20:46 +0100, Ben Franksen wrote:
>> > ben at sarun: .../software/haskell > cd cabal
>> > ben at sarun: .../haskell/cabal > runhaskell Setup.lhs configure
>> > 
>> > Distribution/Simple/NHC.hs:77:1: lexical error at character 'i'
>> > 
>> > Ups.
>> > 
>> > Cheers
>> > Ben (feels like a real beta-tester now ;-)
>> Well, Cabal cannot automatically compile itself with itself.
> No actually it can, that was just a bug (which I've just fixed). 

Ah, I wondered. If even 'the monster' (ghc) can build itself from earlier
versions it should be possible for cabal to pull the same trick.

> Ben is 
> indeed being a beta tester by using Cabal HEAD. I'd recommend the 1.2
> branch:

I was using HEAD as per Don's suggestion for how to build cabal-install.
Now, re-reading this thread I see that you already mentioned that upgrading
on the 2.1 branch would have been enough.

Apropos beta-testing, cabal-1.3 seems to have introduced an incompatible API
change; for instance, it can't build MissingH any longer. This might be ok
by whatever versioning policy cabal uses, I didn't check; anyway:

ben at sarun: ~ > cabal install MissingH
Downloading 'MissingH-0.18.6'...
[1 of 1] Compiling Main             ( Setup.hs, dist/setup/Main.o )

    Couldn't match expected type `(Either GenericPackageDescription
           against inferred type `PackageDescription'
    In the first argument of `(confHook defaultUserHooks)', namely
    In the expression:
          mydescrip = case os of
                        "mingw32" -> ...
                        _ -> ...
        in (confHook defaultUserHooks) mydescrip flags
    In the definition of `customConfHook':
        customConfHook descrip flags
                         = let
                             mydescrip = case ... of
                                           "mingw32" -> ...
                                           _ -> ...
                           in (confHook defaultUserHooks) mydescrip flags

> http://darcs.haskell.org/cabal-branches/cabal-1.2/

Ok, let's try the 1.2 branch, might be a bit more on the safe side. (*builds
cabal-install with this version (hiding Cabal-1.3)...ok, installing,
ok, ... oh wait, this version gives me exactly the same error as
above ...thinking hard for a moment...). Ok, running again ./Setup
configure this time with -v3:

Dependency Cabal>=1.2: using Cabal-1.3.1

O_o. I forgot that cabal ignores hidden/exposed status of packages (for good
reasons IIRC). How do I tell it to use the newly installed  Is
there a command line switch...(*stares at output of ./Setup
configure --help; schade, no with-cabal=VERSION option*), no. To hell with
it,I'll just add "&&<1.3" to the cabal file and indeed it now says

Dependency Cabal>=1.2&&<1.3: using Cabal-

One install of cabal-install later: same error with MissingH. So the package
was broken to begin with an it wasn't related to the cabal upgrade! Grrrr.

Not that it matters to me here at home (there is a debian package I can
use), but at work we are still using debian /old-stable/ which is just a
bit too outdated and anyway I don't have root access so I have to install
everything from source.

Unpacking MissingH and looking at the Setup.hs I see that I can simply
replace it by a generic version, add unix dependency to the cabal file, and
all works well. So much for "never again runhaskell Setup blabla" ;-)

(I should add that for many packages cabal-install works perfectly well.)

Thanks again for your help!

PS: a 'cabal remove' would also be nice to have.

More information about the Haskell-Cafe mailing list