Duncan Coutts duncan.coutts at
Fri Jul 30 10:04:32 EDT 2010

On Thu, 2010-07-29 at 20:54 +0200, Phyx wrote:
> I’m trying to use the Cabal api to preprocess a .cabal file and have
> it run the preprocessors.

> But preprocessSources takes a PackageDescription (which I get from a
> GenericPackageDescription) so this does not contain any information on
> the Executables or Libraries in the cabal file.  So nothing gets
> executed. 

The GenericPackageDescription is a bit confusing. It contains a
PackageDescription but you should really ignore that one. That one only
contains the top level meta info about the package.

To get a PackageDescription from a GenericPackageDescription you either
need to flatten it, or to pick a particular configuration, ie resolve
all the conditionals.

If you want to build the package then flattening does not make sense,
you must instead finalise it, using finalizePackageDescription.


More information about the cabal-devel mailing list