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

Vincent Lefevre vincent at vinc17.net
Tue Apr 16 23:55:48 UTC 2013


On 2013-04-16 23:04:23 +0300, Niko Tyni wrote:
> 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> .

That shouldn't be necessary. The perlrun(1) man page says:

  PERL5LIB    A list of directories in which to look for Perl library
              files before looking in the standard library and the
              current directory.  Any architecture-specific directories
              under the specified locations are automatically included
              if they exist, with this lookup done at interpreter
              startup time.

lib/perl5/<archname> doesn't exist yet initially, but I'd say
that's up to cpan to add it automatically when necessary.

[...]
> 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.

Well, at least since CPAN 1.9800, the problem no longer occurs without
having to do anything you suggested. I wonder what has changed (e.g.
whether this is intentional or the problem could reappear later).

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




More information about the Perl-maintainers mailing list