Thread: [Module::Build] Re: [PATCH] add Module::Build 0.27_08
Status: Beta
Brought to you by:
kwilliams
|
From: Randy W. S. <ml...@th...> - 2006-03-07 11:39:58
|
Dominic Dunlop wrote:
> On 2006–03–06, at 17:12, Rafael Garcia-Suarez wrote:
>
>> Yitzchak Scott-Thoennes wrote:
>>
>>> Patch to integrate Module::Build 0.27_08 to the core,
>>> Craig's initial changes for VMS are included.
>>>
>>> I'd appreciate it if folks give it a spin (which might be facilitated
>>> by having it applied...).
>>
>>
>> Thanks, applied as #27389. (thanks for the nice, clean patch BTW.)
>> Let's see how it turns...
>
>
> Eek! Not well. 1,117 lines of complaints from make test on blead
> attached. The perl that produced them:
Looks like the problem happens here:
sub find_perl_interpreter {
return $^X if File::Spec->file_name_is_absolute($^X);
my $proto = shift;
my $c = ref($proto) ? $proto->config : \%Config::Config;
my $exe = $c->{exe_ext};
my $thisperl = $^X;
if ($proto->os_type eq 'VMS') {
# VMS might have a file version at the end
$thisperl .= $exe unless $thisperl =~ m/$exe(;\d+)?$/i;
} elsif (defined $exe) {
$thisperl .= $exe unless $thisperl =~ m/$exe$/i;
}
foreach my $perl ( $c->{perlpath},
map File::Spec->catfile($_, $thisperl), File::Spec->path()
) {
return $perl if -f $perl and $proto->_perl_is_same($perl);
}
return;
}
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?
BTW, _perl_is_same() just looks like:
sub _perl_is_same {
my ($self, $perl) = @_;
return `$perl -MConfig=myconfig -e print -e myconfig` eq
Config->myconfig;
}
Randy.
|
|
From: Yitzchak Scott-T. <sth...@ef...> - 2006-03-07 17:04:21
|
On Tue, Mar 07, 2006 at 12:35:13PM +0100, Dominic Dunlop wrote:
> On 2006?03?07, at 12:28, Rafael Garcia-Suarez wrote:
>
> >Dominic Dunlop wrote:
> >>lib/Module/Build/t/basic...................................Perl
> >>lib version (5.9.4) doesn't match executable version (v5.8.6) at /
> >>Volumes/Tottie/Other/src/Perl/perl-current-working/lib/Config.pm
> >>line 46.
> >
> >That pretty much sums up the problem, the test thinks
> >it should use the system's perl instead of the currently
> >built one.
> >
> >(I don't know why, it works here)
>
> Shooting in the dark: I'm building on a case-preserving but case-
> ignoring filesystem.
Does this help:
--- 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);
End of Patch.
(Question for module-build-general only: why is absolute $^X exempt from
the _perl_is_same check?)
|
|
From: Dominic D. <sho...@ma...> - 2006-03-07 18:59:09
|
Sorry for the absence.
On 2006=9603=9607, at 18:04, Yitzchak Scott-Thoennes wrote:
> Does this help:
>
> --- 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 .=3D $exe unless $thisperl =3D~ 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);
> End of Patch.
I think this has been overtaken by events, but no, it doesn't:
$ ./TEST ../lib/Module/Build/t/basic.t
t/../lib/Module/Build/t/basic....Warning: Removing existing directory =20=
'/Volumes/Tottie/Other/src/Perl/perl-current-working/t/_tmp/Simple'
Use of uninitialized value $_ in concatenation (.) or string at /=20
Volumes/Tottie/Other/src/Perl/perl-current-working/t/../lib/Module/=20
Build/Base.pm line 341.
Use of uninitialized value in warn at /Volumes/Tottie/Other/src/Perl/=20
perl-current-working/t/../lib/Module/Build/Base.pm line 341.
checking in , $^X is ./perl, perl is /Volumes/Tottie/Other/src/Perl/=20
perl-current-working/t/_tmp/Simple/perl, -f $perl is at /Volumes/=20
Tottie/Other/src/Perl/perl-current-working/t/../lib/Module/Build/=20
Base.pm line 341.
Use of uninitialized value $_ in concatenation (.) or string at /=20
Volumes/Tottie/Other/src/Perl/perl-current-working/t/../lib/Module/=20
Build/Base.pm line 341.
Use of uninitialized value in warn at /Volumes/Tottie/Other/src/Perl/=20
perl-current-working/t/../lib/Module/Build/Base.pm line 341.
checking in , $^X is ./perl, perl is /usr/local/bin/perl5.9.4, -f =20
$perl is at /Volumes/Tottie/Other/src/Perl/perl-current-working/t/../=20=
lib/Module/Build/Base.pm line 341.
...
--=20
Dominic Dunlop
|
|
From: Yitzchak Scott-T. <sth...@ef...> - 2006-03-07 19:39:49
|
On Tue, Mar 07, 2006 at 07:58:59PM +0100, Dominic Dunlop wrote:
> Sorry for the absence.
>
> On 2006?03?07, at 18:04, Yitzchak Scott-Thoennes wrote:
>
> >Does this help:
> >
> >--- 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);
> >End of Patch.
>
> I think this has been overtaken by events, but no, it doesn't:
Hmm, is $c->{properties}{perl} set correctly at this point?
|
|
From: Yitzchak Scott-T. <sth...@ef...> - 2006-03-07 20:15:33
|
On Tue, Mar 07, 2006 at 11:34:27AM -0800, Yitzchak Scott-Thoennes wrote:
> On Tue, Mar 07, 2006 at 07:58:59PM +0100, Dominic Dunlop wrote:
> > Sorry for the absence.
> >
> > On 2006?03?07, at 18:04, Yitzchak Scott-Thoennes wrote:
> >
> > >Does this help:
> > >
> > >--- 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);
> > >End of Patch.
> >
> > I think this has been overtaken by events, but no, it doesn't:
>
> Hmm, is $c->{properties}{perl} set correctly at this point?
I meant $proto->{properties}{perl}. But no, it isn't. (I'm testing
now with a perl that always sets $^X to "./perl", and without an
installed perl5.9.4 :).
|
|
From: Dominic D. <sho...@ma...> - 2006-03-08 08:38:44
|
On 2006=9603=9607, at 20:34, Yitzchak Scott-Thoennes wrote:
> On Tue, Mar 07, 2006 at 07:58:59PM +0100, Dominic Dunlop wrote:
>> Sorry for the absence.
>>
>> On 2006?03?07, at 18:04, Yitzchak Scott-Thoennes wrote:
>>
>>> Does this help:
>>>
>>> --- lib/Module/Build/Base.pm.orig 2006-03-06 07:43:57.093750000 =20=
>>> -0800
>>> +++ lib/Module/Build/Base.pm 2006-03-07 09:00:28.884844800 =
-0800
>>> @@ -334,7 +334,8 @@
>>> $thisperl .=3D $exe unless $thisperl =3D~ 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);
>>> End of Patch.
>>
>> I think this has been overtaken by events, but no, it doesn't:
>
> Hmm, is $c->{properties}{perl} set correctly at this point?
No.
With this debugging line
warn "Checking $perl: \$^X is $^X, \$c->{properties}{perl} is $c-=20=
>{properties}{perl}, -f \$perl is ", -f $perl;
I get
$ ./TEST ../lib/Module/Build/t/basic.t
t/../lib/Module/Build/t/basic....Warning: Removing existing directory =20=
'/Volumes/Tottie/Other/src/Perl/perl-current-working/t/_tmp/Simple'
Use of uninitialized value in concatenation (.) or string at /Volumes/=20=
Tottie/Other/src/Perl/perl-current-working/t/../lib/Module/Build/=20
Base.pm line 341.
Use of uninitialized value in warn at /Volumes/Tottie/Other/src/Perl/=20
perl-current-working/t/../lib/Module/Build/Base.pm line 341.
Checking /Volumes/Tottie/Other/src/Perl/perl-current-working/t/_tmp/=20
Simple/perl: $^X is ./perl, $c->{properties}{perl} is , -f $perl is =20
at /Volumes/Tottie/Other/src/Perl/perl-current-working/t/../lib/=20
Module/Build/Base.pm line 341.
Use of uninitialized value in concatenation (.) or string at /Volumes/=20=
Tottie/Other/src/Perl/perl-current-working/t/../lib/Module/Build/=20
Base.pm line 341.
Use of uninitialized value in warn at /Volumes/Tottie/Other/src/Perl/=20
perl-current-working/t/../lib/Module/Build/Base.pm line 341.
Checking /usr/local/bin/perl5.9.4: $^X is ./perl, $c->{properties}=20
{perl} is , -f $perl is at /Volumes/Tottie/Other/src/Perl/perl-=20
current-working/t/../lib/Module/Build/Base.pm line 341.
Use of uninitialized value in concatenation (.) or string at /Volumes/=20=
Tottie/Other/src/Perl/perl-current-working/t/../lib/Module/Build/=20
Base.pm line 341.
Use of uninitialized value in warn at /Volumes/Tottie/Other/src/Perl/=20
perl-current-working/t/../lib/Module/Build/Base.pm line 341.
Checking /Users/domo/bin/perl: $^X is ./perl, $c->{properties}{perl} =20
is , -f $perl is at /Volumes/Tottie/Other/src/Perl/perl-current-=20
working/t/../lib/Module/Build/Base.pm line 341.
Use of uninitialized value in concatenation (.) or string at /Volumes/=20=
Tottie/Other/src/Perl/perl-current-working/t/../lib/Module/Build/=20
Base.pm line 341.
Use of uninitialized value in warn at /Volumes/Tottie/Other/src/Perl/=20
perl-current-working/t/../lib/Module/Build/Base.pm line 341.
and so on.
--=20
Dominic Dunlop
|
|
From: Ken W. <ke...@ma...> - 2006-03-07 19:33:27
|
On Mar 7, 2006, at 11:04 AM, Yitzchak Scott-Thoennes wrote: > > (Question for module-build-general only: why is absolute $^X exempt > from > the _perl_is_same check?) It probably shouldn't be. -Ken |
|
From: Yitzchak Scott-T. <sth...@ef...> - 2006-03-07 15:24:27
|
On Tue, Mar 07, 2006 at 06:38:13AM -0500, Randy W. Sims wrote:
> Dominic Dunlop wrote:
> >On 2006?03?06, at 17:12, Rafael Garcia-Suarez wrote:
> >
> >>Yitzchak Scott-Thoennes wrote:
> >>
> >>>Patch to integrate Module::Build 0.27_08 to the core,
> >>>Craig's initial changes for VMS are included.
> >>>
> >>>I'd appreciate it if folks give it a spin (which might be facilitated
> >>>by having it applied...).
> >>
> >>
> >>Thanks, applied as #27389. (thanks for the nice, clean patch BTW.)
> >>Let's see how it turns...
> >
> >
> >Eek! Not well. 1,117 lines of complaints from make test on blead
> >attached. The perl that produced them:
>
> Looks like the problem happens here:
>
> sub find_perl_interpreter {
> return $^X if File::Spec->file_name_is_absolute($^X);
> my $proto = shift;
> my $c = ref($proto) ? $proto->config : \%Config::Config;
> my $exe = $c->{exe_ext};
>
> my $thisperl = $^X;
> if ($proto->os_type eq 'VMS') {
> # VMS might have a file version at the end
> $thisperl .= $exe unless $thisperl =~ m/$exe(;\d+)?$/i;
> } elsif (defined $exe) {
> $thisperl .= $exe unless $thisperl =~ m/$exe$/i;
> }
>
> foreach my $perl ( $c->{perlpath},
> map File::Spec->catfile($_, $thisperl),
> File::Spec->path()
> ) {
> return $perl if -f $perl and $proto->_perl_is_same($perl);
> }
> return;
> }
>
> 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;
at the beginning of the loop and a
warn "not found"
at the end?
On darwin, is $^X just the filename, or is it a relative path?
> BTW, _perl_is_same() just looks like:
>
> sub _perl_is_same {
> my ($self, $perl) = @_;
> return `$perl -MConfig=myconfig -e print -e myconfig` eq
> Config->myconfig;
> }
>
> Randy.
|
|
From: Dominic D. <sho...@ma...> - 2006-03-07 16:37:24
|
Before I reply, another data point:
$ echo $PWD
/Users/domo/src/Perl/perl-current-working/t
$ /bin/pwd
/Volumes/Tottie/Other/src/Perl/perl-current-working/t
That is, there's a symlink in the path to my build directory. No idea =20=
whether this is relevant.
On 2006=9603=9607, 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 =20
>> 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 ", =20=
> -f $perl;
^^
Um, the $_ that is the topic of the map() is out of scope at the top =20
of the loop, and there doesn't seem to be another relevant one in =20
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
$ ./TEST ../lib/Module/Build/t/basic.t
t/../lib/Module/Build/t/basic....Warning: Removing existing directory =20=
'/Volumes/Tottie/Other/src/Perl/perl-current-working/t/_tmp/Simple'
Use of uninitialized value $_ in concatenation (.) or string at /=20
Volumes/Tottie/Other/src/Perl/perl-current-working/t/../lib/Module/=20
Build/Base.pm line 340.
Use of uninitialized value in warn at /Volumes/Tottie/Other/src/Perl/=20
perl-current-working/t/../lib/Module/Build/Base.pm line 340.
checking in , $^X is ./perl, perl is /usr/local/bin/perl5.9.4, -f =20
$perl is at /Volumes/Tottie/Other/src/Perl/perl-current-working/t/../=20=
lib/Module/Build/Base.pm line 340.
Use of uninitialized value $_ in concatenation (.) or string at /=20
Volumes/Tottie/Other/src/Perl/perl-current-working/t/../lib/Module/=20
Build/Base.pm line 340.
Use of uninitialized value in warn at /Volumes/Tottie/Other/src/Perl/=20
perl-current-working/t/../lib/Module/Build/Base.pm line 340.
checking in , $^X is ./perl, perl is /Users/domo/bin/perl, -f $perl =20
is at /Volumes/Tottie/Other/src/Perl/perl-current-working/t/../lib/=20
Module/Build/Base.pm line 340.
Use of uninitialized value $_ in concatenation (.) or string at /=20
Volumes/Tottie/Other/src/Perl/perl-current-working/t/../lib/Module/=20
Build/Base.pm line 340.
Use of uninitialized value in warn at /Volumes/Tottie/Other/src/Perl/=20
perl-current-working/t/../lib/Module/Build/Base.pm line 340.
checking in , $^X is ./perl, perl is /usr/local/bin/perl, -f $perl =20
is at /Volumes/Tottie/Other/src/Perl/perl-current-working/t/../lib/=20
Module/Build/Base.pm line 340.
Use of uninitialized value $_ in concatenation (.) or string at /=20
Volumes/Tottie/Other/src/Perl/perl-current-working/t/../lib/Module/=20
Build/Base.pm line 340.
Use of uninitialized value in warn at /Volumes/Tottie/Other/src/Perl/=20
perl-current-working/t/../lib/Module/Build/Base.pm line 340.
checking in , $^X is ./perl, perl is /bin/perl, -f $perl is at /=20
Volumes/Tottie/Other/src/Perl/perl-current-working/t/../lib/Module/=20
Build/Base.pm line 340.
Use of uninitialized value $_ in concatenation (.) or string at /=20
Volumes/Tottie/Other/src/Perl/perl-current-working/t/../lib/Module/=20
Build/Base.pm line 340.
Use of uninitialized value in warn at /Volumes/Tottie/Other/src/Perl/=20
perl-current-working/t/../lib/Module/Build/Base.pm line 340.
checking in , $^X is ./perl, perl is /sbin/perl, -f $perl is at /=20
Volumes/Tottie/Other/src/Perl/perl-current-working/t/../lib/Module/=20
Build/Base.pm line 340.
Use of uninitialized value $_ in concatenation (.) or string at /=20
Volumes/Tottie/Other/src/Perl/perl-current-working/t/../lib/Module/=20
Build/Base.pm line 340.
checking in , $^X is ./perl, perl is /usr/bin/perl, -f $perl is 1 at /=20=
Volumes/Tottie/Other/src/Perl/perl-current-working/t/../lib/Module/=20
Build/Base.pm line 340.
Perl lib version (5.9.4) doesn't match executable version (v5.8.6) =20
at /Volumes/Tottie/Other/src/Perl/perl-current-working/lib/Config.pm =20
line 46.
Compilation failed in require.
BEGIN failed--compilation aborted.
...
I can't immediately see wtf is happening (or failing to happen).
>
> On darwin, is $^X just the filename, or is it a relative path?
Seems to be what's in argv[0]:
$ perl -lwe 'print $^X'
perl
$ /usr/bin/perl -lwe 'print $^X'
/usr/bin/perl
$ ../../../../../usr/bin/perl -lwe 'print $^X'
../../../../../usr/bin/perl
That's with the system's perl-5.8.6, but blead's the same.
Another data point:
$ echo $PWD
/Users/domo/src/Perl/perl-current-working/t
$ /bin/pwd
/Volumes/Tottie/Other/src/Perl/perl-current-working/t
That is, there's a symlink in the path to my build directory
--=20
Dominic Dunlop
|
|
From: Yitzchak Scott-T. <sth...@ef...> - 2006-03-07 16:43:19
|
On Tue, Mar 07, 2006 at 05:36:45PM +0100, Dominic Dunlop wrote: > > 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... Sorry, I meant $perl (which I already included :( ). |
|
From: Randy W. S. <ml...@th...> - 2006-03-07 17:00:26
|
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?
Randy.
|
|
From: Yitzchak Scott-T. <sth...@ef...> - 2006-03-07 17:06:57
|
On Tue, Mar 07, 2006 at 11:59:17AM -0500, Randy W. Sims wrote: > 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? > > Randy. It looks like find_perl_interpreter is supposed to return an absolute path, so my similar suggestion does that. Do you know how the return value is used? |
|
From: Randy W. S. <ml...@th...> - 2006-03-07 17:47:32
|
Yitzchak Scott-Thoennes wrote: > On Tue, Mar 07, 2006 at 11:59:17AM -0500, Randy W. Sims wrote: > >>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? >> >>Randy. > > > It looks like find_perl_interpreter is supposed to return an absolute > path, so my similar suggestion does that. Do you know how the return > value is used? The $perl returned from find_perl_interpreter() ? It's used in a number of places: When you run Build.PL, it's stored so that invokations of ./Build use the same $perl. If you run Build.PL and the /some/perl Build it checks if it's the same perl, ala the _perl_is_same() method. It's used when running self-expanding files (or whatever they're called), eg 'My-Distro/lib/My/Distro.pm.PL' It's used to grab the default, unaltered @INC (@inc = `$perl -le "print for \@INC"`) Workaround a Test::Harness bug that "loses the correct perl we're running under" *** I /think/ I see several possible problems here *** fix_shebang_line() # adapted from MakeMaker Anything that calls run_perl_script(), eg ./Build disttest emulates a user running through the build process. Running xsubpp, when ExtUtils::ParseXS is not installed. run_perl_script & run_perl_command are used several times in various tests. Oh, did you want a thorough answer? Randy. |
|
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);
|
|
From: Andy D. <dou...@la...> - 2006-03-07 17:56:51
|
On Tue, 7 Mar 2006, Yitzchak Scott-Thoennes wrote:
> 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?
> > > 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.
You can add Solaris to that list. It's also getting $^X=./perl,
and then failing to find it in .../t/_tmp/Simple/perl . Failing that, it
then looks through $ENV{PATH} where it might (or might not) find some
other perl that might (or might not) run the test successfully.
> 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.
--
Andy Dougherty dou...@la...
|
|
From: Ken W. <ke...@ma...> - 2006-03-07 19:33:08
|
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.
-Ken
|
|
From: Andy D. <dou...@la...> - 2006-03-07 19:45:26
|
On Tue, 7 Mar 2006, 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.\
No, in this case, $^X is './perl', where the '.' is perl's t/ directory.
This is the same as Dominic's reported on OSX. The make test target does
the equivalent of
cd t; ./perl harness
So we don't have to go searching PATH -- we just have to remember where we
started. Apparently there's a chdir() in there somewhere.
--
Andy Dougherty dou...@la...
|
|
From: Yitzchak Scott-T. <sth...@ef...> - 2006-03-07 19:59:00
|
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().
|
|
From: Randy W. S. <ml...@th...> - 2006-03-07 20:12:00
|
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.
|
|
From: Yitzchak Scott-T. <sth...@ef...> - 2006-03-07 20:25:18
|
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.
|
|
From: Randy W. S. <ml...@th...> - 2006-03-07 20:38:55
|
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:
>>>
>>>>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.
>
Yeah, I've got that message flagged for follow-up. I guess I was
thinking there may be more context for determining the correct perl from
the test script side.
Unfortunately, I don't have a broken system to test on so I'm mostly
guessing. I do have an old 633 Mhz Pentium PC laying around somewhere
that I can install one of the BSD variant on tonight or tomorrow.
Randy.
|
|
From: Dominic D. <sho...@ma...> - 2006-03-08 08:50:15
|
On 2006=9603=9607, at 21:37, Randy W. Sims wrote: > Unfortunately, I don't have a broken system to test on so I'm =20 > mostly guessing. I do have an old 633 Mhz Pentium PC laying around =20 > somewhere that I can install one of the BSD variant on tonight or =20 > tomorrow. That looks like the way to go, as I can't guarantee to respond =20 quickly when asked to run tests -- and I don't know the code anyway. =20 Good luck with that install. Alternatively, does anybody on the M::B =20 list have a Mac with some version of Mac OS X on it lying around? --=20 Dominic Dunlop |
|
From: Ken W. <ke...@ma...> - 2006-03-09 01:24:20
|
On Mar 8, 2006, at 2:50 AM, Dominic Dunlop wrote: > On 2006=9603=9607, at 21:37, Randy W. Sims wrote: > >> Unfortunately, I don't have a broken system to test on so I'm =20 >> mostly guessing. I do have an old 633 Mhz Pentium PC laying around =20= >> somewhere that I can install one of the BSD variant on tonight or =20 >> tomorrow. > > That looks like the way to go, as I can't guarantee to respond =20 > quickly when asked to run tests -- and I don't know the code =20 > anyway. Good luck with that install. Alternatively, does anybody on =20= > the M::B list have a Mac with some version of Mac OS X on it lying =20 > around? My main machine (powerbook) runs OS X 10.4.something. Obviously =20 M::B's tests pass for me in its standalone distro, I'll try testing =20 blead. Right now blead is failing to build for me though, because =20 it's missing a constants.xs file for Compress::Zlib or something. =20 I'll try to get creative with symlinks. -Ken |
|
From: Randy W. S. <ml...@th...> - 2006-03-09 01:30:47
|
Ken Williams wrote:
>
> On Mar 8, 2006, at 2:50 AM, Dominic Dunlop wrote:
>
>> On 2006–03–07, at 21:37, Randy W. Sims wrote:
>>
>>> Unfortunately, I don't have a broken system to test on so I'm mostly
>>> guessing. I do have an old 633 Mhz Pentium PC laying around somewhere
>>> that I can install one of the BSD variant on tonight or tomorrow.
>>
>> That looks like the way to go, as I can't guarantee to respond quickly
>> when asked to run tests -- and I don't know the code anyway. Good luck
>> with that install. Alternatively, does anybody on the M::B list have a
>> Mac with some version of Mac OS X on it lying around?
>
> My main machine (powerbook) runs OS X 10.4.something. Obviously M::B's
> tests pass for me in its standalone distro, I'll try testing blead.
> Right now blead is failing to build for me though, because it's missing
> a constants.xs file for Compress::Zlib or something. I'll try to get
> creative with symlinks.
Note, I get this same error running blead on Windows XP. But it runs
fine on Ubuntu Linux. I got FreeBSD installed on an old computer at
home, but still have some work configuring and pulling down blead to
test. I've not taken the time to look into this.
Randy.
..\..\..\miniperl.exe "-I..\..\..\lib" "-I..\..\..\lib"
..\..\..\lib\Ext
Utils\xsubpp -typemap ..\..\..\lib\ExtUtils\typemap -typemap typemap
Zlib.xs >
Zlib.xsc && C:\home\randys\src\perl-current\miniperl.exe
"-I..\..\..\lib" "-I..
\..\..\lib" -MExtUtils::Command -e mv Zlib.xsc Zlib.c
Cannot open 'constants.xs': No such file or directory in Zlib.xs, line 698
NMAKE : fatal error U1077: '..\..\..\miniperl.exe' : return code '0x1'
Stop.
Unsuccessful make(Compress/Zlib): code=512 at buildext.pl line 142.
NMAKE : fatal error U1077: '..\miniperl.exe' : return code '0x2'
Stop.
|
|
From: Paul M. <pau...@nt...> - 2006-03-09 09:53:59
|
From: Randy W. Sims [mailto:ml...@th...] > Ken Williams wrote: > > > > On Mar 8, 2006, at 2:50 AM, Dominic Dunlop wrote: > > > >> On 2006-03-07, at 21:37, Randy W. Sims wrote: > >> > >>> Unfortunately, I don't have a broken system to test on so I'm mostly > >>> guessing. I do have an old 633 Mhz Pentium PC laying around somewhere > >>> that I can install one of the BSD variant on tonight or tomorrow. > >> > >> That looks like the way to go, as I can't guarantee to respond quickly > >> when asked to run tests -- and I don't know the code anyway. Good luck > >> with that install. Alternatively, does anybody on the M::B list have a > >> Mac with some version of Mac OS X on it lying around? > > > > My main machine (powerbook) runs OS X 10.4.something. Obviously M::B's > > tests pass for me in its standalone distro, I'll try testing blead. > > Right now blead is failing to build for me though, because it's missing > > a constants.xs file for Compress::Zlib or something. I'll try to get > > creative with symlinks. > > Note, I get this same error running blead on Windows XP. But it runs > fine on Ubuntu Linux. I got FreeBSD installed on an old computer at > home, but still have some work configuring and pulling down blead to > test. I've not taken the time to look into this. > > Randy. > > > ..\..\..\miniperl.exe "-I..\..\..\lib" "-I..\..\..\lib" > ..\..\..\lib\Ext > Utils\xsubpp -typemap ..\..\..\lib\ExtUtils\typemap -typemap typemap > Zlib.xs > > Zlib.xsc && C:\home\randys\src\perl-current\miniperl.exe > "-I..\..\..\lib" "-I.. > \..\..\lib" -MExtUtils::Command -e mv Zlib.xsc Zlib.c > Cannot open 'constants.xs': No such file or directory in Zlib.xs, line 698 > NMAKE : fatal error U1077: '..\..\..\miniperl.exe' : return code '0x1' > Stop. > Unsuccessful make(Compress/Zlib): code=512 at buildext.pl line 142. > NMAKE : fatal error U1077: '..\miniperl.exe' : return code '0x2' > Stop. The patch to C::Z earlier this week moved a pile of files around. If you didn't specify the "--delete" option when you rsync the blead you end up with multiple copies of some of these files. For what it's worth, I was bitten by this one myself. Paul ___________________________________________________________ Yahoo! Photos NEW, now offering a quality print service from just 8p a photo http://uk.photos.yahoo.com |