Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^5: pp can't pack MongoDB and Inline Module

by marto (Chancellor)
on Sep 18, 2012 at 12:32 UTC ( #994280=note: print w/ replies, xml ) Need Help??


in reply to Re^4: pp can't pack MongoDB and Inline Module
in thread pp can't pack MongoDB and Inline Module

I've confirmed this issue. It does take a very long time to create an exe from the basic script you posted. Checking the list of dependencies, and therefore packaged modules I notice Any::Moose which then requires Moose or Mouse depending on your setup. I have no experience of using either, however I've been told by others that Moose (at least) is pretty bloated. This may not be true, but either way there's a large dependency list from the simple script below.

For clarification my setup is Windows XP SP3 (I know, it's a wortk thing), Strawberry Perl 5.12.3, PAR::Packer 1.013. Older Core 2 Duo laptop, 1GB RAM.

The script I used:

#!/usr/bin/perl use strict; use warnings; use MongoDB; print "hi\n";

The pp command pp -v -o mongodb.exe -x mongodb.pl (cut down from vvv and vv in an attempt to generate output less than 233KB). mongodb.exe is eventually created, and produces the output expected. There's nothing obvious to me in the logs (vvv, vv, v) as to what the hold up was. Perhaps someone else has packaged MongoDB and has more experience to draw from.


Comment on Re^5: pp can't pack MongoDB and Inline Module
Select or Download Code
Re^6: pp can't pack MongoDB and Inline Module
by Alle (Novice) on Sep 20, 2012 at 11:51 UTC

    Thank you for your tips and effort,When I install Mouse and use perlapp pack to exe file, it execuate successfully!

    But can't use MongoDB module to connection mongodb

    my code

    use strict; use utf8; use Encode; use MongoDB; use MongoDB::Connection; use MongoDB::Database; use Tkx; # mongodb my $conn = MongoDB::Connection->new(host => '127.0.0.1:27017', query_timeout => 1000 * 6000); my $db = $conn->dev;

    the error msg

    [DONE] Could not find a suitable Params::Validate implementation: Can't locat +e Params/Validate/XS.pm in @INC (@INC contains:) at /<C:\Users\Admini +strator\Desktop\StudyNotes\perl\perl-Tkx\tkx3.exe>Module/Runtime.pm l +ine 317. Can't locate Params/Validate/PP.pm in @INC (@INC contains:) at /<C:\Us +ers\Administrator\Desktop\StudyNotes\perl\perl-Tkx\tkx3.exe>Module/Ru +ntime.pm line 317. at /<C:\Users\Administrator\Desktop\StudyNotes\perl\perl-Tkx\tkx3.exe +>Params/Validate.pm line 66. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +StudyNotes\perl\perl-Tkx\tkx3.exe>DateTime/Duration.pm line 12. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +StudyNotes\perl\perl-Tkx\tkx3.exe>DateTime.pm line 43. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +StudyNotes\perl\perl-Tkx\tkx3.exe>MongoDB/GridFS.pm line 24. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +StudyNotes\perl\perl-Tkx\tkx3.exe>MongoDB/Database.pm line 23. BEGIN failed--compilation aborted at tkx3.pl line 7. [DONE]

      It seems Params::Validate::XS isn't being detected, and so not packaged. Can you please show how you called pp to create this executable? Could you try again specifically including this module via the -M option? Thanks.

      Update:

      Actually, perhaps a better idea would be to extract the executable you've created, as you would a normal zip file, that way you can examine exactly what has been packaged. In future it may be wise to run pp with some logging such (-v, -vv) and redirect that to a file for reference. I appreciate that packaging this module is time consuming but such logs may prove helpful when debugging problems.

        It's my complete content.

        Because use pp packing my script is so slowly, so i use perlapp

        my script mongo.pl:

        #!/usr/bin/perl -w use strict; use MongoDB; use MongoDB::Connection; use MongoDB::Database; # mongodb my $conn = MongoDB::Connection->new(host => '127.0.0.1:27017', + query_timeout => 1000 * 6000); my $db = $conn->ygzj_dev; print "$db";

        Use "perl mongo.pl" it print "MongoDB::Database=HASH(0x33b2e8)", It worked fun.

        when I use perlapp compiling it to exe,My command is "perlapp --shared public --norunlib --gui --verbose --warnings --exe mongo.exe mongo.pl", perlapp generate a mongo.exe and there have 5 warnings ,the warnings is:

        <1> Devel\GlobalDestruction.pm: warn: auto\Devel\GlobalDestruction\GlobalDestruction.dll not found refby: C:\Perl64\lib\Moose\Meta\Role.pm line 16 refby: C:\Perl64\lib\Moose\Object.pm line 14 refby: C:\Perl64\lib\Moose\Meta\Method\Destructor.pm line 13 refby: C:\Perl64\lib\Class\MOP\Package.pm line 15 file: C:\Perl64\lib\Devel\GlobalDestruction.pm .... .... <2> Mouse\Util.pm: warn: auto\Mouse\Util\Util.dll not found refby: C:\Perl64\site\lib\Mouse.pm line 11 refby: C:\Perl64\site\lib\Mouse\Meta\Attribute.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Class.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Module.pm line 2 refby: C:\Perl64\site\lib\Mouse\Util\TypeConstraints.pm line 2 refby: C:\Perl64\site\lib\Mouse\Object.pm line 2 refby: C:\Perl64\site\lib\Mouse\Exporter.pm line 17 refby: C:\Perl64\site\lib\Mouse\Meta\Role.pm line 2 refby: C:\Perl64\site\lib\Mouse\PurePerl.pm line 11 refby: C:\Perl64\site\lib\Mouse\Meta\TypeConstraint.pm line 2 refby: C:\Perl64\site\lib\Mouse\Util\MetaRole.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Role\Composite.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Role\Application.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Method\Destructor.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Method\Constructor.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Method\Accessor.pm line 2 file: C:\Perl64\site\lib\Mouse\Util.p .... .... <3> Perl\Tidy.pm: warn: Can't locate Perl\Tidy.pm refby: C:\Perl64\lib\Eval\Closure.pm line 151 ... ... <4> SetDualVar.pm: warn: Can't locate SetDualVar.pm refby: C:\Perl64\lib\Win32\TieRegistry.pm line 39 ... ... <5> VMS\Feature.pm: warn: Can't locate VMS\Feature.pm refby: C:\Perl64\lib\Cwd.pm line 211

        I have already installed Mouse, Devel-GlobalDestruction, VMS-FileUtils..., I think these all warning msg is not important, Because when I compiled other script also had some warnings. When I executed the mongo.exe file,there have run error, error msg:

        {.\mongo.exe} Could not find a suitable Params::Validate implementation: Can't locat +e Params/Validate/XS.pm in @INC (@INC contains:) at /<C:\Users\Admini +strator\Desktop\tmp\mongo.exe>Module/Runtime.pm line 317. Can't locate Params/Validate/PP.pm in @INC (@INC contains:) at /<C:\Us +ers\Administrator\Desktop\tmp\mongo.exe>Module/Runtime.pm line 317. at /<C:\Users\Administrator\Desktop\tmp\mongo.exe>Params/Validate.pm +line 66. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +tmp\mongo.exe>DateTime/Duration.pm line 12. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +tmp\mongo.exe>DateTime.pm line 43. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +tmp\mongo.exe>MongoDB/GridFS.pm line 24. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +tmp\mongo.exe>MongoDB/Database.pm line 23. BEGIN failed--compilation aborted at mongo.pl line 5.

        I have allready installed "Params-Validate Validate method/function parameters", Can I compile the script to exe file with could execute. You can test it. my os is windows7 64 bit, my perl is 5.16(active state perl), Thank you very much!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://994280]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2014-09-19 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (134 votes), past polls