develooper Front page | perl.perl5.porters | Postings from April 2015

What is the correct INSTALLDIRS setting for CPAN modules in core?

Thread Next
From:
Steve Hay
Date:
April 29, 2015 12:34
Subject:
What is the correct INSTALLDIRS setting for CPAN modules in core?
Message ID:
CADED=K76abNh7JZ9QSPeywfePi82Q6A1hb-VSHcyH9p8Hr9-iw@mail.gmail.com
I thought I knew the answer to this, but now I'm confused...

The @INC ordering was changed by
http://perl5.git.perl.org/perl.git/commit/b9ba2fadb1, which first
appeared in 5.11.0, so I thought the correct incantation was something
like

INSTALLDIRS => ($] < 5.011) ? 'perl' : 'site'

or maybe using 5.012 if you don't care about dev releases, and maybe
with a lower bound check as well, representing the perl version at
which a module entered the core distribution, e.g.

INSTALLDIRS => ($] >= 5.007003 && $] < 5.011) ? 'perl' : 'site'

for a module that entered core in 5.7.3.

However, I note that two modules in core are doing things differently:

Socket.pm follows the plan above:

# Since we're providing a later version of a core module, before 5.12 the
# @INC order is wrong so we'll have to go in perl rather than site dirs
$makefile_args{INSTALLDIRS} = "perl" if $] < 5.012;

and when I update 5.20.2 with the latest Socket it duly installs into
site/lib rather than lib. (The default value of INSTALLDIRS is
'site'.)

But CPAN.pm says this:

INSTALLDIRS  => 'perl',  # as it is coming with perl

and when I update 5.20.2 with the latest CPAN it intalls into lib.

In both cases I wind up using the new version: In the case of Socket I
still have the old version in lib, but perl correctly uses the new
version in site/lib; in the case of CPAN the new version has
overwritten the old version in lib.

Does it matter that they're working differently? I'm just trying to
figure out if there's a subtle bug lurking in one plan that would make
the other plan preferable...

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About