Remove Setup.hs, use Setup.lhs only

Isaac Jones ijones at
Sat Nov 25 12:57:50 EST 2006

Ross Paterson <ross at> writes:

> On Wed, Nov 22, 2006 at 01:36:13AM +0000, Duncan Coutts wrote:
>> Note that in future we intend to allow there being no Setup.(l)hs at all
>> when using cabal-setup. No Setup.(l)hs file would be equivalent to the
>> basic one that uses defaultMain.
> Could we have an optional field in the package description to tell
> cabal-setup which setup to use?  There could be tokens representing
> 	main = Distribution.Simple.defaultMain
> 	main = Distribution.Simple.defaultMainWithHooks defaultUserHooks
> 	main = Distribution.Make.defaultMain

Since we've decided to go with making Setup.[l]hs optional, I agree
that this is the way to go, except:

> 	user-supplied Setup.[l]hs

Hmm.  This one is a little funny, since it's the Setup program (or
cabal-setup) that's reading the .cabal file, but it kinda makes sense

I also like Ian's suggestion, and it would be good to do it all at the
same time, while providing warnings for Setup.hs users.

So a summary of the new rules would be something like:

* Setup.lhs will be found automatically, as it is now.

* Setup.hs will be found and complained about with an error.  Maybe in
  the interum, we can have a warning.  In the common case, the error
  can be fixed by deleting Setup.hs and using cabal-setup :)

* Setup will become optional, and cabal-setup will do the job of
  defaultMain (or whatever is in the new field).

* A new field will be introduced to indicate what kind of build system
  cabal-setup should use, in the absense of a Setup.lhs file.

I anticipate some objections, because some people _hate_ .lhs, but we
can see how it goes; in that case, they could always use the
user-supplied field to tell cabal layered tools to use the
Setup.Foo.Hs or whatever the user wants.

Ross, how do you see the fields panning out?  Want to implement it? :)



More information about the cabal-devel mailing list