Skip to content

Commit

Permalink
bisect-runner.pl must clean up, even if it's skipping.
Browse files Browse the repository at this point in the history
It modifies makedepend.SH before running Configure, and a failed build may
well modify other files. The bisect run will fail if git can't checkout
the next revision to test because a file is locally modified.
  • Loading branch information
nwc10 committed Sep 30, 2011
1 parent c3d98a7 commit ab4a15f
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions Porting/bisect-runner.pl
Expand Up @@ -48,6 +48,24 @@ sub extract_from_file {
return;
}

sub clean {
if ($clean) {
# Needed, because files that are build products in this checked out
# version might be in git in the next desired version.
system 'git clean -dxf';
# Needed, because at some revisions the build alters checked out files.
# (eg pod/perlapi.pod). Also undoes any changes to makedepend.SH
system 'git reset --hard HEAD';
}
}

sub skip {
my $reason = shift;
clean();
warn "skipping - $reason";
exit 125;
}

# Not going to assume that system perl is yet new enough to have autodie
system 'git clean -dxf' and die;

Expand Down Expand Up @@ -106,10 +124,7 @@ sub extract_from_file {
or die "wait for Configure, pid $pid failed: $!";

# Skip if something went wrong with Configure
unless (-f 'config.sh') {
warn "skipping - no config.sh";
exit 125;
}
skip('no config.sh') unless -f 'config.sh';

# Correct makefile for newer GNU gcc
# Only really needed if you comment out the use of blead's makedepend.SH
Expand Down Expand Up @@ -147,22 +162,13 @@ sub extract_from_file {
system "make $j $target";
}

if ($expected =~ /perl$/ ? !-x $expected : !-r $expected) {
warn "skipping - could not build $target";
exit 125;
}
skip("could not build $target")
if $expected =~ /perl$/ ? !-x $expected : !-r $expected;

# This is what we came here to run:
my $ret = system @ARGV;

if ($clean) {
# Needed, because files that are build products in this checked out version
# might be in git in the next desired version.
system 'git clean -dxf';
# Needed, because at some revisions the build alters checked out files.
# (eg pod/perlapi.pod). Also undoes any changes to makedepend.SH
system 'git reset --hard HEAD';
}
clean();

my $got = ($test_should_pass ? !$ret : $ret) ? 'good' : 'bad';

Expand Down

0 comments on commit ab4a15f

Please sign in to comment.