That actually runs contrary to one of cabal&#39;s other practices, which is to add a &#39;simple&#39; Setup.hs to your package as it makes the sdist is one is not present. With your proposed change, it would then complain about _every_ package that used simple. ;)<div>
<br></div><div>Setup.hs exists so that you can execute runhaskell Setup.hs foo instead of cabal foo. You just need to tell cabal if you want to delegate to Setup.hs, by using something other than Simple as a build-type. The vast majority of the users of cabal never bother changing the behavior of Setup.hs.</div>
<div><br></div><div>-Edward Kmett<br><br><div class="gmail_quote">On Thu, Jul 22, 2010 at 11:58 PM, Mark Wotton <span dir="ltr">&lt;<a href="mailto:mwotton@gmail.com">mwotton@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Fri, Jul 23, 2010 at 12:33 PM, wren ng thornton &lt;<a href="mailto:wren@freegeek.org">wren@freegeek.org</a>&gt; wrote:<br>
&gt; Magnus Therning wrote:<br>
&gt;&gt;<br>
&gt;&gt; On Thu, Jul 22, 2010 at 11:52, Ross Paterson &lt;<a href="mailto:ross@soi.city.ac.uk">ross@soi.city.ac.uk</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Thu, Jul 22, 2010 at 11:31:21AM +0100, Magnus Therning wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Thu, Jul 22, 2010 at 10:59, Ross Paterson &lt;<a href="mailto:ross@soi.city.ac.uk">ross@soi.city.ac.uk</a>&gt;<br>
&gt;&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Magnus is building by directly running the Setup.hs himself, which<br>
&gt;&gt;&gt;&gt;&gt; ignores<br>
&gt;&gt;&gt;&gt;&gt; the Build-Type.  To get cabal-install to use his Setup.hs, the<br>
&gt;&gt;&gt;&gt;&gt; Build-Type<br>
&gt;&gt;&gt;&gt;&gt; must be set to Custom.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Oh, why*2?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Why is the header there if it&#39;s not used by Cabal, and why does cabal<br>
&gt;&gt;&gt;&gt; care?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; The field allows cabal to avoid compiling the Setup.hs in this case.<br>
&gt;&gt;&gt; It might also be used by other tools, e.g. one might only trust Simple<br>
&gt;&gt;&gt; packages.  Not all fields are used by all tools, and several of them<br>
&gt;&gt;&gt; do not affect the operation of the library (e.g. Home-page).<br>
&gt;&gt;<br>
&gt;&gt; All right, so why would cabal want to avoid compiling the Setup.hs?<br>
&gt;&gt;<br>
&gt;&gt; Of course this behaviour of cabal&#39;s means that I in the future will use<br>
&gt;&gt; *Custom*<br>
&gt;&gt; all the time, since I otherwise have to remember this surprising feature<br>
&gt;&gt; of a<br>
&gt;&gt; tool I never use.  Is there any reason *not* to do this?<br>
&gt;<br>
&gt; The main reason I could think of to avoid compiling it is for performance<br>
&gt; reasons. I&#39;m not sure how compelling that is, but...<br>
&gt;<br>
&gt; As for why not to always use Custom, as mentioned there are cabal-aware<br>
&gt; tools out there besides cabal-install. For these other tools, there is a big<br>
&gt; difference between Simple and Custom. With Simple we (ideally) already know<br>
&gt; all the semantics of what Setup.hs does, and so we can wire that into our<br>
&gt; tools. With Custom we&#39;re forced into the position of doing Haskell source<br>
&gt; analysis since we now have to discover the semantics of an arbitrary Turing<br>
&gt; machine. That&#39;s a very high wall to climb if you&#39;re just wanting to write a<br>
&gt; simple tool for doing some kind of package analysis.<br>
&gt;<br>
&gt; (I don&#39;t think the behavior is surprising since I interpret Simple to mean<br>
&gt; that the Setup.hs file is unused/optional. Though clearly YMMV)<br>
<br>
<br>
</div></div>Ah, this clears up one of my bugs.<br>
<br>
Perhaps cabal should print a warning if you have a Setup.hs file,<br>
_and_ try to use Simple? It&#39;d at least give the hint that they&#39;re<br>
unhappy together.<br>
<br>
mark<br>
<font color="#888888"><br>
--<br>
A UNIX signature isn&#39;t a return address, it&#39;s the ASCII equivalent of a<br>
black velvet clown painting. It&#39;s a rectangle of carets surrounding a<br>
quote from a literary giant of weeniedom like Heinlein or Dr. Who.<br>
        -- Chris Maeda<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div>