Bug 1127585

Summary: Perl 3rd-party core modules not installed to core
Product: Red Hat Enterprise Linux 7 Reporter: Matt Sharpe <matt.sharpe>
Component: perlAssignee: perl-maint-list
Status: CLOSED WONTFIX QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: ppisar
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-07 11:00:44 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 Matt Sharpe 2014-08-07 08:13:06 UTC
Perl has some 3rd party modules which are considered core, such as ExtUtil::MakeMaker and Data::Dumper, the full list can be found through the Module::CoreList module. The RHEL perl, perl-core, and packages for those modules do not install to the correct directory however.

3rd party core modules get installed into vendorlib instead of privlib and archlib, resulting in code that relies on sandboxing non-core modules being unable to find dependencies. In the case of cpanminus, a very common perl module installation tool, this breaks module installation. This effectively leaves users unable to package custom applications with automatically bundled dependencies as core modules are not found and dependencies are unable to be installed.

I think the appropriate solution is to install all core modules into the standard perl directories with only regular 3rd party modules, not core 3rd party modules as well, going into vendorlib.

Comment 2 Petr Pisar 2014-08-07 11:00:44 UTC
While putting dual-lived modules into core directories sounds reasonable, there are issues preventing from it:

(1) The debugging files from corresponding *-debuginfo sub-packages would conflict with perl-debuginfo (see bug #878863).

(2) Bootstrapping perl requires both of the module versions (the ones distributed with perl sources and the ones distributed from CPAN) available at the same time.

(3) The CPAN modules are third-party and so they clearly belongs to vendor (or site) directory. Reading their Makefile.PL reveals that none of them defaults to core directory. Morover other distributions also do not install dual-lived modules into core directory.


Regarding the cpanminus:

I think this is cpanminus bug that it ignores non-core directories. There are many reasons why users would like to prefer their own modules from vendor or site.

The documentation states:

--self-contained
           When examining the dependencies, assume no non-core modules are
           installed on the system. Handy if you want to bundle application
           dependencies in one directory so you can distribute to other 
           machines.

And as you said 'the full list can be found through the Module::CoreList'.

Therefore cpanm should use the Module::CoreList to select core modules instead of blindly disabling vendor and site directories. Or it should download the missing dual-lived modules from CPAN as it do with any other modules.