Subject: | Error when executing a .exe on Windows with PERL5LIB set |
Date: | Thu, 19 Nov 2009 12:13:14 +0200 |
To: | bug-PAR-Packer [...] rt.cpan.org |
From: | Ville Lundberg <ville [...] juiceless.net> |
Hi,
I have run into a problem with PAR and pp when trying to have a true
stand-alone executable on Windows (XP).
PAR version 0.994
PAR-Packer version 0.991
although this problem happens with several versions up to those versions.
Perl version is Activestate:
This is perl, v5.10.0 built for MSWin32-x86-multi-thread (with 5
registered patches, see perl -V for more detail)
The Perl version is not of relevance in this bug, as the target machine
can have any version installed, but the exe should be run stand-alone
with the version it was created with.
Situation:
I create stand-alone executables with pp -o exe.exe script.pl
Both pp and the exe works fine on my dev machine.
The exe is then run on a target machine, which has a Oracle DB
installation - Oracle seems to some with a Perl installation for itself
(and certainly another version than I create the exe with). The target
machine has also the PERL5LIB set, as it is done by Oracle: it points to
the Oracle Perl installation.
The executable fails with:
Can't load
'C:\oracle\product\10.2.0\db_1\perl\5.8.3\lib\MSWin32-x86-multi-thread/auto/IO/IO.dll'
for module IO: load_file:The specified module could not be found at
C:/Perl/lib/DynaLoader.pm line 202.
at C:/Perl/site/lib/PAR/Heavy.pm line 83
Compilation failed in require at C:/Perl/lib/IO/Handle.pm line 263.
BEGIN failed--compilation aborted at C:/Perl/lib/IO/Handle.pm line 263.
Compilation failed in require at C:/Perl/lib/IO/Seekable.pm line 101.
BEGIN failed--compilation aborted at C:/Perl/lib/IO/Seekable.pm line 101.
Compilation failed in require at C:/Perl/lib/IO/File.pm line 133.
BEGIN failed--compilation aborted at C:/Perl/lib/IO/File.pm line 133.
Compilation failed in require at -e line 376.
I can work around this by using a batch file which unsets PERL5LIB.
I have searched for this kind of error, and found some discussion on the
newsgroups about it. No conclusion about the issue seems to exist. It
looks like the culprit is that the PERL5LIB points really to an existing
Perl installation. Therefore this could not be reproduced by just
playing around with PERL5LIB pointing to empty or non-existing folders.
This can be reproduced to 100% when the PERL5LIB is set to point to the
Oracle Perl (I guess it could point to any Perl which is not of the same
version as the one which created the exe, but this is not tested).
If I set PERL5LIB to any other folder on my dev machine, it does not
interfere with the exe. If it points to the Oracle Perl, the exe fails.
Kind regards,
--Ville