msys2-runtime icon indicating copy to clipboard operation
msys2-runtime copied to clipboard

perl pipes broke sometime recently

Open chrishecker opened this issue 4 months ago • 1 comments

I had this working with an older version of msys2, which had kind of been piecemeal updated so I can't really say a version, but then I did a full update recently and perl pipes from another executable broke. So I did a fresh install today with no packages (except what is installed by msys2-x86_64-20240727.exe) and it is still broken.

Here is the perl:

use strict;
use warnings;

# cmd /c needed to work with msys2
my $cmdline = "cmd /c \"echo hello\"";
open(my $exe, "-|", $cmdline) || die;
while(<$exe>) {
  chomp;
  print "\r$_";
}
close $exe;

The hello never shows up. It works fine with strawberry perl and cygwin perl. Occasionally after hitting ctrl-c you get a The process tried to write to a nonexistent pipe. message, but it seems sporadic.

This seems related: https://github.com/msys2/MSYS2-packages/issues/2471

Thanks, Chris

chrishecker avatar Oct 25 '24 00:10 chrishecker