<p>Ccing cabal-dev.</p>
<p>On Aug 17, 2011 9:12 AM, &quot;Rogan Creswick&quot; &lt;<a href="mailto:creswick@gmail.com">creswick@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; On Wed, Aug 17, 2011 at 6:29 AM, Gang &lt;<a href="mailto:yugang.bj@gmail.com">yugang.bj@gmail.com</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; sorry to bother<br>
&gt; &gt;<br>
&gt;<br>
&gt; Not in the least!<br>
&gt;<br>
&gt; I was trying to figure out what problem you were encountering, and I<br>
&gt; learned a lot.  I never did recreate your problem, but in the process<br>
&gt; I ran into a whole host of other annoyances and strange situations<br>
&gt; relating to slightly broken cabal files and cabal build intricacies<br>
&gt; that confound our existing tools.<br>
&gt;<br>
&gt; I don&#39;t mean to pick on encoding or HaXml - I&#39;ve seen the same kinds<br>
&gt; of issues in many, many Haskell packages (including most of the<br>
&gt; packages I&#39;ve written myself) these are just the ones I ran into<br>
&gt; today. (and I am quite serious when I say that writing a good Setup.hs<br>
&gt; is very, very, difficult).  My objective is just to motivate a minor<br>
&gt; change to cabal that would help to make this easier.<br>
&gt;<br>
&gt; On to the build problems:<br>
&gt;<br>
&gt; encoding-0.6.6 uses it&#39;s own source during the build process! It<br>
&gt; actually has to be partially compiled before the build tool can build<br>
&gt; encoding (!).  I&#39;m *amazed* that this actually works at all<br>
&gt; (impressed, too), and indeed, it doesn&#39;t work with cabal-dev, which is<br>
&gt; unfortunate: cabal-dev would have identified one of the dependency<br>
&gt; issues in HaXml 1.19 (pretty is an undocumented dependency, although I<br>
&gt; am unsure if that was true at the time 1.19 and encoding-0.6.6 were<br>
&gt; released.  I haven&#39;t tracked the pretty dependency down to the exact<br>
&gt; source - it could be a transitive dep introduced by a recent version<br>
&gt; of something HaXml 1.19 needs.  Per my subject line - this is<br>
&gt; amazingly difficult - keep in mind that we&#39;re not talking about<br>
&gt; building *packages*, this is just to build the *build tool*, and none<br>
&gt; of this is documented.  How long before it is effectively impossible<br>
&gt; to recreate the circumstances that result in a successful<br>
&gt; encoding-0.6.6 build?).<br>
&gt;<br>
&gt; cabal-dev can&#39;t build encoding-0.6.6 because the encoding source that<br>
&gt; is referenced from encoding&#39;s Setup.hs depends on (at least) HaXml &gt;=<br>
&gt; 1.19 &amp;&amp; &lt; 1.22.5; this is OK with cabal, since cabal-install installs<br>
&gt; a necessary HaXml into your user package db prior to building<br>
&gt; encoding&#39;s Setup.hs (modulo the missing upper version bound).<br>
&gt; Therefore HaXml &quot;just happens&quot; to be visible when cabal builds<br>
&gt; Setup.hs -- a build step that cabal-dev isn&#39;t capable of controlling<br>
&gt; (and probably never will be -- we could intercept system calls, but<br>
&gt; that&#39;s difficult when only supporting one OS, much less three).<br>
&gt;<br>
&gt; You can, of course, manually install HaXml to your local package db<br>
&gt; and then cabal-dev install encodings, but that&#39;s somewhat of a hack<br>
&gt; (and you&#39;ll find that the current HaXml won&#39;t work for the current<br>
&gt; encodings release, as Gang Yu did).<br>
&gt;<br>
&gt; Adding a section to the cabal file that specifies build dependencies<br>
&gt; for Setup.hs would make some very important parts of this process<br>
&gt; obvious - and it would *greatly* assist in debugging failing builds,<br>
&gt; not to mention allowing us to make use of the extensive libraries on<br>
&gt; hackage to write more expressive build systems.  (We could actually<br>
&gt; use openshake in Setup.hs, once it&#39;s released, for example!)<br>
&gt;<br>
&gt; I&#39;ve floated the idea past a number of Haskell programmers with<br>
&gt; positive responses, and there is a GSOC ticket that provides some more<br>
&gt; details (the project was not selected - no students proposed to work<br>
&gt; on it):<br>
&gt;<br>
&gt; <a href="http://hackage.haskell.org/trac/summer-of-code/ticket/1602">http://hackage.haskell.org/trac/summer-of-code/ticket/1602</a><br>
&gt;<br>
&gt; --Rogan<br>
&gt;<br>
&gt; &gt; Regards<br>
&gt; &gt; Gang<br>
&gt; &gt; On 08/17/2011 04:59 PM, Gang Yu wrote:<br>
&gt; &gt;<br>
&gt; &gt; hi, cafe:<br>
&gt; &gt;<br>
&gt; &gt;     I go through to the encoding package installation problem again.<br>
&gt; &gt;<br>
&gt; &gt;  cabal install encoding<br>
&gt; &gt; Resolving dependencies...<br>
&gt; &gt; /tmp/encoding-0.6.68093/encoding-0.6.6/dist/setup/setup: 4: Syntax error:<br>
&gt; &gt; &quot;;&quot; unexpected<br>
&gt; &gt;<br>
&gt; &gt; when I have a check on the this issue, I get:<br>
&gt; &gt;<br>
&gt; &gt; file<br>
&gt; &gt; ~/.cabal/packages/<a href="http://hackage.haskell.org/encoding/0.6.6/encoding-0.6.6/dist/setup/setup">hackage.haskell.org/encoding/0.6.6/encoding-0.6.6/dist/setup/setup</a><br>
&gt; &gt; /home/gang/.cabal/packages/<a href="http://hackage.haskell.org/encoding/0.6.6/encoding-0.6.6/dist/setup/setup">hackage.haskell.org/encoding/0.6.6/encoding-0.6.6/dist/setup/setup</a>:<br>
&gt; &gt; ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked<br>
&gt; &gt; (uses shared libs), for GNU/Linux 2.6.27, not stripped<br>
&gt; &gt;<br>
&gt; &gt; My machine is:<br>
&gt; &gt;<br>
&gt; &gt; gang@gang-laptop:~$ uname -a<br>
&gt; &gt; Linux gang-laptop 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC<br>
&gt; &gt; 2011 i686 i686 i386 GNU/Linux<br>
&gt; &gt;<br>
&gt; &gt; is this related? How can I manually install the package from scratch? Any<br>
&gt; &gt; helps or directs will be appreciated<br>
&gt; &gt;<br>
&gt; &gt; Thanks<br>
&gt; &gt; Gang<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Haskell-Cafe mailing list<br>
&gt; &gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt; &gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Haskell-Cafe mailing list<br>
&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</p>