Re: [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 20:41:48
|
On Tue, Mar 07, 2006 at 12:24:22PM -0800, Yitzchak Scott-Thoennes wrote:
> On Tue, Mar 07, 2006 at 03:10:55PM -0500, Randy W. Sims wrote:
> > Yitzchak Scott-Thoennes wrote:
> > >On Tue, Mar 07, 2006 at 01:32:52PM -0600, Ken Williams wrote:
> > >
> > >>On Mar 7, 2006, at 11:57 AM, Andy Dougherty wrote:
> > >>
> > >>
> > >>>On Tue, 7 Mar 2006, Yitzchak Scott-Thoennes wrote:
> > >>>
> > >>>
> > >>>>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);
> > >>>
> > >>>I'm afraid that didn't help either, since the t/_tmp/Simple/ directory
> > >>>doesn't have a perl executable.
> > >>
> > >>Hmm - so in your case is $^X just 'perl'? If that's the only pointer
> > >>to the currently running perl, we might have to do a PATH search for
> > >>it. Maybe only when it doesn't contain slashes or something.
> > >
> > >
> > >The above code does do a PATH search, but this perl isn't installed.
> > >We might have to do a search up cwd like
> > >ExtUtils::CBuilder::Base::perl_src().
> >
> > I suspect this needs a way to apply the fixup only when running the test
> > && $ENV{PERL_CORE}. The test files are being executed by perl's Makefile
> > or TEST, not being loaded and run from M::B, right? So, when each test
> > file is run it needs (or MBTest.pm needs) to figure out where the perl
> > is that loaded it and apply a fixup. We'll also need to put a hook in
> > M::B to allow the fixup.
> >
> > Randy.
>
> I think just putting code conditional on $ENV{PERL_CORE} in
> find_perl_interpreter is good enough; no need to modify the tests.
>
> It may take us closer to Rafael's request for support for building
> modules with an uninstalled perl, ala makemaker.
With this, I still get a couple of test failures; will look into why later.
--- /home/sthoenna/modbuild/Module-Build-0.27_08/lib/Module/Build/Base.pm 2006-03-03 19:27:57.000000000 -0800
+++ Base.pm 2006-03-07 12:26:09.025250000 -0800
@@ -333,8 +333,15 @@
} elsif (defined $exe) {
$thisperl .= $exe unless $thisperl =~ m/$exe$/i;
}
-
- foreach my $perl ( $c->{perlpath},
+
+ my $uninstperl;
+ if ($ENV{PERL_CORE}) {
+ require ExtUtils::CBuilder;
+ $uninstperl = File::Spec->catfile(ExtUtils::CBuilder::->perl_src, $thisperl);
+ }
+
+ foreach my $perl ( $uninstperl || (),
+ $c->{perlpath},
map File::Spec->catfile($_, $thisperl), File::Spec->path()
) {
return $perl if -f $perl and $proto->_perl_is_same($perl);
|