Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Just another Perl shrine
 
PerlMonks  

Which takes priority site\lib or lib?

by BrowserUk (Pope)
on Feb 23, 2013 at 14:05 UTC ( #1020305=perlquestion: print w/ replies, xml ) Need Help??
BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:

I just installed Test::Simple 0.98 for a package that is dependent on Test::More 0.98:

But when I try the install of the dependent package it complains:

Warning: prerequisite Test::More 0.98 not found. We have 0.96.

So then I go looking an find Test::More is installed in both lib and site\lib:

C:\perl64>attrib /s more.pm A I C:\perl64\cpan\build\BerkeleyDB-0.43-qD7hPx\t\Test\More.p +m A I C:\perl64\cpan\build\ExtUtils-MakeMaker-6.62-sv1XY8\t\lib +\Test\More.pm A R I C:\perl64\lib\Test\More.pm <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< A I C:\perl64\packages\BerkeleyDB-0.43\t\Test\More.pm A I C:\perl64\packages\DB_File-1.820\db-5.1.19\lang\perl\Berk +eleyDB\t\Test\More.pm A I C:\perl64\packages\ExtUtils-MakeMaker-6.50\t\lib\Test\Mor +e.pm A R I C:\perl64\packages\Test-Simple-0.94\blib\lib\Test\More.pm A I C:\perl64\packages\Test-Simple-0.94\lib\Test\More.pm A R I C:\perl64\packages\Test-Simple-0.96\blib\lib\Test\More.pm A I C:\perl64\packages\Test-Simple-0.96\lib\Test\More.pm A R I C:\perl64\packages\Test-Simple-0.98\blib\lib\Test\More.pm A I C:\perl64\packages\Test-Simple-0.98\lib\Test\More.pm A I C:\perl64\packages\Win32-Unicode-0.24\inc\Test\More.pm A R I C:\perl64\site\lib\Test\More.pm <<<<<<<<<<<<<<<<<<<<<<< +<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Looking inside the two more.pms, the lib is 0.98 and site\lib is 0.96.

Which means site\lib overrides lib?

And why has it suddenly started installing itself in a different place?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Comment on Which takes priority site\lib or lib?
Select or Download Code
Re: Which takes priority site\lib or lib?
by manorhce (Sexton) on Feb 23, 2013 at 14:25 UTC

    Hi BrowerUk Can you please provide the list of paths your @INC contains it is based on the stack of @INC list which comes first the lib path comes first, for which we are using unshift with @INC to put the path to search first

      C:\perl64\packages\Inline-CPP-0.42>perl -V Summary of my perl5 (revision 5 version 10 subversion 1) configuration +: Platform: osname=MSWin32, osvers=5.2, archname=MSWin32-x64-multi-thread ... Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_64_BIT_I +NT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_SITECUSTOMIZE Locally applied patches: ActivePerl Build 1007 [291969] 0abd0d disable non-unicode case insensitive trie matching Built under MSWin32 Compiled at Jan 27 2010 14:12:21 @INC: c:/perl64/site/lib c:/perl64/lib .

      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
Re: Which takes priority site\lib or lib?
by moritz (Cardinal) on Feb 23, 2013 at 14:51 UTC

    On newish perls (I'd guess since perl 5.12, but I could be wrong), site/lib takes precedence over lib, to allow "overwriting"/shadowing/updating of core modules without touching the core package.

    And why has it suddenly started installing itself in a different place?

    The idea is that package managers (like activestate's ppm, or debian's dpkg) install into lib/, and CPAN installers into site/lib. Since the "Reveal this spoiler" link doesn't work for me (says "No such parent node"), I can't tell whether it worked as expected.

      On newish perls (I'd guess since perl 5.12, but I could be wrong), site/lib takes precedence over lib

      So they silently broke older installs without a by, leave or warning. Perfect. (No wonder Perl5's dying. :( )


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        So they silently broke older installs

        Well, old installations usually don't magically get a new perl. When installing a new major version of perl 5, it's a good idea to re-install all dependent modules anyway.

        And it wasn't without warning either. To quote perl5120delta:

        In @INC, ARCHLIB and PRIVLIB now occur after after the current version's site_perl and vendor_perl. Modules installed into site_perl>and vendor_perl will now be loaded in preference to those installed in ARCHLIB and PRIVLIB.
Re: Which takes priority site\lib or lib? (core/dual-lived/INSTALLDIRS)
by Anonymous Monk on Feb 23, 2013 at 20:30 UTC
      you can isolate yourself from these Makefile.PL oversights with perl Makefile.PL INSTALLDIRS=perl

      That seems to work. Many thanks for the work around.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
Re: Which takes priority site\lib or lib?
by Anonymous Monk on Feb 24, 2013 at 17:45 UTC
    Installation-directory choices never have anything to do with @LIB, only with environment-variables and/or CPAN defaults (which in the end do the same thing).
      Installation-directory choices never have anything to do with @LIB,

      I didn't mention @LIB?

      only with environment-variables and/or CPAN defaults

      If you know of a reference that details those, that would be useful information.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1020305]
Approved by Athanasius
Front-paged by davies
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2014-04-18 23:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (472 votes), past polls