[Haskell-cafe] Mystified by Cabal

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sun Mar 8 07:32:18 EDT 2009

On Sat, 2009-03-07 at 17:30 +0000, Colin Paul Adams wrote:
> >>>>> "Svein" == Svein Ove Aas <svein.ove at aas.no> writes:
>     >> Preprocessing library game-tree-  Building
>     >> game-tree-
>     >> 
>     >> Data/Tree/Game/Negascout.hs:31:0: Unrecognised pragma [1 of 2]
>     >> Compiling Data.Tree.Game.Tree ( Data/Tree/Game/Tree.hs,
>     >> dist/build/Data/Tree/Game/Tree.o )
>     >> 
>     >> Data/Tree/Game/Tree.hs:1:0:    Failed to load interface for
>     >> `Prelude':      it is a member of package base-, which
>     >> is hidden
>     >> 
>     Svein> What does your .cabal file look like?

Don, mkcabal is generating .cabal files that are confusing people.

It should generate new-style .cabal files with library or executable
sections. The ghc-options and build-depends etc need to be in the lib or
exe section.

The files it generates are not actually broken but it leaves new users
to do the conversion from old style to new and unsurprisingly many get
that wrong. Cabal is also at fault here for not providing good
diagnostics but it would help if mkcabal used the current recommended

Note also that the list of licenses mkcabal offers is wrong. You can get
the list from the Cabal lib itself so there is no need to maintain the
list manually.

I still think mkcabal should be integrated into cabal-install, like:
$ cabal init
or something. We could also more easily keep it up to date that way.


More information about the Haskell-Cafe mailing list