Skip Menu |

This queue is for tickets about the IPC-Run CPAN distribution.

Report information
The Basics
Id: 104812
Status: resolved
Priority: 0/
Queue: IPC-Run

People
Owner: Nobody in particular
Requestors: CHORNY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.94
Fixed in: 0.95



Subject: tests fail on Windows/5.22.0RC2
This test passes with same versions of Socket and Win32API::File on 5.20.2. t/pump.t 1..27 ok 1 ok 2 ok 3 ok 4 ok 5 ok 6 ok 7 ok 8 ok 9 Invalid argument opening STDIN as Win32 handle 1916 in pumper 1456 at C:\Strawberry220\cpan\build\IPC-Run-0.94-j7a7Sn\blib\lib/IPC/Run/Win32Pump.pm line 71. Compilation failed in require. BEGIN failed--compilation aborted. Invalid argument opening STDIN as Win32 handle 1820 in pumper 448 at C:\Strawberry220\cpan\build\IPC-Run-0.94-j7a7Sn\blib\lib/IPC/Run/Win32Pump.pm line 71. Compilation failed in require. BEGIN failed--compilation aborted. ack Invalid argument: read( 9 ) at C:\Strawberry220\cpan\build\IPC-Run-0.94-j7a7Sn\blib\lib/IPC/Run/IO.pm line 558. # Looks like you planned 27 tests but ran 9. # Looks like your test exited with 22 just after 9. Warning: unable to close filehandle GEN5 properly: Bad file descriptor during global destruction. You can get Strawberry 5.22.0RC2 here http://strawberryperl.com/beta.html -- Alexandr Ciornii, http://chorny.net
IPC::Run is too complex (maybe, because it compatible with old perl versions). The following code works perfectly under win / linux perl 5.22: sub spawn ($cmd) { require AnyEvent::Util; my ( $in_r, $in_w ) = AnyEvent::Util::portable_socketpair(); my ( $out_r, $out_w ) = AnyEvent::Util::portable_socketpair(); $in_r->autoflush(1); $in_w->autoflush(1); $out_r->autoflush(1); $out_w->autoflush(1); # store old STD* handles open my $old_in, '<&', \*STDIN or die; ## no critic qw[InputOutput::RequireBriefOpen] open my $old_out, '>&', \*STDOUT or die; ## no critic qw[InputOutput::RequireBriefOpen] # redirect STD* handles open STDIN, '<&', $in_r or die; open STDOUT, '>&', $out_w or die; # spawn hg command server { if ($MSWIN) { require Win32::Process; Win32::Process::Create( # $self->{_pid}, $ENV{COMSPEC}, '/D /C ' . $cmd, 1, 0, q[.] ) || die; } else { exec $cmd or die unless fork; } } # close child handles close $in_r or die; close $out_w or die; # restore STD* handles open STDIN, '<&', $old_in or die; open STDOUT, '>&', $old_out or die; return $in_w, $out_r; # $in_w - write to child STDIN, $out_r - read from child STDOUT }