From: Rafael Garcia-Suarez Date: Sat, 21 May 2005 09:18:07 +0000 (+0000) Subject: Update to MakeMaker 6.30 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4325052d2625a06294068527f0d65e6f637a59ee;p=p5sagit%2Fp5-mst-13.2.git Update to MakeMaker 6.30 p4raw-id: //depot/perl@24524 --- diff --git a/lib/ExtUtils/Changes b/lib/ExtUtils/Changes index 60de6f5..af4b84c 100644 --- a/lib/ExtUtils/Changes +++ b/lib/ExtUtils/Changes @@ -1,3 +1,9 @@ +6.30 Fri May 20 16:05:38 PDT 2005 + * PL_FILES behavior tweak again to restore old behavior. Sometimes its + supposed to run before pm_to_blib, sometimes after. + - Some tests shipped with 'no_plan' which will break on older + Test::Harness. + 6.29 Thu May 19 14:15:21 PDT 2005 * The behavior of PL_FILES is restored to its pre-6.26 behavior as several CPAN modules depend on this. PL programs run via PL_FILES have diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index d8f0564..9d792a8 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -20,7 +20,7 @@ use vars qw($VERSION @ISA use ExtUtils::MakeMaker qw($Verbose neatvalue); -$VERSION = '1.49'; +$VERSION = '1.50'; require ExtUtils::MM_Any; @ISA = qw(ExtUtils::MM_Any); @@ -3046,13 +3046,29 @@ sub processPL { $target = vmsify($target); } - $m .= sprintf <<'MAKE_FRAG', ($target) x 2, ($plfile) x 2, $target; + # Normally a .PL file runs AFTER pm_to_blib so it can have + # blib in its @INC and load the just built modules. BUT if + # the generated module is something in $(TO_INST_PM) which + # pm_to_blib depends on then it can't depend on pm_to_blib + # else we have a dependency loop. + my $pm_dep; + my $perlrun; + if( defined $self->{PM}{$target} ) { + $pm_dep = ''; + $perlrun = 'PERLRUN'; + } + else { + $pm_dep = 'pm_to_blib'; + $perlrun = 'PERLRUNINST'; + } -all :: %s - $(NOECHO) $(NOOP) + $m .= < pm_to_blib and include INST_LIB and INST_ARCH -in its C<@INC> so the just built modules can be accessed. +PL files are normally run B pm_to_blib and include INST_LIB and +INST_ARCH in its C<@INC> so the just built modules can be +accessed... unless the PL file is making a module (or anything else in +PM) in which case it is run B pm_to_blib and does not include +INST_LIB and INST_ARCH in its C<@INC>. This apparently odd behavior +is there for backwards compatibility (and its somewhat DWIM). =item PM @@ -2086,7 +2090,7 @@ MakeMaker object. The following lines will be parsed o.k.: $VERSION = '1.00'; *VERSION = \'1.01'; - $VERSION = sprintf "%d.%03d", q$Revision: 4531 $ =~ /(\d+)/g; + $VERSION = sprintf "%d.%03d", q$Revision: 4535 $ =~ /(\d+)/g; $FOO::VERSION = '1.10'; *FOO::VERSION = \'1.11'; our $VERSION = 1.2.3; # new for perl5.6.0 diff --git a/lib/ExtUtils/t/FIRST_MAKEFILE.t b/lib/ExtUtils/t/FIRST_MAKEFILE.t index 320f8af..731dd34 100644 --- a/lib/ExtUtils/t/FIRST_MAKEFILE.t +++ b/lib/ExtUtils/t/FIRST_MAKEFILE.t @@ -1,3 +1,5 @@ +#!/usr/bin/perl -w + BEGIN { if( $ENV{PERL_CORE} ) { chdir 't' if -d 't'; @@ -10,7 +12,7 @@ BEGIN { chdir 't'; use strict; -use Test::More 'no_plan'; +use Test::More tests => 7; use MakeMaker::Test::Setup::BFD; use MakeMaker::Test::Utils; diff --git a/lib/ExtUtils/t/PL_FILES.t b/lib/ExtUtils/t/PL_FILES.t index caf68b6..106fb08 100644 --- a/lib/ExtUtils/t/PL_FILES.t +++ b/lib/ExtUtils/t/PL_FILES.t @@ -12,7 +12,7 @@ BEGIN { chdir 't'; use strict; -use Test::More 'no_plan'; +use Test::More tests => 9; use File::Spec; use MakeMaker::Test::Setup::PL_FILES; @@ -37,6 +37,6 @@ cmp_ok( $?, '==', 0 ); my $make_out = run("$make"); is( $?, 0 ) || diag $make_out; -foreach my $file (qw(single.out 1.out 2.out)) { +foreach my $file (qw(single.out 1.out 2.out blib/lib/PL/Bar.pm)) { ok( -e $file, "$file was created" ); } diff --git a/t/lib/MakeMaker/Test/Setup/PL_FILES.pm b/t/lib/MakeMaker/Test/Setup/PL_FILES.pm index 73b77e3..98cbebd 100644 --- a/t/lib/MakeMaker/Test/Setup/PL_FILES.pm +++ b/t/lib/MakeMaker/Test/Setup/PL_FILES.pm @@ -18,13 +18,22 @@ use ExtUtils::MakeMaker; WriteMakefile( NAME => 'PL_FILES::Module', PL_FILES => { 'single.PL' => 'single.out', - 'multi.PL' => [qw(1.out 2.out)] + 'multi.PL' => [qw(1.out 2.out)], + 'Bar_pm.PL' => '$(INST_LIB)/PL/Bar.pm', } ); END - 'PL_FILES-Module/single.PL' => _gen_pl_files(), - 'PL_FILES-Module/multi.PL' => _gen_pl_files(), + 'PL_FILES-Module/single.PL' => _gen_pl_files(), + 'PL_FILES-Module/multi.PL' => _gen_pl_files(), + 'PL_FILES-Module/Bar_pm.PL' => _gen_pm_files(), + 'PL_FILES-Module/lib/PL/Foo.pm' => <<'END', +# Module to load to ensure PL_FILES have blib in @INC. +package PL::Foo; +sub bar { 42 } +1; +END + ); @@ -32,6 +41,35 @@ sub _gen_pl_files { my $test = <<'END'; #!/usr/bin/perl -w +# Ensure we have blib in @INC +use PL::Foo; +die unless PL::Foo::bar() == 42; + +# Had a bug where PL_FILES weren't sent the file to generate +die "argv empty\n" unless @ARGV; +die "too many in argv: @ARGV\n" unless @ARGV == 1; + +my $file = $ARGV[0]; +open OUT, ">$file" or die $!; + +print OUT "Testing\n"; +close OUT +END + + $test =~ s/^\n//; + + return $test; +} + + +sub _gen_pm_files { + my $test = <<'END'; +#!/usr/bin/perl -w + +# Ensure we do NOT have blib in @INC when building a module +eval { require PL::Foo; }; +#die $@ unless $@ =~ m{^Can't locate PL/Foo.pm in \@INC }; + # Had a bug where PL_FILES weren't sent the file to generate die "argv empty\n" unless @ARGV; die "too many in argv: @ARGV\n" unless @ARGV == 1;