On Sun, Mar 23, 2008 at 06:21:38PM -0700, James Keenan via RT wrote:
> On Sat Mar 22 10:38:42 2008, doughera wrote:
> 
> > Just be careful that 'use lib' doesn't look outside of the parrot source 
> > tree.  If pmc2c.pl is normally invoked from the root directory, then 
> > ../lib and ../../lib are looking outside of the parrot source.  This is 
> > wrong, since there is no guarantee that stuff stored in ../../lib is even 
> > remotely suitable for parrot, or indeed for any other use.
> > 
> 
> Suppose that at the top of tools/build/pmc2c.pl, we simply state this:
> 
> use Getopt::Long ();
> use FindBin qw($Bin);
> use lib "$Bin/../../lib";
> use Parrot::Pmc2c::Pmc2cMain ();
> 
> $Bin here is tools/build/.  We go two levels up, then back down to the
> lib/ underneath the top-level Parrot directory.  That lib/ is the one in
> which we'll start looking for Parrot::Pmc2c::Pmc2cMain.
> 
> So that should mean we're not looking in the wrong places -- correct?

Off hand, that sounds right.  To see real gains here we need to avoid
loading FindBin.pm completely.  So it'll need to be require()'d if the
correct information hasn't been passed in.

-J

--

Attachment: pgpClNRxiHUEB.pgp
Description: PGP signature

Reply via email to