
Hello, I am having trouble loading the unix package. I am not sure what I am doing wrong. I have just installed it from hackage. As you can see below, the error message complains about an unknown symbol 'lstat', which is not in libc. [1]$ ghci -package unix ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.6, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \____/\/ /_/\____/|_| Type :? for help. Loading package base ... linking ... done. ghc-6.6: /home/frederik/lib/unix-2.0/ghc-6.6/HSunix-2.0.o: unknown symbol `lstat' Loading package unix-2.0 ... linking ... ghc-6.6: unable to load package `unix-2.0' [1]$ nm -D /lib/libc-2.5.so | grep -w lstat [1]$ This is an unstable Debian installation. When I try the same on a system with ghc 6.4.2 and unix-1.0, there is no problem. That system has libc 2.3.6, which also lacks an 'lstat' symbol. Thank you for your help. Frederik

On Thu, Apr 19, 2007 at 12:27:01PM +0100, Frederik Eaton wrote:
Hello,
I am having trouble loading the unix package. I am not sure what I am doing wrong. I have just installed it from hackage. As you can see below, the error message complains about an unknown symbol 'lstat', which is not in libc.
[1]$ ghci -package unix ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.6, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \____/\/ /_/\____/|_| Type :? for help.
Loading package base ... linking ... done. ghc-6.6: /home/frederik/lib/unix-2.0/ghc-6.6/HSunix-2.0.o: unknown symbol `lstat' Loading package unix-2.0 ... linking ... ghc-6.6: unable to load package `unix-2.0' [1]$ nm -D /lib/libc-2.5.so | grep -w lstat [1]$
This is an unstable Debian installation.
When I try the same on a system with ghc 6.4.2 and unix-1.0, there is no problem. That system has libc 2.3.6, which also lacks an 'lstat' symbol.
Thank you for your help.
This is a duplicate of an already reported bug, fixed in HEAD. (unfortunately I can't find the number today) Stefan

Thanks. How do I get the HEAD? Frederik On Thu, Apr 19, 2007 at 06:53:20AM -0700, Stefan O'Rear wrote:
On Thu, Apr 19, 2007 at 12:27:01PM +0100, Frederik Eaton wrote:
Hello,
I am having trouble loading the unix package. I am not sure what I am doing wrong. I have just installed it from hackage. As you can see below, the error message complains about an unknown symbol 'lstat', which is not in libc.
[1]$ ghci -package unix ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.6, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \____/\/ /_/\____/|_| Type :? for help.
Loading package base ... linking ... done. ghc-6.6: /home/frederik/lib/unix-2.0/ghc-6.6/HSunix-2.0.o: unknown symbol `lstat' Loading package unix-2.0 ... linking ... ghc-6.6: unable to load package `unix-2.0' [1]$ nm -D /lib/libc-2.5.so | grep -w lstat [1]$
This is an unstable Debian installation.
When I try the same on a system with ghc 6.4.2 and unix-1.0, there is no problem. That system has libc 2.3.6, which also lacks an 'lstat' symbol.
Thank you for your help.
This is a duplicate of an already reported bug, fixed in HEAD. (unfortunately I can't find the number today)
Stefan _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

On Thu, Apr 19, 2007 at 03:10:10PM +0100, Frederik Eaton wrote:
Thanks. How do I get the HEAD?
darcs get --partial http://darcs.haskell.org/ghc cd ghc chmod +x darcs-all ./darcs-all --extra get cd .. mkdir ghcbuild cd ghcbuild lndir ../ghc autoreconf ./configure make su -c 'make install' This particular issue will almost certainly be fixed in 6.6.1 (which isn't released yet). In the meantime, if you don't want to use the darcs version of the compiler, note that unix works fine in programs compiled with -fvia-C. Stefan

On 19/04/2007, at 16:15, Stefan O'Rear wrote:
On Thu, Apr 19, 2007 at 03:10:10PM +0100, Frederik Eaton wrote:
Thanks. How do I get the HEAD?
darcs get --partial http://darcs.haskell.org/ghc cd ghc chmod +x darcs-all ./darcs-all --extra get cd .. mkdir ghcbuild cd ghcbuild lndir ../ghc autoreconf
sh boot
./configure make su -c 'make install'
This particular issue will almost certainly be fixed in 6.6.1 (which isn't released yet).
In the meantime, if you don't want to use the darcs version of the compiler, note that unix works fine in programs compiled with -fvia-C.
Stefan _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

Those commands caused my computer to become so unusably slow that I had to hard-reboot. How much RAM is needed? I have 512MB... Frederik On Thu, Apr 19, 2007 at 04:34:21PM +0200, Pepe Iborra wrote:
On 19/04/2007, at 16:15, Stefan O'Rear wrote:
On Thu, Apr 19, 2007 at 03:10:10PM +0100, Frederik Eaton wrote:
Thanks. How do I get the HEAD?
darcs get --partial http://darcs.haskell.org/ghc cd ghc chmod +x darcs-all ./darcs-all --extra get cd .. mkdir ghcbuild cd ghcbuild lndir ../ghc autoreconf
sh boot
./configure make su -c 'make install'
This particular issue will almost certainly be fixed in 6.6.1 (which isn't released yet).
In the meantime, if you don't want to use the darcs version of the compiler, note that unix works fine in programs compiled with -fvia-C.
Stefan _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

Now, I have run 'make' again and there is an error message: [32 of 32] Compiling Main ( Setup.hs, Setup.o ) Linking Setup ... rm -f -rf X11/setup mkdir X11/setup cp X11/Setup.*hs X11/setup cd X11/setup && /home/frederik/arch/i386/bin/ghc -Wall --make -i../../bootstrapping.cabal Setup.*hs -o Setup [32 of 32] Compiling Main ( Setup.hs, Setup.o ) Linking Setup ... rm -f -rf time/setup mkdir time/setup cp time/Setup.*hs time/setup cd time/setup && /home/frederik/arch/i386/bin/ghc -Wall --make -i../../bootstrapping.cabal Setup.*hs -o Setup [32 of 32] Compiling Main ( Setup.hs, Setup.o ) Setup.hs:35:32: Couldn't match expected type `()' against inferred type `GHC.IOBase.ExitCode' Expected type: IO () Inferred type: IO GHC.IOBase.ExitCode In the second argument of `withCurrentDirectory', namely `(system "make")' In the expression: withCurrentDirectory "test" (system "make") make[1]: *** [time/setup/Setup] Error 1 make[1]: Leaving directory `/home/frederik/ghcbuild/libraries' make: *** [stage1] Error 2 Linking with the 'unix' package is turning into a very difficult problem! Frederik On Thu, Apr 19, 2007 at 05:02:15PM +0100, Frederik Eaton wrote:
Those commands caused my computer to become so unusably slow that I had to hard-reboot. How much RAM is needed? I have 512MB...
Frederik
On Thu, Apr 19, 2007 at 04:34:21PM +0200, Pepe Iborra wrote:
On 19/04/2007, at 16:15, Stefan O'Rear wrote:
On Thu, Apr 19, 2007 at 03:10:10PM +0100, Frederik Eaton wrote:
Thanks. How do I get the HEAD?
darcs get --partial http://darcs.haskell.org/ghc cd ghc chmod +x darcs-all ./darcs-all --extra get cd .. mkdir ghcbuild cd ghcbuild lndir ../ghc autoreconf
sh boot
./configure make su -c 'make install'
This particular issue will almost certainly be fixed in 6.6.1 (which isn't released yet).
In the meantime, if you don't want to use the darcs version of the compiler, note that unix works fine in programs compiled with -fvia-C.
Stefan _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
-- http://ofb.net/~frederik/ _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

On Thu, Apr 19, 2007 at 05:02:15PM +0100, Frederik Eaton wrote:
Those commands caused my computer to become so unusably slow that I had to hard-reboot. How much RAM is needed? I have 512MB...
I have 384, and I can run a parallel build (-j2) in the background without any noticable interaction with anything else I try to do. You must have a different problem :( Stefan

Ah, I sent my message before checking to see if you had replied to the previous one, sorry. Is this not a source for the unix package, then?: http://darcs.haskell.org/packages/unix/ As for the -fvia-C suggestion, I guess that it is not a solution for when using unix under ghci? Thanks, Frederik On Thu, Apr 19, 2007 at 07:15:16AM -0700, Stefan O'Rear wrote:
On Thu, Apr 19, 2007 at 03:10:10PM +0100, Frederik Eaton wrote:
Thanks. How do I get the HEAD?
darcs get --partial http://darcs.haskell.org/ghc cd ghc chmod +x darcs-all ./darcs-all --extra get cd .. mkdir ghcbuild cd ghcbuild lndir ../ghc autoreconf ./configure make su -c 'make install'
This particular issue will almost certainly be fixed in 6.6.1 (which isn't released yet).
In the meantime, if you don't want to use the darcs version of the compiler, note that unix works fine in programs compiled with -fvia-C.
Stefan _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

Hello Stefan, Thanks for your reply. Now I have found a repository here, is this the right one? http://darcs.haskell.org/packages/unix/ However, it doesn't build for me: $ darcs get --partial http://darcs.haskell.org/packages/unix/ ... $ cas configure --user --prefix=$HOME && cas build && cas install --user Setup.hs:17:30: Couldn't match expected type `UserHooks' against inferred type `Maybe UserHooks' Expected type: Hook a Inferred type: PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> BuildFlags -> IO () In the second argument of `($)', namely `buildHook defaultUserHooks' In the `buildHook' field of a record $ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.6 Is this a cabal version problem? Yet it seems odd that unix-2.0 builds, but unix HEAD which also has version 2.0 doesn't build... I have a project which depends on 'unix' which I would like to use, so if you can point me to a working version or tell me what to fix then it would be helpful. Thanks, Frederik On Thu, Apr 19, 2007 at 06:53:20AM -0700, Stefan O'Rear wrote:
On Thu, Apr 19, 2007 at 12:27:01PM +0100, Frederik Eaton wrote:
Hello,
I am having trouble loading the unix package. I am not sure what I am doing wrong. I have just installed it from hackage. As you can see below, the error message complains about an unknown symbol 'lstat', which is not in libc.
[1]$ ghci -package unix ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.6, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \____/\/ /_/\____/|_| Type :? for help.
Loading package base ... linking ... done. ghc-6.6: /home/frederik/lib/unix-2.0/ghc-6.6/HSunix-2.0.o: unknown symbol `lstat' Loading package unix-2.0 ... linking ... ghc-6.6: unable to load package `unix-2.0' [1]$ nm -D /lib/libc-2.5.so | grep -w lstat [1]$
This is an unstable Debian installation.
When I try the same on a system with ghc 6.4.2 and unix-1.0, there is no problem. That system has libc 2.3.6, which also lacks an 'lstat' symbol.
Thank you for your help.
This is a duplicate of an already reported bug, fixed in HEAD. (unfortunately I can't find the number today)
Stefan _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

On Thu, 2007-04-19 at 15:30 +0100, Frederik Eaton wrote:
Hello Stefan,
Thanks for your reply. Now I have found a repository here, is this the right one?
http://darcs.haskell.org/packages/unix/
However, it doesn't build for me:
$ darcs get --partial http://darcs.haskell.org/packages/unix/ ... $ cas configure --user --prefix=$HOME && cas build && cas install --user
Setup.hs:17:30: Couldn't match expected type `UserHooks' against inferred type `Maybe UserHooks'
It would be much easier for you to use the GHC 6.6.x branch rather than trying to use the HEAD branch which as you can see depends on development versions of various other things (including in this case a development version of cabal). Or as was suggested as an temporary workaround just compile your code -fvia-C and then load it up in GHCi. Duncan

Or as was suggested as an temporary workaround just compile your code -fvia-C and then load it up in GHCi.
I've compiled everything with -fvia-C and I still get the same error: $ ghci -package vectro ... Loading package base ... linking ... done. Loading package mtl-1.0 ... linking ... done. Loading package haskell98 ... linking ... done. Loading package X11-1.2 ... linking ... done. Loading package template-haskell ... linking ... done. Loading package stm-2.0 ... linking ... done. Loading package fgl-5.2 ... linking ... done. Loading package parsec-2.0 ... linking ... done. Loading package html-1.0 ... linking ... done. Loading package network-2.0 ... linking ... done. Loading package futility-base-0.1.9 ... linking ... done. ghc-6.6: /home/frederik/lib/unix-2.0/ghc-6.6/HSunix-2.0.o: unknown symbol `lstat' Loading package unix-2.0 ... linking ... ghc-6.6: unable to load package `unix-2.0' What am I doing wrong? Thanks, Frederik On Fri, Apr 20, 2007 at 09:54:16AM +1000, Duncan Coutts wrote:
On Thu, 2007-04-19 at 15:30 +0100, Frederik Eaton wrote:
Hello Stefan,
Thanks for your reply. Now I have found a repository here, is this the right one?
http://darcs.haskell.org/packages/unix/
However, it doesn't build for me:
$ darcs get --partial http://darcs.haskell.org/packages/unix/ ... $ cas configure --user --prefix=$HOME && cas build && cas install --user
Setup.hs:17:30: Couldn't match expected type `UserHooks' against inferred type `Maybe UserHooks'
It would be much easier for you to use the GHC 6.6.x branch rather than trying to use the HEAD branch which as you can see depends on development versions of various other things (including in this case a development version of cabal).
Or as was suggested as an temporary workaround just compile your code -fvia-C and then load it up in GHCi.
Duncan

Frederik Eaton wrote:
Or as was suggested as an temporary workaround just compile your code -fvia-C and then load it up in GHCi.
I've compiled everything with -fvia-C and I still get the same error:
$ ghci -package vectro ... Loading package base ... linking ... done. Loading package mtl-1.0 ... linking ... done. Loading package haskell98 ... linking ... done. Loading package X11-1.2 ... linking ... done. Loading package template-haskell ... linking ... done. Loading package stm-2.0 ... linking ... done. Loading package fgl-5.2 ... linking ... done. Loading package parsec-2.0 ... linking ... done. Loading package html-1.0 ... linking ... done. Loading package network-2.0 ... linking ... done. Loading package futility-base-0.1.9 ... linking ... done. ghc-6.6: /home/frederik/lib/unix-2.0/ghc-6.6/HSunix-2.0.o: unknown symbol `lstat' Loading package unix-2.0 ... linking ... ghc-6.6: unable to load package `unix-2.0'
What am I doing wrong?
How did you compile with -fvia-C? I think you'd have to add it to the ghc-options field in unix.cabal, using the unix package that you got from Hackage. The unix package from darcs needs the darcs version of Cabal, which you don't have. Cheers, Simon

As for using the 6.6.x branch rather than HEAD, how should I modify these commands to do that? Presumably with some kind of --tag option to darcs? (how do I list the tags?) #!/bin/sh darcs get --partial http://darcs.haskell.org/ghc cd ghc chmod +x darcs-all ./darcs-all --extra get cd .. mkdir ghcbuild cd ghcbuild lndir ../ghc autoreconf sh boot ./configure make su -c 'make install' Also, is there a way to get only the unix package and not all of ghc? For instance, can I not use this repository somehow?: http://darcs.haskell.org/packages/unix/ Also, how many other people are affected by the bug in unix? I am wondering why not just make another release of the package to fix the bug, so that the version which is provided as a .tar.gz for download is not buggy. Surely the release process is automated... Thanks for your continuing help, Frederik On Fri, Apr 20, 2007 at 09:54:16AM +1000, Duncan Coutts wrote:
On Thu, 2007-04-19 at 15:30 +0100, Frederik Eaton wrote:
Hello Stefan,
Thanks for your reply. Now I have found a repository here, is this the right one?
http://darcs.haskell.org/packages/unix/
However, it doesn't build for me:
$ darcs get --partial http://darcs.haskell.org/packages/unix/ ... $ cas configure --user --prefix=$HOME && cas build && cas install --user
Setup.hs:17:30: Couldn't match expected type `UserHooks' against inferred type `Maybe UserHooks'
It would be much easier for you to use the GHC 6.6.x branch rather than trying to use the HEAD branch which as you can see depends on development versions of various other things (including in this case a development version of cabal).
Or as was suggested as an temporary workaround just compile your code -fvia-C and then load it up in GHCi.
Duncan

I modified your script so that it retrieves ghc 6.6 and, instead of all the extra packages, only the unix package. Note that you probably want to include some other extra packages, for instance the mtl package. Untested:
#!/bin/sh darcs get --partial http://darcs.haskell.org/ghc-6.6/ghc cd ghc chmod +x darcs-all ./darcs-all get
darcs get --partial http://darcs.haskell.org/ghc-6.6/packages/unix/ libraries/unix
cd .. mkdir ghcbuild cd ghcbuild lndir ../ghc autoreconf
./configure make su -c 'make install'

Thanks Pepe, I have attached the script which I am now executing, to avoid confusion, since it seems there were wrapped lines in your message. (It seems to still be downloading and compiling all of ghc...?) Also, would you (or someone else) mind answering some of the other questions I have asked? I feel like I am in the dark - for instance what is the relevance or irrelevance of this repository: http://darcs.haskell.org/packages/unix/ (why can't I just install some working version of that?) and also from my previous message: Also, how many other people are affected by the bug in unix? I am wondering why not just make another release of the package to fix the bug, so that the version which is provided as a .tar.gz for download is not buggy. Surely the release process is automated... Is there a URL for the bug? (I was looking but haskell.org seems to be extremely slow for me) Maybe it would be easier if I just patched my own copy of the unix package? Just as an observation, this is my second day of not being able to work on my project because of this bug, which seems rather an inefficient situation, although I'm sure there are many complicated issues that I am not aware of. However, I am worried that if my library ever actually has any users, then they will run into the same stability problems, and blame me for them. I don't know what has gone wrong. Should I not be using GHC 6.6 yet? Thanks, Frederik On Fri, Apr 20, 2007 at 01:05:04PM +0200, Pepe Iborra wrote:
I modified your script so that it retrieves ghc 6.6 and, instead of all the extra packages, only the unix package. Note that you probably want to include some other extra packages, for instance the mtl package.
Untested:
#!/bin/sh darcs get --partial http://darcs.haskell.org/ghc-6.6/ghc cd ghc chmod +x darcs-all ./darcs-all get
darcs get --partial http://darcs.haskell.org/ghc-6.6/packages/unix/ libraries/unix
cd .. mkdir ghcbuild cd ghcbuild lndir ../ghc autoreconf
./configure make su -c 'make install'
participants (5)
-
Duncan Coutts
-
Frederik Eaton
-
Pepe Iborra
-
Simon Marlow
-
Stefan O'Rear