Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Packaging for Perl Code

by tarunmudgal4u (Sexton)
on Sep 23, 2013 at 13:08 UTC ( #1055283=perlquestion: print w/replies, xml ) Need Help??
tarunmudgal4u has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I've written a Perl script that I want to deploy on multiple clients. For this, to avoid Perl and required modules installation on clients, I thought to create a standalone exe of my Perl code.

I tried three different ways to accomplish this task i.e. 1) perl2exe 2) ActivePerl's perlapp and 3) PAR::Packer pp utility

All of these ways didn't work and the problem was with Sys::Info::OS module. No any of above utilities helped me to resolve this issue. Below is the somewhat error I got for all of these utilities (as of now it's the output of pp utility)-

Operating system identified as: 'Windows'. Native driver can not be lo +aded: Error loading Sys::Info::Driver::Windows::OS : Can't locate Sys\Info\Driver\Windows\ in @INC (@INC contains: C +ODE(0x2fccd0c) C:\Users\ADMINI~1\AppData\Local\Tem p\2\par-41646d696e6973747261746f72\cache-da79bd4ee6c09b5134fa9a2cc4755 +4c99da6eb1c\inc\lib C:\Users\ADMINI~1\AppData\Loca l\Temp\2\par-41646d696e6973747261746f72\cache-da79bd4ee6c09b5134fa9a2c +c47554c99da6eb1c\inc CODE(0x2d5adf4) CODE(0x2d5b18 4)) at Sys/Info/ line 46. at Sys/Info/ line 11. . Falling back to compatibility mode Error loading Sys::Info::Driver::Unknown::OS: Can't locate Sys\Info\Dr +iver\Unknown\ in @INC (@INC contains: CODE(0x 2fccd0c) C:\Users\ADMINI~1\AppData\Local\Temp\2\par-41646d696e69737472 +61746f72\cache-da79bd4ee6c09b5134fa9a2cc47554c99da 6eb1c\inc\lib C:\Users\ADMINI~1\AppData\Local\Temp\2\par-41646d696e697 +3747261746f72\cache-da79bd4ee6c09b5134fa9a2cc47554 c99da6eb1c\inc CODE(0x2d5adf4) CODE(0x2d5b184)) at Sys/Info/ li +ne 46. at Sys/Info/ line 11. BEGIN failed--compilation aborted at Sys/Info/ line 11. Compilation failed in require at script/ line 25. BEGIN failed--compilation aborted at script/ line 25.

Other details:

- OS: Windows Server 2008 R2 Standard (x64 bit)

- ActivePerl: (v5.16.3) built for MSWin32-x86-multi-thread

- This script runs normally if run using without packaging

Please let me know if you guys have faced this issue OR any suggestions will also be appreciated.

Replies are listed 'Best First'.
Re: Packaging for Perl Code
by marto (Archbishop) on Sep 23, 2013 at 13:21 UTC

    "as of now it's the output of pp utility"

    It'd make more sense if you actually showed how you ran pp to generate this executable. I suggest using the -x option and being verbose with the output of the packaging:

    pp -x -vv -o derp.exe

      Below is the complete output-

      C:\Jenkins Workspace>pp -o TCExecutor.exe -l "C:\Perl\site\lib\Sys\Inf +o\Driver\Windows" -l "C:\Perl\site\lib\Sys\Info\Dr iver\Unknown" -l "C:\Perl\site\lib\auto\Sys\Info\Driver\Windows\Window +s.dll" -l "C:\Perl\site\lib\Sys\Info" -M "Sys\Info \Driver\Windows\" -M "Sys\Info\Driver\Unknown\" -M "Sys\Info" -M "Module\ScanDeps\" -x -vv TCEx Set up gcc environment - 3.4.5 (mingw-vista special r3) C:\Perl\site\bin/pp: Packing C:\Perl\site\bin/pp: Writing PAR on \ppLopua.par Killing running processes of IEDriverServer, chromedriver, firefox or +AutoItX3 if any.. No any IEDriverServer, chromedriver, firefox or AutoItX3 processes run +ning.. Looks Good Deleting C:\Users\ADMINI~1\AppData\Local\Temp\2 directory.. + done Mapping a drive to build machine failed Error: Couldn't map to network drive \\\C$\luauser_perfor +ce\depot\Shared_Tech\Documentation\Projects\LUA\2. 3.3\QA\Automation\LUA Maven\Eclipse_Maven\Framework Please check your network: Sys\Info\Driver\Windows\ No such file or directory at C:/Perl/si +te/lib/Module/ScanDeps/ line 17. END failed--call queue aborted at line 128. SYSTEM ERROR in executing 512 at C:/Perl/site/lib/Modul +e/ line 1302.

      I've implemented the changes suggested. Still, pp doesn't execute successfully.

        Hi, I've made some more changes and it's working fine now.. thanks

Re: Packaging for Perl Code
by tobyink (Abbot) on Sep 23, 2013 at 14:26 UTC

    Sys::Info::OS seems to load additional OS-specific modules at runtime. pp is not able to detect that it needs these when you're packaging, so you need to list them explicitly (-M option).

    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name

      And in the case of ActiveState PerlApp, --add "SomeThing::Foo".

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1055283]
Front-paged by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (1)
As of 2018-04-23 01:07 GMT
Find Nodes?
    Voting Booth?