Skip to content

Commit

Permalink
i#4126: Diagnostics for stuck cross-compile build (#4119)
Browse files Browse the repository at this point in the history
Adds some diagnostics for stuck cross-compile builds, but when I have them in place the hang does not reproduce.  Since it seems like a strange Travis-specific perl fork issue in any case, I'm putting these in permanently in the hope it is a workaround to avoid the hang.

Fixes #4126
  • Loading branch information
derekbruening authored Feb 27, 2020
1 parent fce5a0f commit eaa3dee
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions suite/runsuite_wrapper.pl
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,23 @@
die "Failed to fork: $!" if (!defined($child));
if ($child) {
# Parent
my $output;
while (<CHILD>) {
print STDOUT $_;
$res .= $_;
# i#4126: We include extra printing to help diagnose hangs on Travis.
if ($^O ne 'cygwin') {
print "Parent tee-ing child stdout...\n";
local $SIG{ALRM} = sub {
print "\nxxxxxxxxxx 30s elapsed xxxxxxxxxxx\n";
alarm(30);
};
alarm(30);
while (<CHILD>) {
print STDOUT $_;
$res .= $_;
}
} else {
while (<CHILD>) {
print STDOUT $_;
$res .= $_;
}
}
close(CHILD);
} elsif ($ENV{'TRAVIS_EVENT_TYPE'} eq 'cron' ||
Expand Down Expand Up @@ -124,17 +137,13 @@
system("${cmd} 2>&1");
exit 0;
} else {
# We have no way to access the log files, so we can -VV to ensure
# we can diagnose failures, but it makes for a large online result
# that has to be manually downloaded. We thus stick with -V for
# Travis. For Appveyor where many devs have no local Visual
# Studio we do use -VV so build warning details are visible.
my $verbose = "-V";
if ($^O eq 'cygwin') {
$verbose = "-VV";
}
# We have no way to access the log files, so we use -VV to ensure
# we can diagnose failures.
my $verbose = "-VV";
my $cmd = "ctest --output-on-failure ${verbose} -S \"${osdir}/runsuite.cmake${args}\"";
print "Running ${cmd}\n";
system("${cmd} 2>&1");
print "Finished running ${cmd}\n";
exit 0;
}

Expand Down

0 comments on commit eaa3dee

Please sign in to comment.