Hello!
This is the compilation of three messages, which I posted in
glasgow-haskell-users. Since the problem probably is a GHC bug, I think
glasgow-haskell-bugs is more appropriate.
-------------------------------------------------------------------------------
Im porting my HsShellScript library to GHC-7.0.4 and to Cabal/Hackage.
It builds and installs fine:
$ cabal clean
cleaning...
$ cabal configure
Resolving dependencies...
Configuring hsshellscript-3.0.0...
$ cabal build
Preprocessing library hsshellscript-3.0.0...
Building hsshellscript-3.0.0...
(...)
Registering hsshellscript-3.0.0...
$ cabal haddock
Running Haddock for hsshellscript-3.0.0...
Preprocessing library hsshellscript-3.0.0...
(...)
Documentation created: dist/doc/html/hsshellscript/index.html
$ cabal install
Resolving dependencies...
Configuring hsshellscript-3.0.0...
Preprocessing library hsshellscript-3.0.0...
Building hsshellscript-3.0.0...
Registering hsshellscript-3.0.0...
Installing library in /home/v/.cabal/lib/hsshellscript-3.0.0/ghc-7.0.4
Registering hsshellscript-3.0.0...
I've made a little test program src/test.hs:
import HsShellScript
main =
(outm "3\n1\n2\n")
-|- exec "/usr/bin/sort" ["-n"]
The program compiles, but it doesn't work as expected. It generates a
mysterious error message:
$ src/test
test: <stderr>: hPutStr: illegal operation (handle is closed)
test: timer_settime: Invalid argument
"timer_settime" occurs only in the generated test binary. It doesn't occur
anywhere in the library or in "/usr/bin/sort":
$ find -type f -print0|xargs -0 egrep timer_settime
Übereinstimmungen in Binärdatei ./src/test.
$ egrep timer_settime /usr/bin/sort
(no output)
It looks like GHC has introduced this mysterous call of timer_settime. What
does that mean?
Here's what happens with another test program:
This test program:
import HsShellScript
main =
call (exec "/bin/echo" ["bla bla"]
-|- exec "/bin/cat" [])
produces this output:
test: test: <stderr>: hPutStr: illegal operation (handle is
closed)<stderr>:
hPutStr: illegal operation (handle is closed)
test: timer_settimetest: : Invalid argument
timer_settime: Invalid argument
test: Exited (ExitFailure 1)
I'm almost sure that the two examples work fine in the last working version of
HsShellScript, which compiles with GHC-6.11. (I can't verify this, since I
have
GHC-7.0.4 version installed now. The old GHC version isn't available as a
Debian package any longer.)
So there appears to be a downwards-incompatibilty in the GHC libraries. I'm
fiddling with the internals quite a bit, in order to get forks, pipes and
redirects etc. working.
Any help would be appreciated.
Greetings,
Volker Wysk
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs