Opened 3 years ago

Closed 3 years ago

#8943 closed feature request (fixed)

Add System.Process.createPipe

Reported by: tibbe Owned by:
Priority: normal Milestone: 7.10.1
Component: Core Libraries Version: 7.6.3
Keywords: Cc: core-libraries-committee@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

As agreed in: http://comments.gmane.org/gmane.comp.lang.haskell.libraries/21373

I've validated the patch on OS X, but I need someone to validate on Windows. I originally wrote this code for cabal and tested it on all platforms back then. I no longer have a Windows machine and the imports in System.Process are messy enough that someone needs to check that it still builds on Windows.

Attachments (2)

0001-Add-createPipe.patch (3.8 KB) - added by tibbe 3 years ago.
0001-Add-createPipe.2.patch (68.9 KB) - added by refold 3 years ago.
Updated version of the patch that compiles on Windows

Download all attachments as: .zip

Change History (12)

Changed 3 years ago by tibbe

Attachment: 0001-Add-createPipe.patch added

comment:1 Changed 3 years ago by tibbe

Status: newpatch

comment:2 Changed 3 years ago by tibbe

simonmar added this info to the discussion thread:

I seem to remember that on Windows there are subtleties to do with whether the pipe ends are inheritable by subprocesses or not. See mkAnonPipe() in the process package for how we deal with this already in process.

comment:3 Changed 3 years ago by refold

I get the following error on Windows:

[2 of 3] Compiling System.Process   ( System\Process.hs, dist\build\System\Proce
ss.o )

C:\program files (x86)\haskell platform\2013.2.0.0\mingw\bin\..\lib\gcc\mingw32\
4.5.2\..\..\..\..\include\io.h:64:1:
    parse error on input `{'

After renaming System\Process.hs to .hsc I get:

[2 of 3] Compiling System.Process   ( dist\build\System\Process.hs, dist\build\S
ystem\Process.o )

SystemProcess.hsc:921:18:
    Ambiguous occurrence `fdToHandle'
    It could refer to either `System.Process.fdToHandle',
                             defined at SystemProcess.hsc:926:1
                          or `System.Process.Internals.fdToHandle',
                             imported from `System.Process.Internals' at SystemP
rocess.hsc:69:1-31
                             (and originally defined in `GHC.IO.Handle.FD')

SystemProcess.hsc:922:19:
    Ambiguous occurrence `fdToHandle'
    It could refer to either `System.Process.fdToHandle',
                             defined at SystemProcess.hsc:926:1
                          or `System.Process.Internals.fdToHandle',
                             imported from `System.Process.Internals' at SystemP
rocess.hsc:69:1-31
                             (and originally defined in `GHC.IO.Handle.FD')

After removing the fdToHandle function and fixing the call sites everything compiles fine, modulo warnings.

Changed 3 years ago by refold

Attachment: 0001-Add-createPipe.2.patch added

Updated version of the patch that compiles on Windows

comment:4 Changed 3 years ago by refold

I've attached an updated version of the patch that compiles for me on GHC 7.6.3. Can I help with anything else (e.g. running tests)?

comment:5 in reply to:  4 Changed 3 years ago by tibbe

Replying to refold:

I've attached an updated version of the patch that compiles for me on GHC 7.6.3. Can I help with anything else (e.g. running tests)?

If you could look into the issue Simon mentioned above (which is a Windows-only issue) that would be great. As for testing, if you like you can apply this patch locally and try to have Cabal use this version of createPipe instead of the one we have in the cabal repo, tht would be very helpful.

comment:6 Changed 3 years ago by tibbe

I think this issue is stalled since someone on Windows can figure out the issue simonmar mentioned.

comment:7 Changed 3 years ago by refold

I'll look into it once I get some free time.

comment:8 Changed 3 years ago by thoughtpolice

Status: patchupstream

comment:9 Changed 3 years ago by thoughtpolice

Component: libraries/processCore Libraries

Moving over to new owning component 'Core Libraries'.

comment:10 Changed 3 years ago by hvr

Cc: core-libraries-committee@… added
Resolution: fixed
Status: upstreamclosed

(landed upstream)

Note: See TracTickets for help on using tickets.