http://www.perlmonks.org?node_id=901382

Stamm has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

It's been several days that I tried several things and I can't seem to find the solution alone, so I'm asking for help.

I packaged my program with pp on my development system. When I try to run it on a perlless system, it fails with the following error:
Can't locate loadable object for module IO in @INC (@INC contains: COD +E(0xb3761c) .) at C:/Perl/site/lib/PAR/Heavy.pm line 103 Compilation failed in require at C:/Perl/lib/IO/Handle.pm line 266. BEGIN failed--compilation aborted at C:/Perl/lib/IO/Handle.pm line 266 +. 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 1 +01. 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 351.
On the target system, after trying to run the binary, I noticed that in the PAR temporary extraction directory (%TEMP%\par-xxx\{ds36r5tg4edr6...}\) that the inc subfolder (where all the modules should be) is missing. If I install Perl on the target system, all the needed files are present in the temporary directory and the program runs successfully. My hunch is that the unpacking goes wrong.

What am I doing wrong?

Some more information you may need:
- I'm using Active Perl
- I installed pp using the cpan command-line utility (not PPM)
- I used this to pack the binary: pp -vvv -M unicore/Heavy.pl -o program.exe program.pl (I have to manually include unicore/Heavy.pl for the program to pack successfully. Maybe it's linked to my problem...)

Replies are listed 'Best First'.
Re: Packaged binary fails on perlless systems [win32]
by Anonymous Monk on Apr 26, 2011 at 16:12 UTC
      Thanks for the tip to test locally. It's a lot better than to use a second computer.

      I tried to use the other flags but pp finds exactly the same dependencies and the problem is the same.

      It seems that IO.dll is missing from the package. I included it with the -l flag but it still fails with the same error... :-( I don't even know what to try now...
        You don't mention if You're running the latest PAR::Packer version (1.009 according to CPAN). I suggest You also take a look at Cava Packager, another free Perl application packager. It is a very a nice GUI tool, unfortunately IMHO not very known.
        :)))))
        It's not that I don't believe you, but I can't seem to replicate your problem :) It works for me on the first try.

        I included it with the -l flag but it still fails with the same error... :-(

        You shouldn't need the -l flag for those, the -l flag is for things like libgcc_s_dw2-1.dll

        I don't even know what to try now...

        Try the usual, that is, upgrade, check the FAQ, check the bug que, turn on debugging, then show us the output.

        Here is how I tried

        output before packing

        output after packing

        Actually testing without path reveals I forgot my perl needs C:/MinGW/bin/libgcc_s_dw2-1.dll

        I'm using

Re: Packaged binary fails on perlless systems [win32]
by Anonymous Monk on Apr 26, 2011 at 19:45 UTC

    "...It's been several days that I tried several things and I can't seem to find the solution alone, so I'm asking for help...."

    Don't wait so long to ask for help. Exhaust your current knowledge. Resarch it. If you still cannot find the answer then ask. Banging your head 200 times against a wall will fare you no better than doing it for 100.

Re: Packaged binary fails on perlless systems [win32]
by nikosv (Deacon) on Jun 14, 2011 at 10:31 UTC

    I've just hit the same issue,and that is the workaround I've found which I also filed as a bug and I am awaiting a reply.

    building an executable with Strawberry Perl is successful but when actually running it (after we have renamed the c:/strawberry to c:/strawberryX so it cannot find the dependencies from the path), fails with the following errors :

    " Can't locate loadable object for module IO in @INC (@INC contains: C +ODE(0xa1d31c ) C:\strawberry\perl\vendor\lib .) at C:/strawberry/perl/site/lib/PAR/ +Heavy.pm line 103</p> Compilation failed in require at C:/strawberry/perl/lib/IO/Handle.pm l +ine 266.

    I am on WinXP SP3 ,PAR 1.002,PAR::Packer 1.009, and have tried Strawberry Perl versions 5.12.3.0,5.10.1.5,5.10.1.1 and the problem persists in all of them

    perl -V reveals something strange with the backslashes: %ENV: PERL_JSON_BACKEND="JSON::XS" PERL_YAML_BACKEND="YAML" @INC: C:/strawberry/perl/lib C:/strawberry/perl/site/lib C:\strawberry\perl\vendor\lib .

    "C:\strawberry\perl\vendor\lib" is not consistent with the other entries

    I've found id 52794 (https://rt.cpan.org/Public/Bug/Display.html?id=52794) which is related to the issue although it refers to version PAR::Packer 1.001

    nevertheless I got the following line :
    "if ($Config{_delim} eq '\\') { s{\\}{/}g for @inc }"
    from the patch (the patch actually REMOVES this line!!) and added it to par.pl after line 540.

    I also corrected Strawberry's @INC by prepending the path "C:/strawberry/perl/vendor/lib" by setting the PERL5LIB env variable, rebuilt it and everything works fine and even tried it in machines that have no Perl installation whatsoever

    It looks like Strawberry has the path messed up and needs the correct one.

    Furthemore "if ($Config{_delim} eq '\\') { s{\\}{/}g for @inc }" satisfies Heavy.pm

    Try it out and let me know if it was successfull

      I've just hit the same issue,and that is the workaround I've found which I also filed as a bug and I am awaiting a reply.

      Hi. This is not the same issue at all. The is using ActivePerl, and did not have packed IO.pm and auto/IO/IO.dll. The OP gets the message on a different computer, not the one used for packing. See Re: Packaged binary fails on perlless systems [win32]

        Hi
        The is using ActivePerl

        ok but the error is the same

        The OP gets the message on a different computer, not the one used for packing

        renaming the perl directory of the pc used for unpacking makes it the same case;it also did not run on pcs' that had never perl installed

        anyway maybe he could use some of that info and try out, regardless if it is strawberry or active

Re: Packaged binary fails on perlless systems [win32]
by acid06 (Friar) on May 25, 2011 at 23:13 UTC
    Unfortunately, I just experienced this same issue. Running Strawberry Perl 5.10.1. I was hoping for a fix in this thread but I guess I just need to update to a more recent Perl and see how that works out.


    acid06
    perl -e "print pack('h*', 16369646), scalar reverse $="