aboutsummaryrefslogtreecommitdiffstats
path: root/ulri
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@gmail.com>2017-02-06 21:47:23 +0000
committerPascal Terjan <pterjan@gmail.com>2017-02-06 22:25:52 +0000
commit3b52beca0c38da3faf5012641e0f2bffaa4a06a5 (patch)
treeb80f41141e179d7d8baebb8e36a1f6737d772857 /ulri
parent6b0406789bfe04592c44db688fb15c3f3a7816ad (diff)
downloadiurt-3b52beca0c38da3faf5012641e0f2bffaa4a06a5.tar
iurt-3b52beca0c38da3faf5012641e0f2bffaa4a06a5.tar.gz
iurt-3b52beca0c38da3faf5012641e0f2bffaa4a06a5.tar.bz2
iurt-3b52beca0c38da3faf5012641e0f2bffaa4a06a5.tar.xz
iurt-3b52beca0c38da3faf5012641e0f2bffaa4a06a5.zip
Simplify failure detection logic and fix cleanup
Especially: - fetch logs when dependencies can not be installed - properly cleanup logs on the build machine in all cases - really discard other architectures if a mandatory one had already failed
Diffstat (limited to 'ulri')
-rwxr-xr-xulri41
1 files changed, 19 insertions, 22 deletions
diff --git a/ulri b/ulri
index 07c793a..b41af1e 100755
--- a/ulri
+++ b/ulri
@@ -315,7 +315,6 @@ foreach my $prefix (keys %pkg_tree) {
next bot;
}
- my $success;
my $fail;
my $later;
@@ -336,7 +335,7 @@ foreach my $prefix (keys %pkg_tree) {
}
}
- if (!$fail) {
+ if (!$fail && !$later) {
my @list = split "\n", sout($remote, "ls $prefix_dir");
my $error;
my $done;
@@ -374,31 +373,23 @@ foreach my $prefix (keys %pkg_tree) {
next if $error;
if ($done) {
- create_file("$done_dir/${prefix}_$arch.done", "$bot $host");
- $pkg_tree{$prefix}{media}{$media}{done_arch}{$arch} = 1;
- $success = 1;
- }
-
- if ($success) {
- # Fetch build log and clean remote machine
- make_path("$done_dir/$prefix");
- sget($remote, "$prefix_dir/log/*", "$done_dir/$prefix");
- ssh($remote, "rm -rf $prefix_dir");
if (check_if_mandatory_arch_failed($media, $prefix, $ent, $config)) {
+ # Discard this arch as another mandatory one failed
cleanup_failed_build($todo_dir, $done_dir, $fail_dir, $prefix, $ent, $media, $arch, $config);
} else {
+ create_file("$done_dir/${prefix}_$arch.done", "$bot $host");
+ $pkg_tree{$prefix}{media}{$media}{done_arch}{$arch} = 1;
+ make_path("$done_dir/$prefix");
+ sget($remote, "$prefix_dir/log/*", "$done_dir/$prefix");
$something_finished = 1;
}
+ # Either we already fetched the success logs, or don't care
+ # as this success was discarded due to another failure.
+ ssh($remote, "rm -rf $prefix_dir");
+ next bot;
}
}
- next bot if $later;
-
- next bot if $success && !$fail;
-
- plog('FAIL', "build failed");
- create_file("$done_dir/${prefix}_$arch.fail", "$bot $host");
- $pkg_tree{$prefix}{media}{$media}{failed_arch}{$arch} = 1;
make_path($fail_dir);
mkdir("$fail_dir/$prefix");
@@ -407,17 +398,23 @@ foreach my $prefix (keys %pkg_tree) {
"to $fail_dir/ failed ($!)");
$pkg_tree{$prefix}{media}{$media}{arch}{$arch} = 0;
}
+ # clean the log on the compilation machine
+ ssh($remote, "rm -rf $prefix_dir");
+
+ # We got the logs but want to retry so don't record a failure
+ next bot if $later;
cleanup_failed_build($todo_dir, $done_dir, $fail_dir, $prefix, $ent, $media, $arch, $config);
+ plog('FAIL', "build failed");
+ create_file("$done_dir/${prefix}_$arch.fail", "$bot $host");
+ $pkg_tree{$prefix}{media}{$media}{failed_arch}{$arch} = 1;
+
# Notify user if build failed
- #
if ($user) {
warn_about_failure($config, $user, $ent, $arch, $fail_dir, $path, $prefix);
}
- # clean the log on the compilation machine
- ssh($remote, "rm -rf $prefix_dir");
} # end bot
} # end path