Cabal preprocessing

Duncan Coutts duncan.coutts at
Wed Nov 29 20:14:23 EST 2006

On Wed, 2006-11-29 at 17:12 +0100, Ulf Norell wrote:
> Hi.
> Currently when Cabal preprocesses a module the result ends up in the  
> source directory. I would have expected it to end up in dist, since  
> it's a generated file and not a source file.

I would tend to agree. Wherever possible I think it'd be preferable to
put generated sources in the build tree not the source tree.

> So,
> - are there strong reasons for putting preprocessed files in src?

Mostly, not having got round to doing it. If you're volunteering to look
into doing this, then great!

There are cases, as Stefan mentions, where it's less clear cut, like
generated sources that we expect to distribute.

> - if not, is there a simple (and robust) way to have them end up in  
> dist?

I expect not. I think it needs changes to Cabal.

I think it should be possible though, since most tools either allow the
locations of all the source files to be specified explicitly, or provide
a search dir feature.


More information about the cabal-devel mailing list