A instalação do módulo Cpan falha

1

Estou tentando instalar o módulo Inline :: MakeMaker Perl (incluindo Inline :: C), mas ele falha ao instalar o Inline :: C (parece que não é possível encontrar o "make", embora o make esteja instalado em / usr / bin ).

Isso está no CentOS 6 com Perl v5.18.2 (instalado a partir do código-fonte em / usr / local / perl).

Aqui está a saída da minha tentativa de instalação (dividi a saída em três partes para facilitar a leitura).

Esta é a primeira parte (sem erros):

[root@xyz .cpan]# cpan -i Inline::MakeMaker
Reading '/root/.cpan/Metadata'
  Database was generated on Tue, 01 Apr 2014 19:06:25 GMT
Running install for module 'Inline::MakeMaker'
Running make for S/SI/SISYPHUS/Inline-0.54.tar.gz
Checksum for /root/.cpan/sources/authors/id/S/SI/SISYPHUS/Inline-0.54.tar.gz ok

  CPAN.pm: Building S/SI/SISYPHUS/Inline-0.54.tar.gz

Checking if your kit is complete...
Looks good

Inline::C is packaged with Inline.pm because it is the most commonly used
Inline Language Support Module (ILSM).

See also: Inline::ASM, ::Awk, ::BC, ::Basic, ::Befunge, ::CPP (C++), ::CPR,
          ::Foo, ::Guile, ::Java, ::Octave, ::PERL, ::Python, ::Ruby, ::TT,
          ::Tcl and ::WebChat.

Config.pm indicates that your version of Perl was built with this C compiler:

    cc

I have located this compiler on your system.

Do you want to install Inline::C? [y] y
Writing Makefile for Inline::C
Writing MYMETA.yml and MYMETA.json
Writing Makefile for Inline
Writing MYMETA.yml and MYMETA.json
cp lib/Inline/MakeMaker/Changes blib/lib/Inline/MakeMaker/Changes
cp Inline.pm blib/lib/Inline.pm
AutoSplitting blib/lib/Inline.pm (blib/lib/auto/Inline)
cp Inline-API.pod blib/lib/Inline-API.pod
cp Inline-Support.pod blib/lib/Inline-Support.pod
cp lib/Inline/denter.pm blib/lib/Inline/denter.pm
AutoSplitting blib/lib/Inline/denter.pm (blib/lib/auto/Inline/denter)
cp lib/Inline/MakeMaker.pm blib/lib/Inline/MakeMaker.pm
cp lib/Inline/Foo.pm blib/lib/Inline/Foo.pm
cp Inline.pod blib/lib/Inline.pod
cp Inline-FAQ.pod blib/lib/Inline-FAQ.pod
make[1]: Entering directory '/root/.cpan/build/Inline-0.54-D_RUT7/C'
cp lib/Inline/C/ParseRegExp.pm ../blib/lib/Inline/C/ParseRegExp.pm
cp lib/Inline/C/ParseRecDescent.pm ../blib/lib/Inline/C/ParseRecDescent.pm
cp C-Cookbook.pod ../blib/lib/Inline/C-Cookbook.pod
cp C.pod ../blib/lib/Inline/C.pod
cp C.pm ../blib/lib/Inline/C.pm
Manifying ../blib/man3/Inline::C::ParseRecDescent.3
Manifying ../blib/man3/Inline::C::ParseRegExp.3
Manifying ../blib/man3/Inline::C-Cookbook.3
Manifying ../blib/man3/Inline::C.3
make[1]: Leaving directory '/root/.cpan/build/Inline-0.54-D_RUT7/C'
Manifying blib/man3/Inline.3
Manifying blib/man3/Inline-Support.3
Manifying blib/man3/Inline-API.3
Manifying blib/man3/Inline-FAQ.3
  SISYPHUS/Inline-0.54.tar.gz
  /usr/bin/make -- OK
Running make test
make[1]: Entering directory '/root/.cpan/build/Inline-0.54-D_RUT7/C'
Manifying ../blib/man3/Inline::C::ParseRecDescent.3
Manifying ../blib/man3/Inline::C::ParseRegExp.3
make[1]: Leaving directory '/root/.cpan/build/Inline-0.54-D_RUT7/C'
PERL_DL_NONLAZY=1 /usr/local/perl/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00init.t ............. ok   
t/01usages.t ........... ok   
t/02config.t ........... ok   
t/03errors.t ........... ok   
t/04create.t ........... ok   
t/05files.t ............ Skipping - couldn't load the Inline::Files module
t/05files.t ............ ok   
t/06rewrite_config.t ... ok   
t/07rewrite2_config.t .. ok   
All tests successful.
Files=8, Tests=19, 12 wallclock secs ( 0.04 usr  0.01 sys +  1.28 cusr  0.05 csys =  1.38 CPU)
Result: PASS
<snip>

Aqui é onde o erro acontece:

<snip>
make[1]: Entering directory '/root/.cpan/build/Inline-0.54-D_RUT7/C'
PERL_DL_NONLAZY=1 /usr/local/perl/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, '../blib/lib', '../blib/arch')" t/*.t
t/00init.t .............. ok   
t/01syntax.t ............ ok   
t/02config.t ............ ok   
t/03typemap.t ........... ok   
t/04perlapi.t ........... ok   
t/05xsmode.t ............ ok   
t/06parseregexp.t ....... ok   
t/07typemap_multi.t ..... ok   
t/08taint.t ............. 1/10 sh: make: No such file or directory

A problem was encountered while attempting to compile and install your Inline
C code. The command that failed was:
  make > out.make 2>&1

The build directory was:
/root/.cpan/build/Inline-0.54-D_RUT7/C/_Inline_test/build/_08taint_1_p_0965

To debug the problem, cd to the build directory, and inspect the output files.

 at ./t/08taint_1.p line 7.
    ...propagated at /root/.cpan/build/Inline-0.54-D_RUT7/C/../blib/lib/Inline/C.pm line 797.
BEGIN failed--compilation aborted at ./t/08taint_1.p line 7.
Compilation failed in require at t/08taint.t line 45.
# Looks like you planned 10 tests but ran 1.
# Looks like your test exited with 127 just after 1.
t/08taint.t ............. Dubious, test returned 127 (wstat 32512, 0x7f00)
Failed 9/10 subtests 
<snip>

Aqui está a última parte:

<snip>
t/09parser.t ............ This test could take a couple of minutes to run
t/09parser.t ............ ok    
t/10callback.t .......... ok   
t/11default_readonly.t .. ok   
t/12taint_old.t ......... Skipped - applies only to perl 5.6.x
t/12taint_old.t ......... ok   
t/14void_arg.t .......... ok     
t/15ccflags.t ........... ok   
t/16ccflagsex.t ......... ok   
t/17prehead.t ........... ok   
t/18quote_space.t ....... ok     
t/19INC.t ............... ok   
t/20eval.t .............. ok   
t/21read_DATA.t ......... ok   
t/22read_DATA_2.t ....... ok   
t/23validate.t .......... ok   
t/24prefix.t ............ ok   
t/25proto.t ............. ok   

Test Summary Report
-------------------
t/08taint.t           (Wstat: 32512 Tests: 1 Failed: 0)
  Non-zero exit status: 127
  Parse errors: Bad plan.  You planned 10 tests but ran 1.
Files=25, Tests=91, 30 wallclock secs ( 0.08 usr  0.02 sys + 25.88 cusr  2.11 csys = 28.09 CPU)
Result: FAIL
Failed 1/25 test programs. 0/91 subtests failed.
make[1]: *** [test_dynamic] Error 255
make[1]: Leaving directory '/root/.cpan/build/Inline-0.54-D_RUT7/C'
make: *** [subdirs-test] Error 2
  SISYPHUS/Inline-0.54.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports SISYPHUS/Inline-0.54.tar.gz
Running make install
  make test had returned bad status, won't install without force

Aqui estão mais alguns dados da minha tentativa de depuração (desculpe por tornar o post bastante longo):

Eu executei manualmente o teste com falha no depurador:

cd /root/.cpan/build/Inline-0.54-Rbzd5U/C
PERL_DL_NONLAZY=1
/usr/local/perl/perls/perl-5.18.2/bin/perl -d "-MExtUtils::Command::MM" "-e" "test_harness(0, '../blib/lib', '../blib/arch')" t/08taint.t

Aqui está um trecho da saída:

t/08taint.t ............. 1/10 sh: make: No such file or directory

A problem was encountered while attempting to compile and install your Inline
C code. The command that failed was:
  make > out.make 2>&1

The build directory was:
/root/.cpan/build/Inline-0.54-Rbzd5U/C/_Inline_test/build/_08taint_1_p_0965

To debug the problem, cd to the build directory, and inspect the output files.

 at ./t/08taint_1.p line 7.
    ...propagated at /root/.cpan/build/Inline-0.54-Rbzd5U/C/../blib/lib/Inline/C.pm line 797.
BEGIN failed--compilation aborted at ./t/08taint_1.p line 7.
Compilation failed in require at t/08taint.t line 45.

Portanto, o arquivo que está falhando é t / 08taint_1.p (que é requerido na linha 45 de t / 08taint.t). 08taint_1.p contém isto:

BEGIN {is(${^TAINT}, 1, '1: taint_is_on');};

use Inline Config =>
    UNTAINT => 1,
    DIRECTORY => '_Inline_test';

use Inline C => <<'END_OF_C_CODE';

int add(int x, int y) {
    return x + y;
}

END_OF_C_CODE

is(add(7,3), 10, 'add_test');

1;

Eu entendo que o equipamento de teste usa o acima para construir um teste, que por sua vez não consegue encontrar "make" por alguma razão obscura.

Aqui está /root/.cpan/build/Inline-0.54-Rbzd5U/blib/lib/Inline/C.pm (linha 781-799), e é a segunda linha de código da parte inferior que gera o erro:

sub compile {
    my $o = shift;

    my $build_dir = $o->{API}{build_dir};
    my $cwd = &cwd;
    ($cwd) = $cwd =~ /(.*)/ if $o->UNTAINT;

    chdir $build_dir;
    # Run these in an eval block, so that we get to chdir back to
    # $cwd if there's a failure. (Ticket #81375.)
    eval {
      $o->call('makefile_pl', '"perl Makefile.PL"', 2);
      $o->call('make', '"make"', 2);
      $o->call('make_install', '"make install"', 2);
    };
    chdir $cwd;
    die if $@; #Die now that we've done the chdir back to $cwd. (#81375)
    $o->call('cleanup', 'Cleaning Up', 2);
}

Portanto, a chamada "make" acima falha, mas por quê? Make está em / usr / bin, que está no PATH.

    
por Jim Balo 02.04.2014 / 03:14

2 respostas

1

Eu fiz uma instalação forçada (já que o teste com falha parecia estar com defeito):

cpan -f -i Inline::MakeMaker

Com isso, ele foi instalado corretamente e eu não tive nenhum problema com ele.

    
por 04.04.2014 / 05:42
0

O problema parece ser uma alteração na seção Inline.pm "sub env_untaint {}".

O novo teste para escritabilidade dir de alguma forma leva o caminho para "fazer", então é claro que ele falha. Notavelmente, há uma seção comentada:

 # Was:       
 #           join ':', grep...

Se você restaurar o antigo código Was: join e comentar o novo código join acima dele no subentendente env_untaint, make clean , perl Makefile.PL , deve make test com sucesso, instalar.

    
por 13.05.2014 / 20:18