develooper Front page | perl.perl5.porters | Postings from July 2005

[perl #36547] Re: [Module::Build] Edge cases in "find_perl" algorithms

From:
Michael G Schwern
Date:
July 14, 2005 00:59
Subject:
[perl #36547] Re: [Module::Build] Edge cases in "find_perl" algorithms
Message ID:
rt-3.0.11-36547-117276.7.34559112747647@perl.org
# New Ticket Created by  Michael G Schwern 
# Please include the string:  [perl #36547]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=36547 >


On Wed, Jul 13, 2005 at 10:15:50PM -0500, Ken Williams wrote:
> That's good analysis, but I don't actually think anything should be 
> changed in Module::Build's method until we can demonstrate a case in 
> which it fails, and right now I know of none.  Since it checks 
> Config::myconfig(), it ensures that the version and any compilation 
> options are correct.

Installing Module::Build with an uninstalled Perl (ie. you build Perl and
run it from the source directory) will fail to find perl.

0 ~/devel/Module-Build$ ../../../../usr/local/src/bleadperl/perl -I/usr/local/src/bleadperl/lib -w Build.PL
Warning: Can't locate your perl binary at lib/Module/Build/Base.pm line 139.

More common than you think, especially when working on bleadperl.  MakeMaker
even has special code to deal with this case:

0 ~/devel/ExtUtils-MakeMaker$ ../../../../usr/local/src/bleadperl/perl -I/usr/local/src/bleadperl/lib -w Makefile.PL 
... Detected uninstalled Perl.  Trying to continue.
Have /usr/local/src/bleadperl/lib/Config.pm expected /usr/local/perl/bleadperl/lib/5.9.3/darwin-thread-multi-2level/Config.pm
Writing Makefile for ExtUtils::MakeMaker

The simple fix is to do the $cwd/$^X check if $^X is ./foo or ../foo.

Why wait until someone gets bit in the ass?


> Perhaps it could also check a variable like $Config{installarchlib} or 
> something, to make sure we've got the right library path, in case the 
> crazy user has two exactly identically-configured perls installed in 
> two different places we happen to find with the search algorithm.

Or you could just compare the values of $INC{"Config.pm"}.


-- 
Michael G Schwern     schwern@pobox.com     http://www.pobox.com/~schwern
Ahh email, my old friend.  Do you know that revenge is a dish that is best 
served cold?  And it is very cold on the Internet!




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