Bug 594768 - perl-CPAN should install modules into local/site_perl directory
perl-CPAN should install modules into local/site_perl directory
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: perl (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Marcela Mašláňová
Petr Šplíchal
Depends On:
  Show dependency treegraph
Reported: 2010-05-21 10:40 EDT by Petr Šplíchal
Modified: 2016-05-31 21:39 EDT (History)
3 users (show)

See Also:
Fixed In Version: perl-5.10.1-110.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 616736 (view as bug list)
Last Closed: 2010-11-11 09:53:58 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Petr Šplíchal 2010-05-21 10:40:01 EDT
Description of problem:

Using CPAN to install the latest modules can result into
overwriting files from the perl rpm package. This can cause
problems such as broken modules after package update (bug 375621).

Version-Release number of selected component (if applicable):

Steps to Reproduce:
# perl -MCPAN -e 'install "Scalar::Util"'
Installing /usr/lib64/perl5/auto/List/Util/Util.so
Installing /usr/lib64/perl5/Scalar/Util.pm
Installing /usr/lib64/perl5/Scalar/Util/PP.pm
Installing /usr/lib64/perl5/List/Util.pm
Installing /usr/lib64/perl5/List/Util/XS.pm
Installing /usr/lib64/perl5/List/Util/PP.pm
Appending installation info to /usr/lib64/perl5/perllocal.pod
  /usr/bin/make install  -- OK
Warning (usually harmless): 'YAML' not installed, will not store persistent state

Actual results:
# rpm -V perl
.M5....T.    /usr/lib64/perl5/List/Util.pm
SM5....T.    /usr/lib64/perl5/List/Util/PP.pm
.M5....T.    /usr/lib64/perl5/List/Util/XS.pm
.M5....T.    /usr/lib64/perl5/Scalar/Util.pm
SM5....T.    /usr/lib64/perl5/Scalar/Util/PP.pm
SM5....T.    /usr/lib64/perl5/auto/List/Util/Util.so

Expected results:
Manually installed modules go into local/site_perl directory where
they override system files by being earlier in @INC. Inspecting
@INC I see:

# perl -e 'print join "\n", @INC;'

which looks like site_perl directories are only after system,
while in RHEL5 we have site_perl at the beginning:

# perl -e 'print join "\n", @INC;'

Is that expected? I guess not...
Comment 2 RHEL Product and Program Management 2010-06-07 12:02:49 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
Comment 3 Marcela Mašláňová 2010-06-08 04:07:15 EDT
Paths @INC were changed to be shorter (and probably faster) for RHEL-6. They are defined in this way:
site:    /usr/local/lib64/perl5
site:    /usr/local/share/perl5
vendor:    /usr/lib64/perl5
vendor:    /usr/share/perl5
perl:    /usr/lib64/perl5
perl:    /usr/share/perl5
compatibility directories:    /usr/local/lib64/perl5/site_perl/5.10.0/x86_64-linux-thread-multi

I'll add a patch that set "site" as default installation path for CPAN.
Comment 5 Petr Šplíchal 2010-07-21 05:48:07 EDT
Verified with perl-5.10.1-113.el6.x86_64,
perl-CPAN-1.9402-113.el6.x86_64. All files now installed into
/usr/local/* which will prevent clashes:

:: [   LOG    ] :: Test

:: [   LOG    ] :: Scalar::Util version is 1.21
:: [   PASS   ] :: Installing Scalar::Util module from CPAN
:: [   LOG    ] :: Scalar::Util version is 1.23
:: [   PASS   ] :: Scalar::Util smoke test
:: [   PASS   ] :: Checking for installed files
:: [   PASS   ] :: Checking /usr/local/lib64/perl5/auto/List/Util/Util.so
:: [   PASS   ] :: Checking /usr/local/lib64/perl5/auto/List/Util/Util.bs
:: [   PASS   ] :: Checking /usr/local/lib64/perl5/List/Util.pm
:: [   PASS   ] :: Checking /usr/local/lib64/perl5/List/Util/XS.pm
:: [   PASS   ] :: Checking /usr/local/lib64/perl5/List/Util/PP.pm
:: [   PASS   ] :: Checking /usr/local/lib64/perl5/Scalar/Util.pm
:: [   PASS   ] :: Checking /usr/local/lib64/perl5/Scalar/Util/PP.pm
:: [   PASS   ] :: Checking /usr/local/share/man/man3/Scalar::Util.3pm
:: [   PASS   ] :: Checking /usr/local/share/man/man3/List::Util.3pm
:: [   PASS   ] :: Checking /usr/local/share/man/man3/List::Util::XS.3pm
:: [   PASS   ] :: Verifying the perl package
:: [   LOG    ] :: Duration: 1m 19s
:: [   LOG    ] :: Assertions: 14 good, 0 bad
:: [   PASS   ] :: RESULT: Test
Comment 6 releng-rhel@redhat.com 2010-11-11 09:53:58 EST
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.
Comment 7 Ken Stailey 2013-04-03 17:26:33 EDT
FYI this will never be fixed in RHEL 5

Note You need to log in before you can comment on or make changes to this bug.