in reply to Re: PAR::Packer pp command including too many modules
in thread PAR::Packer pp command including too many modules

I'm using Module::ScanDeps 1.13

perl -V output:

Summary of my perl5 (revision 5 version 18 subversion 0) configuration +: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread-64in +t uname='Win32 strawberry-perl 5.18.0.1 #1 Sat May 18 17:46:00 2013 +i386' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=und +ef use64bitint=define, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags =' -s -O2 -DWIN32 -DPERL_TEXTMODE_SCRIPTS -DPER +L_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fno-strict-alias +ing -mms-bitfields', optimize='-s -O2', cppflags='-DWIN32' ccversion='', gccversion='4.6.3', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='lo +ng long', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='g++.exe', ldflags ='-s -L"C:\strawberry_perl_51801\perl\lib\CO +RE" -L"C:\strawberry_perl_51801\c\lib"' libpth=C:\strawberry_perl_51801\c\lib C:\strawberry_perl_51801\c\i +686-w64-mingw32\lib libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 +-ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -l +mpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdl +g32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_3 +2 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 libc=, so=dll, useshrplib=true, libperl=libperl518.a gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-mdll -s -L"C:\strawberry_perl_51801\pe +rl\lib\CORE" -L"C:\strawberry_perl_51801\c\lib"' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PERL_SAWAM +PERSAND USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF Built under MSWin32 Compiled at May 18 2013 17:53:14 %ENV: PERLSHELL="c:\strawberry_perl\portableshell.bat" @INC: C:/strawberry_perl_51801/perl/site/lib C:/strawberry_perl_51801/perl/vendor/lib C:/strawberry_perl_51801/perl/lib .


Output of pp -vvv -o ttt.exe -e "use strict; print 1..99" >\temp\pp-use-strict.out.txt
[This isn't all of it, since it was 3300 lines.] C:\strawberry_perl_51801\perl\site\bin/pp: Packing C:\Users\allenjo5\A +ppData\Local\Temp\ppaQ7zF.pl C:\strawberry_perl_51801\perl\site\bin/pp: Writing PAR on C:\Users\all +enjo5\AppData\Local\Temp\ppL1cGp.par C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/vendor/lib/Algorithm/Diff.pm as lib/Algorithm/Diff.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/lib/Archive/Tar.pm as lib/Archive/Tar.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/lib/Archive/Tar/Constant.pm as lib/Archive/Tar/Constant +.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/lib/Archive/Tar/File.pm as lib/Archive/Tar/File.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/vendor/lib/Archive/Zip.pm as lib/Archive/Zip.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/vendor/lib/Archive/Zip/Archive.pm as lib/Archive/Zip/Ar +chive.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/vendor/lib/Archive/Zip/DirectoryMember.pm as lib/Archiv +e/Zip/DirectoryMember.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/vendor/lib/Archive/Zip/FileMember.pm as lib/Archive/Zip +/FileMember.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/vendor/lib/Archive/Zip/Member.pm as lib/Archive/Zip/Mem +ber.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/vendor/lib/Archive/Zip/NewFileMember.pm as lib/Archive/ +Zip/NewFileMember.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/vendor/lib/Archive/Zip/StringMember.pm as lib/Archive/Z +ip/StringMember.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/vendor/lib/Archive/Zip/ZipFileMember.pm as lib/Archive/ +Zip/ZipFileMember.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/lib/AutoLoader.pm as lib/AutoLoader.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/lib/AutoSplit.pm as lib/AutoSplit.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/lib/B.pm as lib/B.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/lib/B/Deparse.pm as lib/B/Deparse.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/vendor/lib/BerkeleyDB.pm as lib/BerkeleyDB.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/lib/CPAN/Author.pm as lib/CPAN/Author.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/lib/CPAN/Bundle.pm as lib/CPAN/Bundle.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/lib/CPAN/CacheMgr.pm as lib/CPAN/CacheMgr.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/lib/CPAN/Complete.pm as lib/CPAN/Complete.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/lib/CPAN/Config.pm as lib/CPAN/Config.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/lib/CPAN/Debug.pm as lib/CPAN/Debug.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/lib/CPAN/DeferredCode.pm as lib/CPAN/DeferredCode.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/vendor/lib/CPAN/DistnameInfo.pm as lib/CPAN/DistnameInf +o.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/lib/CPAN/Distribution.pm as lib/CPAN/Distribution.pm C:\strawberry_perl_51801\perl\site\bin/pp: ... adding C:/strawberry_pe +rl_51801/perl/lib/CPAN/Distroprefs.pm as lib/CPAN/Distroprefs.pm ... Packing "Archive/Zip/Member.pm"... Written as "Archive/Zip/Member.pm" Packing "Archive/Zip/NewFileMember.pm"... Written as "Archive/Zip/NewFileMember.pm" Packing "Archive/Zip/StringMember.pm"... Written as "Archive/Zip/StringMember.pm" Packing "Archive/Zip/ZipFileMember.pm"... Written as "Archive/Zip/ZipFileMember.pm" Packing "PAR.pm"... Written as "PAR.pm" Packing "PAR/Dist.pm"... Written as "PAR/Dist.pm" Packing "PAR/Heavy.pm"... Written as "PAR/Heavy.pm" Packing "PAR/SetupProgname.pm"... Written as "PAR/SetupProgname.pm" Packing "PAR/SetupTemp.pm"... Written as "PAR/SetupTemp.pm" Packing "Portable.pm"... Written as "Portable.pm" Packing "C:\Users\allenjo5\AppData\Local\Temp\par-616c6c656e6a6f35\cac +he-696e47e08ce51b5e96ba4696af795cb4f68ac7b8/2318195e.dll"... Written as "auto/Win32/Win32.dll" Packing "C:\Users\allenjo5\AppData\Local\Temp\par-616c6c656e6a6f35\cac +he-696e47e08ce51b5e96ba4696af795cb4f68ac7b8/387a4607.dll"... Written as "auto/PerlIO/scalar/scalar.dll" Packing "C:\Users\allenjo5\AppData\Local\Temp\par-616c6c656e6a6f35\cac +he-696e47e08ce51b5e96ba4696af795cb4f68ac7b8/43d981d6.dll"... Written as "auto/Fcntl/Fcntl.dll" Packing "C:\Users\allenjo5\AppData\Local\Temp\par-616c6c656e6a6f35\cac +he-696e47e08ce51b5e96ba4696af795cb4f68ac7b8/5f64aeab.dll"... Written as "auto/Tie/Hash/NamedCapture/NamedCapture.dll" Packing "C:\Users\allenjo5\AppData\Local\Temp\par-616c6c656e6a6f35\cac +he-696e47e08ce51b5e96ba4696af795cb4f68ac7b8/6674f066.dll"... Written as "auto/IO/IO.dll" Packing "C:\Users\allenjo5\AppData\Local\Temp\par-616c6c656e6a6f35\cac +he-696e47e08ce51b5e96ba4696af795cb4f68ac7b8/83414481.dll"... Written as "auto/List/Util/Util.dll" Packing "C:\Users\allenjo5\AppData\Local\Temp\par-616c6c656e6a6f35\cac +he-696e47e08ce51b5e96ba4696af795cb4f68ac7b8/9937eba8.dll"... Written as "auto/Compress/Raw/Zlib/Zlib.dll" Packing "C:\Users\allenjo5\AppData\Local\Temp\par-616c6c656e6a6f35\cac +he-696e47e08ce51b5e96ba4696af795cb4f68ac7b8/b0c204bd.dll"... Written as "auto/File/Glob/Glob.dll" Packing "C:\Users\allenjo5\AppData\Local\Temp\par-616c6c656e6a6f35\cac +he-696e47e08ce51b5e96ba4696af795cb4f68ac7b8/e0adad6d.dll"... Written as "auto/attributes/attributes.dll" Packing "C:\Users\allenjo5\AppData\Local\Temp\par-616c6c656e6a6f35\cac +he-696e47e08ce51b5e96ba4696af795cb4f68ac7b8/eaa828ef.dll"... Written as "auto/Cwd/Cwd.dll"

Replies are listed 'Best First'.
Re^3: PAR::Packer pp command including too many modules
by Anonymous Monk on Mar 14, 2014 at 16:29 UTC
      Yes, but if pp -e "print 1..99" doesn't include them, I see no reason why pp -e "use strict" should. The purpose of PAR::Packer is to only include the modules needed by the particular perl program you are packing, not your entire build tree. Or so I thought.

      Based on your hint about scandeps, I tried it from the command line (though I'm not sure it would be doing the exact same thing as what pp uses it for) and it behaves similarly, but give some error messages about not being able to connect to CPAN sites to download stuff:

      C:\strawberry_perl_51801>scandeps -e "use strict" [ERROR] Fetching of 'ftp://ftp.cpan.org/pub/CPAN/authors/01mailrc.txt. +gz' failed: Ftp creation failed: Net::FTP: connect : 10060 [ERROR] Fetching of 'http://www.cpan.org/authors/01mailrc.txt.gz' fail +ed: Could not open socket to 'www.cpan.org', '' [ERROR] Fetching of 'ftp://cpan.hexten.net/authors/01mailrc.txt.gz' fa +iled: Ftp creation failed: Net::FTP: connect: 1006 0 [ERROR] Fetching of 'ftp://cpan.cpantesters.org/CPAN/authors/01mailrc. +txt.gz' failed: Ftp creation failed: Net::FTP: con nect: 10060 [ERROR] Fetching of 'ftp://ftp.funet.fi/pub/languages/perl/CPAN/author +s/01mailrc.txt.gz' failed: Ftp creation failed: Ne t::FTP: connect: 10060 [ERROR] Fetch failed: host list exhausted -- are you connected today? [ERROR] Couldn't fetch '01mailrc.txt.gz' [ERROR] Fetching of 'ftp://ftp.cpan.org/pub/CPAN/modules/03modlist.dat +a.gz' failed: Ftp creation failed: Net::FTP: conne ct: 10060 [ I ctrl-c'd it at this point ]
      I am behind firewalls where I work, so I'm not even sure I can open this up to allow FTP or HTTP to work. But I have to ask why it needs to consult anything other than the local perl install tree for module dependency info? Shouldn't it just be looking recursively at "use" statements?

        Yes, but ...

        You're using portablestrawberry, it loads Portable when you run any program ...

        You can always exclude Portable and any other module syou don't want packed

        ... scandeps ...

        portablestrawberry loads Portable when scandeps runs too :)

        But I have to ask why it needs to consult anything other than the local perl install tree for module dependency info? Shouldn't it just be looking recursively at "use" statements?

        metadata also comes from the CPAN ... you've got the portable version so load it up before you go to work :)

        ;) When in doubt feel free to UTSL