Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/smoke-macos-xcode11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ jobs:
- name: Run Tests
run: |
make test
make disttest NOECHO=
21 changes: 8 additions & 13 deletions .github/workflows/smoke-ubuntu-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down Expand Up @@ -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=
5 changes: 5 additions & 0 deletions .github/workflows/smoke-windows-cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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=
5 changes: 5 additions & 0 deletions .github/workflows/smoke-windows-strawberryperl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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=
17 changes: 4 additions & 13 deletions lib/ExtUtils/MM_Any.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
';
}
Expand Down Expand Up @@ -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 = <<END;
manifypods : pure_all config $dependencies
manifypods : pure_all
END

my @man_cmds;
Expand Down Expand Up @@ -1609,7 +1600,7 @@ CODE
my @add_meta_to_distdir = map { $self->cd('$(DISTVNAME)', $_) } @add_meta;

return sprintf <<'MAKE', @add_meta_to_distdir;
distmeta : create_distdir metafile
distmeta : metafile
$(NOECHO) %s
$(NOECHO) %s

Expand Down
14 changes: 7 additions & 7 deletions lib/ExtUtils/MM_Unix.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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" \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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{" \
Expand Down Expand Up @@ -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[]
Expand Down Expand Up @@ -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)
';
}
Expand Down Expand Up @@ -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)
Expand Down
95 changes: 34 additions & 61 deletions t/basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(<PERLLOCAL>, 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'} ) ) ||
Expand All @@ -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');
}

Expand Down Expand Up @@ -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;
}