in reply to PAR-Packer and IPC-Run
Hm-m, suppose:
use strict; use warnings; use IPC::Run qw( start ); my @c = qw( cmd /c sort ); my $h = start \@c, '<pipe', \*IN, '>pipe', \*OUT; print IN "zzz...\n"; print IN "hello world\n"; close IN; pump $h; print uc while <OUT>; close OUT; finish $h;
to print uppercased sorted lines:
HELLO WORLD ZZZ...
But if packed to executable:
pp -o pack_test.exe pack_test.pl
the pack_test.exe gives:
Inappropriate I/O control operation: Win32::Process::Create() at C:\Us +ers\me\AppData\Local\Temp\par-766164696d\cache-2f8c1556e4a094e1c7eee6 +ea88e299192e77e2e4\inc\lib/IPC/Run.pm line 2150. Inappropriate I/O control operation: Win32::Process::Create() at C:\Us +ers\me\AppData\Local\Temp\par-766164696d\cache-2f8c1556e4a094e1c7eee6 +ea88e299192e77e2e4\inc\lib/IPC/Run.pm line 2251.
Looks like Win32::Process::Create wants absolute path at #345, and IPC::Run::Win32IO is overly optimistic to find it in $^X. Within PAR, this variable contains just 'perl.exe'. Even if there's no such file on the system.
In fact, I don't know how to properly invoke perl from PAR bundle (it does contain all binaries, doesn't it), so here's a dirty hack. Somewhere at line #311, put
local $^X = $ENV{ PAR_TEMP } . '\inc\perl.exe' if $^X eq 'perl.exe' and exists $ENV{ PAR_TEMP };
And then pack like this:
pp -M IPC::Run::Win32Pump -a C:\berrybrew\strawberry-perl-5.32.1.1-64b +it-PDL\perl\bin\perl.exe;perl.exe -o pack_test.exe pack_test.pl
and then pack_test.exe kindly gives:
HELLO WORLD ZZZ...
I have no idea if it's IPC::Run or PAR::Packer (or Perl itself built on Windows) fault; and whether it'll work for your multi-gigabyte multi-threaded app; and how many refined professionals dropped unconscious because of ugliness of the above hack, but it's something to start with.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: PAR-Packer and IPC-Run
by izomiac (Novice) on Oct 12, 2023 at 05:31 UTC | |
by Athanasius (Archbishop) on Oct 12, 2023 at 06:24 UTC |