PDK - PerlApp issue after going to 5.16.3 (runtime issue)

Posted by ice_shm0 on 2014-04-04 11:29

PerlApp 9.2.1 build 296433
Perl 5.16.3

Issue:

{.\JIRARESTToolv1_1.exe}
Could not find a suitable Class::Load implementation: Can't locate Class/Load/XS.pm in @INC (@INC contains: C:\Data\Tools\Perl\Lib C:\Temp\pdk-scummings-2592\) at /Module/Runtime.pm line 317.
Can't locate Class/Load/PP.pm in @INC (@INC contains: C:\Data\Tools\Perl\Lib C:\Temp\pdk-scummings-2592\) at /Module/Runtime.pm line 317.
at /Class/Load.pm line 26.
BEGIN failed--compilation aborted at /Log/Dispatch.pm line 12.
BEGIN failed--compilation aborted at JIRARESTToolv1_1.perl line 24.

Added Modules: (with sub modules)
Class::Load::
Params::Validate::
XML::Sax

Note: There is no C:\Temp\pdk-scummings-2592 after I compile.

Any pointers?

-Scott

ice_shm0 | Tue, 2014-04-08 07:07

After much surfing and probing, I have a solution.

I found a couple of web pages that were related and this one started me down the path to the solution.

http://perlmaven.com/how-to-change-inc-to-find-perl-modules-in-non-stand...

I did not use this explicitly. I did clean up some of my environment variables, not sure this impacted the solution.

The issue I ran into was the the new Log-Dispatch 2.41 uses the latest Class::Load.
The Class::Load leverages new Module::* functions for runtime loading of modules (Class::Load::PP and Class::Load::XS). I added these modules, I explicitly called them out with use Class::Load::PP and use Class::Load::XS and that did not work. It appears at runtime, the path was not available to find these modules. So I tried the use run library feature on the Option 1 page of PerlApp. I simply added my perl site library (C:\Perl64\site\lib). Once I did this, my executable runs.

I do have concern. I do not see how to add multiple runtime libraries. For now I do not need more than one, but I can see in the future I may need this.

-Scott

grahams
ActiveState Staff
Wed, 2014-05-14 08:47

The 0.014 update of Module::Runtime makes a change that breaks wrapped files. Class::Load is usually the first victim.

The work-around is to uninstall Module::Runtime 0.014, and fall back to the 0.013 version shipped in 5.16.3.1603 and 1604.

Another work-around is to hack Module::Runtime back to the syntax from 0.013. In sub require_modules, change both of the "CORE::require" to "require"
if(_WORK_AROUND_BROKEN_MODULE_STATE) {
my $notional_filename = &module_notional_filename;
my $guard = bless([ $notional_filename ],
"Module::Runtime::__GUARD__");
my $result = CORE::require($notional_filename);
pop @$guard;
return $result;
} else {
return scalar(CORE::require(&module_notional_filename));
}

vlr5 | Tue, 2016-01-26 20:36

If you wanted just to make your executable run on the same machine, this solution is acceptable. Or you could add 'use lib "C:/Perl/site/lib";' to your script -- you'd achieve the same goal. But I think your executable won't work on a machine on which perl is not installed... I'd think that the problem is Runtime as said in the comment below. My other computer is able to produce runnable executable with Perl 14.2 and Module::Runtime 0.013, but version 0.0.14 broke this.
Not completely sure though.

grahams
ActiveState Staff
Wed, 2016-01-27 10:10

I would not recommend forcing a dependence on Perl site lib, unless you are deliberately not creating a standalone wrapped file and already have that requirement for installing Perl on every system. Even then, it's not a good idea for troubleshooting because you no longer control the code used.

If you change M::R and re-wrap into a stand-alone, you don't need to have the change, or a Perl containing the change, on every system.

rahulgojame | Mon, 2016-11-21 22:46

perlapp Service.pl -add WebService::ForecastIO::* -add Date::Manip::** -nologo -force -shared private

Can't locate WebService/ForecastIO/Request.pm in @INC (@INC contains: E:\git_workspace\Services) at /Module/Runtime.pm line 317.
BEGIN failed--compilation aborted at Service.pl line 37.

pl script running fine.

Anyone got a solution for this?

Perl Version: (v5.16.3)
PerlApp: PerlApp 9.2.1 build 296433