Cabal preprocessing

Ulf Norell ulfn at
Thu Nov 30 03:57:45 EST 2006

On Nov 29, 2006, at 10:21 PM, Stefan Holdermans wrote:

>> - are there strong reasons for putting preprocessed files in src?
> One reason could be that, when distributing *sources*, you'd want  
> the generated file to be included as well (that is, you want to  
> regard it as a source file), for the system your program is to be  
> compiled on might not have the preprocessor available and you don't  
> want to make that a hard requirement... Of course, you can still  
> achieve this by putting it in dist and put the file from dist in  
> the generated tarball, but, arguably, the way it's done now, makes  
> explicit that the file might be viewed as a source file.

The problem with that is that someone getting the sources might get  
the idea that the preprocessed file is  an actual source file and try  
to modify it (or just make sense of it, imagine someone trying to  
read a happy parser...). Including parts of dist in the tarball makes  
it clear that what you get is not a vanilla source distribution.

> Also, building executables with GHC --make requires (?) modules to  
> be present in designated locations in the directory tree...

You just have to run GHC with -idist/... This is the way I had it set  
up before migrating to Cabal.

/ Ulf

More information about the cabal-devel mailing list