Bug 1138817

Summary: Perl core modules are installed into vendor_perl, so they are not updated by cpan
Product: [Fedora] Fedora Reporter: Dan Book <grinnz>
Component: perlAssignee: Jitka Plesnikova <jplesnik>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: cweyl, iarnell, jplesnik, kasal, perl-devel, ppisar, psabata, rc040203, tcallawa
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-08 14:15:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dan Book 2014-09-05 17:04:26 UTC
Description of problem:
As perl core modules are broken into separate packages, these packages install the modules into vendor_perl. By default the vendor_perl directory precedes the core module directory in @INC. CPAN by default will install updates to core modules in the core directory, not site_perl. Therefore in a default configuration, updating a core module with cpan or cpanm appears to work, but the RPM version in vendor_perl continues to be used instead.

Version-Release number of selected component (if applicable):
Depends on RPMs that are out of date with CPAN (this will always happen for some time at least)
Currently, perl-Test-Simple-1.001002 is older than the CPAN version of Test-Simple-1.001003 required to install an updated version of POE.

How reproducible:
Always

Steps to Reproduce:
1. Install perl and perl-core from yum
2. Run "cpan Test::Simple" or "cpanm Test::Simple"

Actual results:
New version of Test-Simple distribution is installed but old version from RPM continues to be used, so cpan cannot install modules requiring new version

Expected results:
New version of Test-Simple distribution is used

Additional info:
Can be avoided by using local::lib or modifying @INC. Maybe there is a better solution.

Comment 1 Petr Pisar 2014-09-08 13:05:16 UTC
(In reply to Dan Book from comment #0)
> Description of problem:
> As perl core modules are broken into separate packages, these packages
> install the modules into vendor_perl. By default the vendor_perl directory
> precedes the core module directory in @INC.

True.

> CPAN by default will install
> updates to core modules in the core directory, not site_perl.

No. It installs all modules into the same place. I think it used to install core modules into core directory a lot of years ago, but this not true anymore.

> Steps to Reproduce:
> 1. Install perl and perl-core from yum
> 2. Run "cpan Test::Simple" or "cpanm Test::Simple"
> 
> Actual results:
> New version of Test-Simple distribution is installed

It's installed either into site directory or local::lib directory. It depends what you choose at cpan configuration.

If it's configured for site directory, then the modules will be installed there.

Otherwise the modules will be installed into ~/perl5 and your ~/.bashrc will be modified to set PERL_MM_OPT and PERL_MB_OPT variables, if you select so.

> but old version from RPM continues to be used,

In addition, if you install perl-homedir package, PERL5LIB and PERL_LOCAL_LIB_ROOT will be set on login, so any perl invocation will use the ~/perl5 tree automatically.

I think this is what brought your confusion. The cpan installs into ~/perl5 but does use it by default.

> Can be avoided by using local::lib or modifying @INC. Maybe there is a
> better solution.

I think the best solution is to modify the cpan client to offer creating the site directories. If it succeeds, it will default installation to site directories instead of the local::lib. See bug #1132321.

Or does you cpan client behave differently?

Comment 2 Dan Book 2014-09-08 13:36:16 UTC
When testing this it was not using local::lib or any such local install. There was no ~/perl5. CPAN and cpanm both install the updated Test::Simple into /usr/share/perl5 by default. Non-core modules are installed into the site perl directory which is /usr/local/share/perl5:

$ perl -V:installsitelib
installsitelib='/usr/local/share/perl5';

But there is no trace of the Test::Simple distribution there after having both cpan and cpanm "successfully" install the updated distribution. /usr/share/perl5/Test/Simple.pm however is the updated version. The problem is that while /usr/local/share/perl5 comes before /usr/share/perl5/vendor_perl (where the RPM installs to), /usr/share/perl5 comes after in @INC.

Comment 3 Dan Book 2014-09-08 14:15:50 UTC
I can't seem to reproduce it again with the latest version of CPAN or Test::Simple. It is installing to /usr/local/share/perl5 now. Maybe was a bug in an earlier version. Will see if it happens again.

Comment 4 Dan Book 2014-09-08 18:08:25 UTC
Confirming that this was a bug in the Test::Simple distribution. It was fixed to install into the site directory in perl > 5.12.