Remove Setup.hs, use Setup.lhs only

Ross Paterson ross at soi.city.ac.uk
Tue Nov 28 13:28:35 EST 2006


On Tue, Nov 28, 2006 at 12:28:56AM +0000, Duncan Coutts wrote:
> It's not clear to me that we need to have an extra field. I had
> originally envisaged that cabal-setup would just find the right compiler
> to build Setup.(l)hs and if there was none that it'd use defaultMain
> (possibly without needing to compile any setup binary).

If there was a Setup.[l]hs, it wouldn't be correct to use defaultMain,
would it?

> So do we really need a 'build-type:' field? Arn't there just two values
> for it, 'Simple' and 'Custom' (since all others are just different
> implementations of 'Custom')?

In that sense, there's only one value (Custom), but defaultMain is
common, and a reasonable number of packages use

	main = defaultMainWithHooks defaultUserHooks

I had a value for Distribution.Make.defaultMain too (but I don't know
if anyone uses that).

> Can't the Simple/Custom distinction be simply if the Setup.(l)hs is
> present or not?

If you have a field, cabal-setup can avoid compiling Setup.[l]hs in the
common cases.



More information about the cabal-devel mailing list