【发布时间】:2013-09-19 15:58:21
【问题描述】:
安装 CPAN 模块时,PP (PAR::Packer) 总是失败。
如果我通过 cpan 安装它会失败。
cpan> cpan pp
CPAN: Storable loaded ok (v2.41)
Reading '/root/.cpan/Metadata'
Database was generated on Sun, 15 Sep 2013 03:41:03 GMT
Running install for module 'pp'
Running make for R/RS/RSCHUPP/PAR-Packer-1.014.tar.gz
CPAN: Digest::SHA loaded ok (v5.84_01)
CPAN: Compress::Zlib loaded ok (v2.06)
Checksum for /root/.cpan/sources/authors/id/R/RS/RSCHUPP/PAR-Packer-1.014.tar.gz ok
CPAN: File::Temp loaded ok (v0.23)
CPAN: Parse::CPAN::Meta loaded ok (v1.4404)
CPAN: CPAN::Meta loaded ok (v2.120921)
CPAN: Module::CoreList loaded ok (v2.96)
PAN.pm: Building R/RS/RSCHUPP/PAR-Packer-1.014.tar.gz
*** You have extra Perl library paths set in your environment.
Please note that these paths (set with PERL5LIB or PERLLIB)
are not honored by perl when running under taint mode, which
may lead to problems. This is a limitation (by design) of
Perl, not of PAR::Packer; but some of the problems may
manifest here during installation.
Checking if your kit is complete...
Looks good
Prototype mismatch: sub main::prompt: none vs ($;$) at /usr/local/lib/perl5/5.18.1/ExtUtils/MakeMaker.pm line 220.
Writing Makefile for par
Writing MYMETA.yml and MYMETA.json
Writing Makefile for PAR::Packer
Writing MYMETA.yml and MYMETA.json
cp lib/PAR/Filter/Bleach.pm blib/lib/PAR/Filter/Bleach.pm
cp lib/PAR/Filter.pm blib/lib/PAR/Filter.pm
cp lib/PAR/Filter/PodStrip.pm blib/lib/PAR/Filter/PodStrip.pm
cp lib/PAR/Filter/Obfuscate.pm blib/lib/PAR/Filter/Obfuscate.pm
cp lib/PAR/Filter/PatchContent.pm blib/lib/PAR/Filter/PatchContent.pm
cp lib/PAR/Packer.pm blib/lib/PAR/Packer.pm
cp lib/PAR/Filter/Bytecode.pm blib/lib/PAR/Filter/Bytecode.pm
cp lib/PAR/StrippedPARL/Base.pm blib/lib/PAR/StrippedPARL/Base.pm
cp lib/App/Packer/PAR.pm blib/lib/App/Packer/PAR.pm
cp lib/pp.pm blib/lib/pp.pm
make[1]: Entering directory `/root/.cpan/build/PAR-Packer-1.014-Cy_LGm/myldr'
Makefile:755: warning: overriding commands for target `.c.o'
Makefile:333: warning: ignoring old commands for target `.c.o'
/usr/local/bin/perl par_pl2c.pl my_par_pl < ../script/par.pl > my_par_pl.c
/usr/local/bin/perl sha1.c.PL
cc -c -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/lib/perl5/5.18.1/x86_64-linux/CORE -DPARL_EXE=\"parl\" -O2 main.c
main.c: In function ‘main’:
main.c:121: warning: assignment discards qualifiers from pointer target type
cc main.o -s -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/local/lib/perl5/5.18.1/x86_64-linux/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -lc -o ./par
true
/usr/local/bin/perl encode_append.pl Dynamic.in ./par Dynamic.pm
/usr/local/bin/perl ./file2c.pl -c 30000 ./par /usr/local/lib/perl5/5.18.1/x86_64-linux/CORE/libperl.a > boot_embedded_files.c
cc -c -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/lib/perl5/5.18.1/x86_64-linux/CORE -DPARL_EXE=\"parl\" -O2 boot.c
cc boot.o -static-libgcc -s -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/local/lib/perl5/5.18.1/x86_64-linux/CORE -lnsl -ldl -lm -lcrypt -lutil -lc -o ./boot
true
/usr/local/bin/perl encode_append.pl Static.in ./boot Static.pm
cp Static.pm ../blib/lib/PAR/StrippedPARL/Static.pm
cp Dynamic.pm ../blib/lib/PAR/StrippedPARL/Dynamic.pm
/usr/local/bin/perl -Mblib run_with_inc.pl ./boot -q -B -Oparl
system(./boot -I/root/.cpan/build/PAR-Packer-1.014-Cy_LGm/myldr/../blib/arch -I/root/.cpan/build/PAR-Packer-1.014-Cy_LGm/myldr/../blib/lib -I/usr/local/lib/perl5/site_perl/5.18.1/x86_64-linux -I/usr/local/lib/perl5/site_perl/5.18.1 -I/usr/local/lib/perl5/5.18.1 /x86_64-linux -I/usr/local/lib/perl5/5.18.1 -I. -q -B -Oparl) failed:
make[1]: *** [parl] Error 255
make[1]: Leaving directory `/root/.cpan/build/PAR-Packer-1.014-Cy_LGm/myldr'
make: *** [subdirs] Error 2
RSCHUPP/PAR-Packer-1.014.tar.gz
/usr/bin/make -- NOT OK
'YAML' not installed, will not store persistent state
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
好的,我会手动安装它。
# wget http://search.cpan.org/CPAN/authors/id/R/RS/RSCHUPP/PAR-Packer-1.014.tar.gz
# tar -xzf PAR-Packer-1.014.tar.gz
# cd PAR-Packer-1.014
# perl Makefile.PL
# make
Skip blib/lib/App/Packer/PAR.pm (unchanged)
Skip blib/lib/PAR/Filter/Bleach.pm (unchanged)
Skip blib/lib/pp.pm (unchanged)
Skip blib/lib/PAR/StrippedPARL/Base.pm (unchanged)
Skip blib/lib/PAR/Filter/PodStrip.pm (unchanged)
Skip blib/lib/PAR/Filter/Obfuscate.pm (unchanged)
Skip blib/lib/PAR/Packer.pm (unchanged)
Skip blib/lib/PAR/Filter/PatchContent.pm (unchanged)
Skip blib/lib/PAR/Filter/Bytecode.pm (unchanged)
Skip blib/lib/PAR/Filter.pm (unchanged)
make[1]: Entering directory `/root/PAR-Packer-1.013/myldr'
Makefile:765: warning: overriding commands for target `.c.o'
Makefile:341: warning: ignoring old commands for target `.c.o'
cc -c -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/lib/perl5/5.18.1/x86_64-linux/CORE -DPARL_EXE=\"parl\" -O2 main.c
cc main.o -s -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/local/lib/perl5/5.18.1/x86_64-linux/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -lc -o ./par
true
/usr/local/bin/perl encode_append.pl Dynamic.in ./par Dynamic.pm
/usr/local/bin/perl ./file2c.pl -c 30000 ./par my_par.c load_my_par
cc -c -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/lib/perl5/5.18.1/x86_64-linux/CORE -DPARL_EXE=\"parl\" -O2 boot.c
cc boot.o -s -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/local/lib/perl5/5.18.1/x86_64-linux/CORE -lnsl -ldl -lm -lcrypt -lutil -lc -o ./boot
true
/usr/local/bin/perl encode_append.pl Static.in ./boot Static.pm
Skip ../blib/lib/PAR/StrippedPARL/Dynamic.pm (unchanged)
Skip ../blib/lib/PAR/StrippedPARL/Static.pm (unchanged)
/usr/local/bin/perl -Mblib run_with_inc.pl ./boot -q -B -Oparl
system(./boot -I/root/PAR-Packer-1.013/myldr/../blib/arch -I/root/PAR-Packer-1.013/myldr/../blib/lib -I/usr/local/lib/perl5/site_perl/5.18.1/x86_64-linux -I/usr/local/lib/perl5/site_perl/5.18.1 -I/usr/local/lib/perl5/5.18.1/x86_64-linux -I/usr/local/lib/perl5/5.18.1 -I. -q -B -Oparl) failed:
make[1]: *** [parl] Error 255
make[1]: Leaving directory `/root/PAR-Packer-1.013/myldr'
make: *** [subdirs] Error 2
导致失败。
# make install
没有更好,仍然失败。
make[1]: Entering directory `/root/PAR-Packer-1.013/myldr'
Makefile:757: warning: overriding commands for target `.c.o'
Makefile:333: warning: ignoring old commands for target `.c.o'
/usr/local/bin/perl -Mblib run_with_inc.pl ./boot -q -B -Oparl
system(./boot -I/root/PAR-Packer-1.013/myldr/../blib/arch -I/root/PAR-Packer-1.013/myldr/../blib/lib -I/usr/local/lib/perl5/site_perl/5.18.1/x86_64-linux -I/usr/local/lib/perl5/site_perl/5.18.1 -I/usr/local/lib/perl5/5.18.1/x86_64-linux -I/usr/local/lib/perl5/5.18.1 -I. -q -B -Oparl) failed:
make[1]: *** [parl] Error 255
make[1]: Leaving directory `/root/PAR-Packer-1.013/myldr'
make: *** [subdirs] Error 2
如果我安装了一个真的旧版本,那么我可以安装它,但是脚本仍然不起作用。有没有人有关于将脚本编译为二进制的建议/建议?
我找到的旧版本位于此处:http://www.filewatcher.com/m/p5-PAR-Packer-0.97.6.tbz.31-0.html
如果我手动安装,这是错误。我尝试用最新版本替换所有 StrippedPARL 文件。没修好。
# pp -o test test.pl
PAR::StrippedPARL::Static->get_raw() did not return the raw binary data for a PAR loader at PAR/StrippedPARL/Base.pm line 141, <DATA> line 1.
Could not write temporary parl (class PAR::StrippedPARL::Static) to file '/tmp/parl7iXv' at PAR/StrippedPARL/Base.pm line 65, <DATA> line 1.
/bin/pp: Failed to extract a parl from 'PAR::StrippedPARL::Static' to file '/tmp/parlV69KOmc' at PAR/Packer.pm line 1169, <DATA> line 1.
[root@server lib]# pp -p test.pl
[root@server lib]# pp -o hello a.par
PAR::StrippedPARL::Static->get_raw() did not return the raw binary data for a PAR loader at PAR/StrippedPARL/Base.pm line 141, <DATA> line 1.
Could not write temporary parl (class PAR::StrippedPARL::Static) to file '/tmp/parlH3l2' at PAR/StrippedPARL/Base.pm line 65, <DATA> line 1.
/bin/pp: Failed to extract a parl from 'PAR::StrippedPARL::Static' to file '/tmp/parlGJdI1MP' at PAR/Packer.pm line 1169, <DATA> line 1.
根据 amons 的建议,我安装了旧版本的 perl。
[root@server lib]# pp test.pl
PAR::StrippedPARL::Static->get_raw() did not return the raw binary data for a PAR loader at PAR/StrippedPARL/Base.pm line 141, <DATA> line 1.
Could not write temporary parl (class PAR::StrippedPARL::Static) to file '/tmp/parlW2E0' at PAR/StrippedPARL/Base.pm line 65, <DATA> line 1.
/bin/pp: Failed to extract a parl from 'PAR::StrippedPARL::Static' to file '/tmp/parlK48HkV0' at PAR/Packer.pm line 1169, <DATA> line 1.
[root@server lib]# perl -v
This is perl, v5.10.1 (*) built for x86_64-linux
Copyright 1987-2009, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
无法取消设置 perl5lib,它没有设置。
perl -e 'print "PERL5LIB: ", $ENV{PERL5LIB}, "\n";'
PERL5LIB:
【问题讨论】:
-
您使用的是什么操作系统?您是否安装了
make之类的开发工具和 C 编译器?你知道 PAR 不会编译你的脚本吗? -
Linux 服务器。 CentOS 6. 两者都可以,安装 C 编译器。 PAR::Packer 是一个命令行工具,它说你可以运行#pp script.pl,它会编译它。 search.cpan.org/~rschupp/PAR-Packer-1.014/lib/pp.pm
-
如果有人有建议,愿意使用替代品。
-
嗯,这很奇怪。如果你愿意,你可以file a bug。我看到你有一个自定义的 perl 5.18.1 安装。这是由您的组织编译的,还是像 activestate 这样的特定 Perl 发行版?
-
PERL5LIB 警告怎么样?如果未设置它是否有效?
标签: linux perl makefile cpan pp-perl-par-packager