Hi,
Unfortunately, the PAR packager doesn’t seem to work in ActivePerl-5.36.3.
It did work in ActivePerl-5.26.1, the most recent version I have before the introduction of the state tool.
I have 2 PCs running Windows 10, one has ActivePerl-5.36.3, the other has ActivePerl-5.26.1. On each PC, I created an executable with these commands, respectively:
pp -o tp-5.36.exe test-par.pl
pp -o tp-5.26.exe test-par.pl
On both systems, tp-5.36.exe
first fails like this (the ‘fc5c…ab8a’ cache directory varies):
Can't load 'C:\Users\gamin\AppData\Local\Temp\par-67616d696e\cache-fc5c6777ec92c73ac37eb68bfc57ed00624cab8a\inc\lib\auto\XML\LibXML\LibXML.dll' for module XML::LibXML: load_file:The specified module could not be found at <embedded>/DynaLoader.pm line 206.
at <embedded>/PAR/Heavy.pm line 104.
BEGIN failed--compilation aborted at C:\Users\gamin\AppData\Local\Temp\par-67616d696e\cache-fc5c6777ec92c73ac37eb68bfc57ed00624cab8a\inc\lib/XML/LibXML.pm line 156.
Compilation failed in require at script/test-par.pl line 4.
BEGIN failed--compilation aborted at script/test-par.pl line 4.
and on the second and all successive calls, like this (note that the missing module changes on the first line):
Can't load 'C:\Users\gamin\AppData\Local\Temp\par-67616d696e\cache-fc5c6777ec92c73ac37eb68bfc57ed00624cab8a\6561313a.dll' for module XML::LibXML: load_file:The specified module could not be found at <embedded>/DynaLoader.pm line 206.
at <embedded>/PAR/Heavy.pm line 149.
BEGIN failed--compilation aborted at C:\Users\gamin\AppData\Local\Temp\par-67616d696e\cache-fc5c6777ec92c73ac37eb68bfc57ed00624cab8a\inc\lib/XML/LibXML.pm line 156.
Compilation failed in require at script/test-par.pl line 4.
BEGIN failed--compilation aborted at script/test-par.pl line 4.
I checked, and <cache directory>\inc\lib\auto\XML\LibXML\LibXML.dll
and <cache directory>\6561313a.dll
both exist.
On both systems, tp-5.26.exe
runs successfully and prints this (the cache directory varies):
@INC = C:\Users\gamin\AppData\Local\Temp\par-67616d696e\cache-a36ed5e748804d22d1316a6e271f8449d7678716\inc\lib;C:\Users\gamin\AppData\Local\Temp\par-67616d696e\cache-a36ed5e748804d22d1316a6e271f8449d7678716\inc;CODE(0x3965120);CODE(0x3965350)
HOMEPATH = '\Users\gamin'
PAR_0 = 'C:\Users\gamin\AppData\Local\Temp\par-67616d696e\cache-a36ed5e748804d22d1316a6e271f8449d7678716\ba70c365.pl'
PAR_INITIALIZED = '2'
PAR_PROGNAME = 'C:\Users\<...redacted...>\tp-5.26.exe'
PAR_SPAWNED = '1'
PAR_TEMP = 'C:\Users\gamin\AppData\Local\Temp\par-67616d696e\cache-a36ed5e748804d22d1316a6e271f8449d7678716'
PATH = 'C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\cygwin64\bin;C:\Perl\exec;C:\Perl\site\bin;C:\Perl\user\bin;C:\Program Files (x86)\ActiveState Komodo IDE 12\;C:\Users\gamin\AppData\Local\ActiveState\StateTool\release\bin;C:\Users\gamin\AppData\Local\Microsoft\WindowsApps;'
PATHEXT = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC'
PSMODULEPATH = 'C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules'
C:\Users\gamin\AppData\Local\Temp\par-67616d696e\cache-a36ed5e748804d22d1316a6e271f8449d7678716/inc/lib/auto/XML/LibXML/LibXML.dll exists.
Hello world.
The normal (unpacked) test-par.pl
script itself runs successfully on both systems and prints the following:
@INC = c:/Perl/site/lib;c:/Perl/lib
HOMEPATH = '\Users\gamin'
MANPATH = 'C:\Perl\man;C:\Perl\site\man'
PATH = 'C:\Perl\site\bin;C:\Perl/usr/bin;C:\Perl\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\cygwin64\bin;C:\Perl\exec;C:\Perl\site\bin;C:\Perl\user\bin;C:\Program Files (x86)\ActiveState Komodo IDE 12\;C:\Users\gamin\AppData\Local\ActiveState\StateTool\release\bin;C:\Users\gamin\AppData\Local\Microsoft\WindowsApps;'
PATHEXT = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC'
PKG_CONFIG_PATH = 'C:\Perl/usr/lib/pkgconfig'
PSMODULEPATH = 'C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules'
Hello world.
Interestingly, the PATH environment variable is modified (by C:\Perl\exec\perl.exe
) before the script runs, compared to its default value:
> echo %PATH%
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\cygwin64\bin;C:\Perl\exec;C:\Perl\site\bin;C:\Perl\user\bin;C:\Program Files (x86)\ActiveState Komodo IDE 12\;C:\Users\gamin\AppData\Local\ActiveState\StateTool\release\bin;C:\Users\gamin\AppData\Local\Microsoft\WindowsApps;
> perl -e "print $ENV{'PATH'}"
C:\Perl\site\bin;C:\Perl/usr/bin;C:\Perl\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\cygwin64\bin;C:\Perl\exec;C:\Perl\site\bin;C:\Perl\user\bin;C:\Program Files (x86)\ActiveState Komodo IDE 12\;C:\Users\gamin\AppData\Local\ActiveState\StateTool\release\bin;C:\Users\gamin\AppData\Local\Microsoft\WindowsApps;
The test-par.pl
script is:
use strict;
use warnings;
use XML::LibXML;
printf "\@INC = %s\n", join ';', @INC;
foreach my $k (sort keys %ENV) {
next unless $k =~ /par|inc|path/i;
printf "%20s = '$ENV{$k}'\n", $k;
}
my $PAR_TEMP = $ENV{PAR_TEMP};
if ($PAR_TEMP) {
my $dll = $PAR_TEMP . '/inc/lib/auto/XML/LibXML/LibXML.dll';
if (-f -r -s $dll) {
print "$dll exists.\n";
} else {
print "$dll doesn't exist.\n";
}
}
print "Hello world.\n";
Since the script itself runs fine on both systems, and since the error depends on the system used to build the executable, and not on the script or command used to create the executable, there must be something wrong with my installation, pp, or both. I suspect that the problem could be with either the extra level of indirection introduced by the programs in the ‘exec’ directory, or missing XML libraries in the packaged archive (see XML-LibXML fails to load with Perl 5.36.3 (worked with 5.36.0)).
By the way, everything works if the use XML::LibXML;
is commented out, so this means the Perl Packager works, but not on anything that uses dynamic loading, which rules out a lot of packages.
I’m willing to help, but I don’t know what to do next. Any guidance?
Thanks,
Martin