Не могу установить PAR::Packer 1.014 в Linux

При установке модуля 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: 

1 ответ

Я просто столкнулся с той же проблемой. По крайней мере, в моем случае, проверьте переменную окружения TMPDIR и проверьте, можете ли вы выполнить двоичный файл из нее. В моем случае это /dev/shm и исполнение из него запрещено (по соображениям безопасности, я думаю). Загрузочный код (из boot.c) распаковывает бинарный файл в $TMPDIR и пытается запустить его из него и молча завершается с ошибкой (поскольку автор модуля не смог предвидеть, что он когда-нибудь завершится неудачей). Если это так, решение:

    TMPDIR=/tmp make
Другие вопросы по тегам