Skip to content

ghcjs + node - readProcess (or any runInteractiveProcess) fails to read from stdout #453

@kmandelbaum

Description

@kmandelbaum

Hello!

I'm having an issue with ghcjs and interactive process routines family.

Setup:

Linux kenny 4.2.5-1-ARCH #1 SMP PREEMPT Tue Oct 27 08:13:28 CET 2015 x86_64 GNU/Linux
The Glorious Glasgow Haskell Compilation System for JavaScript, version 0.2.0 (GHC 7.10.3)
The Glorious Glasgow Haskell Compilation System, version 7.10.3
node v5.3.0

Main.hs contents:

import System.Process
import System.IO
main = do
  x <- readProcess "echo" ["123"] []
  print x

Reproduction:

ghcjs Main.hs
node Main.jsexe/all.js

Output:

""
  • This example works with ghc - native binary output is "123".
  • If I use "touch" instead of "echo", the file "123" is created, so the process launching seems to work.
  • It looks like is's some piping that is broken/not implemented(?), because hGetContents seems to be working fine on non-pipe files (should check with the standalone pipes, though, without creating processes...)
  • I've found out this in attempts to investigate the failure of ghcjs-boot, when building cabal, when the Setup.hs got build by ghcjs, producing a javascript version of the setup, which was not able to determine ghcjs's version, like this, so my ghcjs-boot failed:
setup: The program 'ghcjs' version >=0.1 is required but the version of
/home/kost/.cabal/bin/ghcjs could not be determined.

Can anyone else reproduce?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions