diff --git a/.github/workflows/smoke-macos-xcode11.yml b/.github/workflows/smoke-macos-xcode11.yml index 173e9e62d..401d91210 100644 --- a/.github/workflows/smoke-macos-xcode11.yml +++ b/.github/workflows/smoke-macos-xcode11.yml @@ -30,3 +30,4 @@ jobs: - name: Run Tests run: | make test + make disttest NOECHO= diff --git a/.github/workflows/smoke-ubuntu-linux.yml b/.github/workflows/smoke-ubuntu-linux.yml index 3db61bef5..5261b547c 100644 --- a/.github/workflows/smoke-ubuntu-linux.yml +++ b/.github/workflows/smoke-ubuntu-linux.yml @@ -20,12 +20,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: perl -V - run: perl -V - - name: Makefile.PL - run: perl Makefile.PL - - name: make test - run: make test + - run: perl -V + - run: perl Makefile.PL + - run: make test + - run: make disttest NOECHO= linux: name: "linux ${{ matrix.perl-version }}" @@ -63,10 +61,7 @@ jobs: steps: - uses: actions/checkout@v1 - - name: perl -V - run: perl -V - - name: Makefile.PL - run: perl Makefile.PL - - name: make test - run: make test - + - run: perl -V + - run: perl Makefile.PL + - run: make test + - run: make disttest NOECHO= diff --git a/.github/workflows/smoke-windows-cygwin.yml b/.github/workflows/smoke-windows-cygwin.yml index b22f24951..716bc8029 100644 --- a/.github/workflows/smoke-windows-cygwin.yml +++ b/.github/workflows/smoke-windows-cygwin.yml @@ -48,3 +48,8 @@ jobs: run: | path c:\tools\cygwin\bin;c:\tools\cygwin\usr\bin make test + - name: Run disttest + shell: cmd + run: | + path c:\tools\cygwin\bin;c:\tools\cygwin\usr\bin + make disttest NOECHO= diff --git a/.github/workflows/smoke-windows-strawberryperl.yml b/.github/workflows/smoke-windows-strawberryperl.yml index 6c51de82f..2f061c206 100644 --- a/.github/workflows/smoke-windows-strawberryperl.yml +++ b/.github/workflows/smoke-windows-strawberryperl.yml @@ -45,3 +45,8 @@ jobs: run: | path C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;%PATH% gmake test + - name: Run disttest + shell: cmd + run: | + path C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;%PATH% + gmake disttest NOECHO= diff --git a/lib/ExtUtils/MM_Any.pm b/lib/ExtUtils/MM_Any.pm index 77454fa64..7b79a70a8 100644 --- a/lib/ExtUtils/MM_Any.pm +++ b/lib/ExtUtils/MM_Any.pm @@ -874,7 +874,7 @@ create_distdir : $(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \ -e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');" -distdir : create_distdir %s %s +distdir : %s %s $(NOECHO) $(NOOP) MAKE_FRAG @@ -1037,7 +1037,7 @@ sub dynamic { my($self) = shift; ' -dynamic :: $(FIRST_MAKEFILE) config $(INST_BOOT) $(INST_DYNAMIC) +dynamic :: config $(INST_BOOT) $(INST_DYNAMIC) $(NOECHO) $(NOOP) '; } @@ -1075,17 +1075,8 @@ all POD files in MAN1PODS and MAN3PODS. sub manifypods_target { my($self) = shift; - my $man1pods = ''; - my $man3pods = ''; - my $dependencies = ''; - - # populate manXpods & dependencies: - foreach my $name (sort keys %{$self->{MAN1PODS}}, sort keys %{$self->{MAN3PODS}}) { - $dependencies .= " \\\n\t$name"; - } - my $manify = <cd('$(DISTVNAME)', $_) } @add_meta; return sprintf <<'MAKE', @add_meta_to_distdir; -distmeta : create_distdir metafile +distmeta : metafile $(NOECHO) %s $(NOECHO) %s diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index b7be59e76..ee9872ef0 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -762,7 +762,7 @@ print 'Warning: Makefile possibly out of date with $(VERSION_FROM)' CODE return sprintf <<'MAKE_FRAG', $date_check; -dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE) +dist : $(DIST_DEFAULT) config $(NOECHO) %s MAKE_FRAG } @@ -941,7 +941,7 @@ sub _xs_make_bs { # As Mkbootstrap might not write a file (if none is required) # we use touch to prevent make continually trying to remake it. # The DynaLoader only reads a non-empty file. -%1$s.bs : $(FIRST_MAKEFILE) $(BOOTDEP) +%1$s.bs : config $(BOOTDEP) $(NOECHO) $(ECHO) "Running Mkbootstrap for %1$s ($(BSLOADLIBS))" $(NOECHO) $(PERLRUN) \ "-MExtUtils::Mkbootstrap" \ @@ -2489,7 +2489,7 @@ realclean :: for my $from (@froms) { # 1 2 push @m, _sprintf562 <<'MAKE', $from, $fromto{$from}; -%2$s : %1$s $(FIRST_MAKEFILE) $(INST_SCRIPT)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists +%2$s : %1$s config $(NOECHO) $(RM_F) %2$s $(CP) %1$s %2$s $(FIXIN) %2$s @@ -2590,7 +2590,7 @@ MAP_PERLINC = @{$perlinc || []} $(MAP_TARGET) :: $(MAKE_APERL_FILE) $(MAKE) $(USEMAKEFILE) $(MAKE_APERL_FILE) $@ -$(MAKE_APERL_FILE) : static $(FIRST_MAKEFILE) pm_to_blib +$(MAKE_APERL_FILE) : static pm_to_blib $(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET) $(NOECHO) $(PERLRUNINST) \ Makefile.PL DIR="}, $dir, q{" \ @@ -3170,7 +3170,7 @@ sub pm_to_blib { my $self = shift; my($autodir) = $self->catdir('$(INST_LIB)','auto'); my $r = q{ -pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM) +pm_to_blib : config $(TO_INST_PM) }; # VMS will swallow '' and PM_FILTER is often empty. So use q[] @@ -3581,7 +3581,7 @@ sub static { ' ## $(INST_PM) has been moved to the all: target. ## It remains here for awhile to allow for old usage: "make static" -static :: $(FIRST_MAKEFILE) $(INST_STATIC) +static :: config $(INST_STATIC) $(NOECHO) $(NOOP) '; } @@ -3989,7 +3989,7 @@ sub top_targets { push @m, $self->all_target, "\n" unless $self->{SKIPHASH}{'all'}; push @m, sprintf <<'EOF'; -pure_all :: config pm_to_blib subdirs linkext +pure_all :: pm_to_blib subdirs linkext $(NOECHO) $(NOOP) subdirs :: $(MYEXTLIB) diff --git a/t/basic.t b/t/basic.t index a93700693..faf40f039 100644 --- a/t/basic.t +++ b/t/basic.t @@ -25,7 +25,7 @@ use ExtUtils::MM; use Test::More !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'} ? (skip_all => "cross-compiling and make not available") - : (tests => 188); + : (tests => 195); use File::Find; use File::Spec; use File::Path; @@ -186,64 +186,48 @@ open $fh, '>', $makefile; print $fh $mtext; close $fh; -my $install_out = run("$make install"); -is( $?, 0, 'install' ) || diag $install_out; -like( $install_out, qr/^Installing /m ); - sub check_dummy_inst { - my ($loc, $skipsubdir) = @_; - my %files = (); - find( sub { - # do it case-insensitive for non-case preserving OSs - my $file = lc $_; - # VMS likes to put dots on the end of things that don't have them. - $file =~ s/\.$// if $Is_VMS; - $files{$file} = $File::Find::name; - }, $loc ); - ok( $files{'dummy.pm'}, ' Dummy.pm installed' ); - ok( $files{'liar.pm'}, ' Liar.pm installed' ) unless $skipsubdir; - ok( $files{'program'}, ' program installed' ); - ok( $files{'.packlist'}, ' packlist created' ); - ok( $files{'perllocal.pod'},' perllocal.pod created' ); + my ($loc, $install_args, $label, $skipsubdir) = @_; + my %files; + SKIP: { + my $install_out = run("$make install NOECHO= $install_args"); + is( $?, 0, "install $label" ) || diag $install_out; + like( $install_out, qr/^Installing /m, "/Installing/ $label" ); + ok( -r $loc, "$label install dir created" ) + or skip "$loc doesn't exist", 5; + find( sub { + # do it case-insensitive for non-case preserving OSs + my $file = lc $_; + # VMS likes to put dots on the end of things that don't have them. + $file =~ s/\.$// if $Is_VMS; + $files{$file} = $File::Find::name; + }, $loc ); + ok( $files{'dummy.pm'}, " Dummy.pm installed $label" ); + if ($skipsubdir) { ok 1 } else { + ok( $files{'liar.pm'}, " Liar.pm installed $label" ); + } + ok( $files{'program'}, " program installed $label" ); + ok( $files{'.packlist'}, " packlist created $label" ); + ok( $files{'perllocal.pod'}," perllocal.pod created $label" ); + } \%files; } -SKIP: { - ok( -r $DUMMYINST, ' install dir created' ) - or skip "$DUMMYINST doesn't exist", 5; - check_dummy_inst($DUMMYINST); -} +check_dummy_inst($DUMMYINST, '', 'Module::Install style'); SKIP: { skip 'VMS install targets do not preserve $(PREFIX)', 8 if $Is_VMS; - - $install_out = run("$make install PREFIX=elsewhere"); - is( $?, 0, 'install with PREFIX override' ) || diag $install_out; - like( $install_out, qr/^Installing /m ); - - ok( -r 'elsewhere', ' install dir created' ); - check_dummy_inst('elsewhere'); + check_dummy_inst('elsewhere', "PREFIX=elsewhere", 'with PREFIX'); rmtree('elsewhere'); } - SKIP: { skip 'VMS install targets do not preserve $(DESTDIR)', 10 if $Is_VMS; - - $install_out = run("$make install PREFIX= DESTDIR=other"); - is( $?, 0, 'install with DESTDIR' ) || - diag $install_out; - like( $install_out, qr/^Installing /m ); - - ok( -d 'other', ' destdir created' ); - my $files = check_dummy_inst('other'); - - ok( open(PERLLOCAL, $files->{'perllocal.pod'} ) ) || - diag("Can't open $files->{'perllocal.pod'}: $!"); - { local $/; - unlike(, qr/other/, 'DESTDIR should not appear in perllocal'); - } - close PERLLOCAL; + my $files = check_dummy_inst('other', 'PREFIX= DESTDIR=other', 'with DESTDIR'); + eval { + unlike slurp($files->{'perllocal.pod'}), qr/other/, 'DESTDIR should not appear in perllocal'; 1 + } or fail "error in slurp: $@"; + is $@, ''; # TODO not available in the min version of Test::Harness we require # ok( open(PACKLIST, $files{'.packlist'} ) ) || @@ -257,18 +241,10 @@ SKIP: { rmtree('other'); } - SKIP: { skip 'VMS install targets do not preserve $(PREFIX)', 9 if $Is_VMS; - - $install_out = run("$make install PREFIX=elsewhere DESTDIR=other/"); - is( $?, 0, 'install with PREFIX override and DESTDIR' ) || - diag $install_out; - like( $install_out, qr/^Installing /m ); - + check_dummy_inst('other/elsewhere', 'PREFIX=elsewhere DESTDIR=other/', 'PREFIX override and DESTDIR'); ok( !-d 'elsewhere', ' install dir not created' ); - ok( -d 'other/elsewhere', ' destdir created' ); - check_dummy_inst('other/elsewhere'); rmtree('other'); } @@ -491,18 +467,15 @@ close $fh; # now do with "Liar" subdir still there rmtree $DUMMYINST; # so no false positive from before @mpl_out = run(qq{$perl Makefile.PL "PREFIX=$DUMMYINST"}); -$install_out = run("$make install"); -check_dummy_inst($DUMMYINST); +check_dummy_inst($DUMMYINST, '', "with PREFIX=$DUMMYINST"); # now clean, delete "Liar" subdir, do again $realclean_out = run("$make realclean"); rmtree 'Liar'; rmtree $DUMMYINST; # so no false positive from before @mpl_out = run(qq{$perl Makefile.PL "PREFIX=$DUMMYINST"}); -$install_out = run("$make install"); -check_dummy_inst($DUMMYINST, 1); +check_dummy_inst($DUMMYINST, '', "with PREFIX=$DUMMYINST minus subdir", 1); sub _normalize { my $hash = shift; - %$hash= map { lc($_) => $hash->{$_} } keys %$hash; }