On Wed Jan 07 13:45:39 2015, [email protected] wrote:
> Looking at test reports from testers.perl6.org ugexe++ found a bug
> with pipe() on FreeBSD. It looks like closing the returned handle
> happens too early, as shown by the third of following commands:
>
> $ perl6 -e 'my $cmd = "/usr/bin/false"; say shell("$cmd")' ##
> expected result
> Proc::Status.new(exit => 1, pid => Any, signal => 0)
>
> $ perl6 -e 'my $cmd = "/usr/bin/false"; my $handle = pipe("$cmd", :r);
> sleep 2; say $handle.close' ## same
> Proc::Status.new(exit => 1, pid => Any, signal => 0)
>
> $ perl6 -e 'my $cmd = "/usr/bin/false"; my $handle = pipe("$cmd", :r);
> say $handle.close' ## wrong
> Proc::Status.new(exit => 0, pid => Any, signal => 0)
>
> On a linux box it's 'exit => 1' in all three cases.
>
> Panda currently uses a command like this for it's test and build
> reports. Panda issue 130 (https://github.com/tadzik/panda/issues/130)
> hase some more context.
>
> I've tested the above with rakudo.moar only.
This seems to be special for Moar:
$ perl6-m -e 'my $cmd = "/usr/bin/false"; my $handle = pipe("$cmd", :r); say
$handle.close'
Proc::Status.new(exit => 0, pid => Any, signal => 0)
$ perl6-m -e 'my $cmd = "/usr/bin/false"; my $handle = pipe("$cmd", :r); say
$handle.close.status'
0
$ perl6-p -e 'my $cmd = "/usr/bin/false"; my $handle = pipe("$cmd", :r); say
$handle.close'
Proc::Status.new(exit => 0, pid => Any, signal => 1)
$ perl6-p -e 'my $cmd = "/usr/bin/false"; my $handle = pipe("$cmd", :r); say
$handle.close.status'
1
$ perl6-j -e 'my $cmd = "/usr/bin/false"; my $handle = pipe("$cmd", :r); say
$handle.close'
Proc::Status.new(exit => 0, pid => Any, signal => 1)
$ perl6-j -e 'my $cmd = "/usr/bin/false"; my $handle = pipe("$cmd", :r); say
$handle.close.status'
1