[Module::Build] Re: [PATCH] add Module::Build 0.27_08
Status: Beta
Brought to you by:
kwilliams
|
From: Yitzchak Scott-T. <sth...@ef...> - 2006-03-07 17:28:44
|
On Tue, Mar 07, 2006 at 11:20:13AM -0600, Steve Peters wrote:
> On Tue, Mar 07, 2006 at 11:59:17AM -0500, Randy W. Sims wrote:
> > Dominic Dunlop wrote:
> > >On 2006?03?07, at 16:24, Yitzchak Scott-Thoennes wrote:
> > >
> > >>On Tue, Mar 07, 2006 at 06:38:13AM -0500, Randy W. Sims wrote:
> > >>
> > >>>
> > >>>Looks like the problem happens here:
> > >
> > >...
> > >
> > >>> foreach my $perl ( $c->{perlpath},
> > >>> map File::Spec->catfile($_, $thisperl),
> > >>> File::Spec->path()
> > >>> ) {
> > >>> return $perl if -f $perl and $proto->_perl_is_same($perl);
> > >>> }
> > >>>
> > >>>Where we try to find the interpreter. It's falling all the way through
> > >>>and returning undef. Any idea where we're missing it here?
> > >>
> > >>
> > >>It should be finding it in $c->{perlpath}. Dominic, can you add a
> > >>
> > >> warn "checking in $_, \$^X is $^X, perl is $perl, -f \$perl is ",
> > >>-f $perl;
> > >
> > > ^^
> > >Um, the $_ that is the topic of the map() is out of scope at the top of
> > >the loop, and there doesn't seem to be another relevant one in scope.
> > >But, because I can't suggest anything better...
> > >
> > >>
> > >>at the beginning of the loop and a
> > >>
> > >> warn "not found"
> > >>
> > >>at the end?
> > >
> > >
> > >With your additions as suggested, I get
> > >
> >
> > Ah, this is because we don't expect to be run from a non-installed perl.
> > Notice we pretty much throw $^X away if it's not absolute? Is there any
> > reason we can't add:
> >
> > return $^X if $proto->_perl_is_same($^X);
> >
> > at the top of find_perl_interpreter(). Or do we need to be more guarded?
> >
>
> Well, here's the rub. It looks like, while it runs, Module::Build
> changes directories. When I ran, it tries to look for ./perl in
> /home/steve/smoke/perl-current/t/_tmp/Simple, which it won't be able to.
> So, Module::Build is completely dependent on what is an absolute path $^X,
> $Config, or the environment to figure out what Perl is running it. So,
> operating system where $^X returns a relative path (apparently BSDs and Mac
> OS X) will all fail the the Module::Build tests. Whether Build.PL
> scripts work with a Perl not in the $PATH and run using a relative path
> on these OS's is left as an exercise for the reader.
Can you try:
--- lib/Module/Build/Base.pm.orig 2006-03-06 07:43:57.093750000 -0800
+++ lib/Module/Build/Base.pm 2006-03-07 09:00:28.884844800 -0800
@@ -334,7 +334,8 @@
$thisperl .= $exe unless $thisperl =~ m/$exe$/i;
}
- foreach my $perl ( $c->{perlpath},
+ foreach my $perl ( File::Spec->rel2abs($^X),
+ $c->{perlpath},
map File::Spec->catfile($_, $thisperl), File::Spec->path()
) {
return $perl if -f $perl and $proto->_perl_is_same($perl);
|