Remove Setup.hs, use Setup.lhs only

Simon Marlow simonmar at
Thu Nov 30 09:05:06 EST 2006

Ian Lynagh wrote:
> On Sat, Nov 25, 2006 at 09:57:50AM -0800, Isaac Jones wrote:
>>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
> What's the advantage of making it optional, especially now we have
> mkcabal to make the defaultMain Setup.lhs for us? It would be much
> simpler, IMO, if it was the case that all cabal packages have a
> Setup.lhs file.
> As we need to support the presence of a Setup.lhs, no tool can be made
> simpler by allowing it to be absent (and many will need a little extra
> complexity to cope), and the only saving is a tiny amount of compilation
> for one (admittedly common) case.

Lets we forget, the main reason for wanting cabal-setup was so that it can read 
the .cabal file and select the right version of the Cabal package to use when 
reading Setup.l?hs, so we can handle Setup.lhs scripts that depend on particular 
versions of the Cabal API.  It has been quite common to encounter compile errors 
in Setup.lhs scripts recently, and this is very confusing for users.


More information about the cabal-devel mailing list