Bug#681026: perl-modules: Installation of modules via CPAN fails due to broken dependency logic

Niko Tyni ntyni at debian.org
Tue Apr 16 20:04:23 UTC 2013


On Tue, Apr 16, 2013 at 02:27:53AM +0200, Vincent Lefevre wrote:

> I still have the problem with Debian's CPAN.pm:
> 
> xvii:~> env | grep PERL
> PERL_LOCAL_LIB_ROOT=/home/vinc17/perl5
> PERL_MB_OPT=--install_base /home/vinc17/perl5
> PERL_MM_OPT=INSTALL_BASE=/home/vinc17/perl5
> PERL_LWP_SSL_CA_PATH=/home/vinc17/wd/config/cacert
> PERL5LIB=/home/vinc17/lib/site_perl:/home/vinc17/perl5/lib/perl5

It would have helped if you had provided this list at the start,
as it's crucial to reproducing the issue. Consider:

$ perl -Mlocal::lib
export PERL_LOCAL_LIB_ROOT="/home/cpan/perl5";
export PERL_MB_OPT="--install_base /home/cpan/perl5";
export PERL_MM_OPT="INSTALL_BASE=/home/cpan/perl5";
export PERL5LIB="/home/cpan/perl5/lib/perl5/x86_64-linux-gnu-thread-multi:/home/cpan/perl5/lib/perl5";
export PATH="/home/cpan/perl5/bin:$PATH";

Note the difference in PERL5LIB: you're missing the suggested
lib/perl5/<archname> .

With your setup, I can indeed reproduce the problem. 

> Installing /home/vinc17/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/auto/Unix/Processors/Processors.bs
> Installing /home/vinc17/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/auto/Unix/Processors/Processors.so
> Installing /home/vinc17/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/Unix/Processors.pm
> Installing /home/vinc17/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/Unix/Processors/Info.pm

[...]

>   BURAK/Sys-Info-Driver-Linux-0.7900.tar.gz
> Tests succeeded but one dependency not OK (Unix::Processors)

What's happening is that the XS module gets installed under
the arch-specific directory (as it should be), but that
directory was not in @INC when you started the cpan shell
because it did not exist at the time. So a later sanity check in
CPAN::Distribution::_make_test_illuminate_prereqs() fails to find it on
the module path and bails out.

The fact that it works the second time, or after you have installed
a newer CPAN.pm, is because those operations create the arch-specific
directory, which makes it show up on @INC on later perl invocations,
which makes the above sanity check succeed. Just
 mkdir -p /home/vinc17/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/
would have been enough.

Following the local::lib suggestion and explicitly including the
arch-specific directory in PERL5LIB also fixes the problem, because
(unlike @INC) the PERL5LIB directories are not pruned at startup if they
don't exist, and the sanity check looks in both.

Hope this helps,
-- 
Niko Tyni   ntyni at debian.org




More information about the Perl-maintainers mailing list