Hi Duncan,<br><br>&nbsp;&nbsp;&nbsp;&nbsp; Not sure I agree the behavior is ok. E.g. here is a build of mmap:<br><br>vigalchin@ubuntu:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell Setup.lhs clean<br>cleaning...<br>vigalchin@ubuntu:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell Setup.lhs configure<br>
Configuring bytestring-mmap-0.2.0...<br>vigalchin@ubuntu:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell Setup.lhs build<br>Preprocessing library bytestring-mmap-0.2.0...<br>Building bytestring-mmap-0.2.0...<br>[1 of 3] Compiling System.IO.Posix.MMap.Internal ( System/IO/Posix/MMap/Internal.hs, dist/build/System/IO/Posix/MMap/Internal.o )<br>
[2 of 3] Compiling System.IO.Posix.MMap.Lazy ( System/IO/Posix/MMap/Lazy.hs, dist/build/System/IO/Posix/MMap/Lazy.o )<br>[3 of 3] Compiling System.IO.Posix.MMap ( System/IO/Posix/MMap.hs, dist/build/System/IO/Posix/MMap.o )<br>
/usr/bin/ar: creating dist/build/libHSbytestring-mmap-0.2.0.a<br><br>at this point rebuild and install the &quot;unix&quot; package ...<br><br>vigalchin@ubuntu:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell Setup.lhs clean<br>
cleaning...<br>vigalchin@ubuntu:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell Setup.lhs configure<br>Configuring bytestring-mmap-0.2.0...<br>vigalchin@ubuntu:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell Setup.lhs build<br>
Setup.lhs: error reading dist/setup-config; run &quot;setup configure&quot; command?<br><br>&quot;dist/setup-config&quot; is not being populated at the end. In your response below, are you saying that teh segfaults occur because ghc itself relies on the &quot;unix&quot; package?<br>
<br>Thanks, Vasili<br><br><br><br><br><div class="gmail_quote">On Mon, Jun 2, 2008 at 5:38 AM, Duncan Coutts &lt;<a href="mailto:duncan.coutts@worc.ox.ac.uk">duncan.coutts@worc.ox.ac.uk</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br>
On Mon, 2008-06-02 at 00:07 -0500, Galchin, Vasili wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; I have been developing new code for the &quot;unix&quot; package. I have<br>
&gt; run into what I think are ghc 6.8.2 anomalies but couldn&#39;t see a<br>
&gt; pattern. Possibly now I do. I have been using the 32-bit x86 ghc<br>
&gt; binary that I downloaded from <a href="http://www.haskell.org" target="_blank">http://www.haskell.org</a> and running on<br>
&gt; Ubuntu Linux. I am pretty I can repeat now. Everything is ok until I<br>
&gt; do &quot;sudo runhaskell Setup.hs install&quot; which installs a new &quot;unix&quot;<br>
&gt; package that I just built. Of course the &quot;intall&quot; installs<br>
&gt; into /usr/local/lib/unix-2.3.0.0/ghc-6.8.2. The &quot;install&quot; seems to<br>
&gt; destroy some ghc compiler state under /usr/local ...<br>
<br>
</div>That sounds right. You&#39;re replacing the unix-2.3.0.0 library that comes<br>
with ghc-6.8.2 with your own version. It is highly unlikely to be ABI<br>
compatible with the one you are replacing and so all the other packages<br>
that already depends on the existing unix-2.3.0.0 library end up broken.<br>
You&#39;d expect this kind of breakage to be exposed as link errors and<br>
segfaults.<br>
<br>
I suggest you do not replace any of the libraries that come with ghc. To<br>
be more precise, it is perfectly ok to *add new versions* but it is not<br>
ok to *replace existing versions* without rebuilding all the other libs<br>
that depend on it.<br>
<br>
Make sense?<br>
<br>
So if you really want to make changes to the unix lib, make sure you<br>
change the version number too. I also suggest not installing the<br>
packages as root, just install them locally. That way you can guarantee<br>
you never mess up your ghc install. You would be able to revert to a<br>
clean ghc install just by removing your<br>
~/.ghc/$arch/ghc-6.8.2/package.conf file which will unregister *all*<br>
locally registered packages. To unregister individual packages use<br>
ghc-pkg --user unregister $pkgname<br>
<font color="#888888"><br>
Duncan<br>
<br>
</font></blockquote></div><br>