[Haskell] cabal feature request

Isaac Jones ijones at syntaxpolice.org
Fri Apr 22 03:17:46 EDT 2005

Benjamin Franksen <benjamin.franksen at bessy.de> writes:

> I finally succeeded using cabal for a project that uses hsc2hs. My problem 
> was/is I need to give special options to hsc2hs, for instance a different 
> template header file to use. Cabal doesn't support this at the moment.
> I propose to give the user a bit more flexibility with regard to 
> preprocessors, i.e. add some more tags to the .cabal file, like
> hsc2hs-options, cpp-options, ...
> I made the necessary changes for hsc2hs-options in a few minutes

Did you alter the Cabal library itself?  If so, then that won't work
when you go to distribute it to others, since they won't have your
altered cabal.

You could do this in the UserHooks, by over-riding the hsc2hs
preprocessor in your Setup.lhs file.  If you grab the cabal source,
there's an example in the tests directory called withHooks that might
help.  That, and looking at the cabal source itself :)

> (thanks to the nicely structured cabal libraries :).


> Another question: Is there a proposal how to (better) support test
> executables for a library package? (I remember that this topic has
> been discussed but can't remember any conclusion).

With the latest (darcs / cvs) version of Cabal, you can add a UserHook
for running tests, then there's a target ./setup test that'll execute
that hook.

We put the hook in Cabal 1.0, but forgot to add the command, so
nothing calls it.  Feel free to add the test hook so that people using
newer versions of cabal can run your tests :)



More information about the Haskell mailing list