This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH buildbot] keep build directory after failure
- From: Szabolcs Nagy <Szabolcs dot Nagy at arm dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Cc: nd <nd at arm dot com>
- Date: Fri, 2 Nov 2018 11:33:10 +0000
- Subject: [PATCH buildbot] keep build directory after failure
aarch64 buildbot failed with
FAIL: malloc/tst-malloc-tcache-leak
4 times so far even though there were no related commits,
the failure happens about 1 out of 15 builds and only if
the build was done in an unclean directory, but i could
not manually reproduce it yet.
the buildbot first builds glibc in the previous build
directory, if that fails then that immediately gets
deleted and glibc is rebuilt starting from an empty
build directory, so it's impossible to tell what went
wrong in case of such non-reproducible failures.
i suggest keeping the last failed build directory for
analysis.
the build directory rename is not optimal since that
breaks absolute paths pointing to it (e.g. paths in
testrun.sh), but it allows looking at test outputs
and failed binaries.
diff --git a/scripts/slave/glibc-native.sh b/scripts/slave/glibc-native.sh
index 21c9d2d..8b22687 100755
--- a/scripts/slave/glibc-native.sh
+++ b/scripts/slave/glibc-native.sh
@@ -14,6 +14,7 @@ nproc=$(getconf _NPROCESSORS_ONLN)
root_dir=$(pwd)
src_dir="${root_dir}/glibc"
build_dir="${root_dir}/build"
+old_build_dir="${root_dir}/old_build"
git_branch=${BUILDBOT_BRANCHNAME:-master}
git_revision=${BUILDBOT_REVISION:-origin/${git_branch}}
@@ -81,7 +82,10 @@ do_check() {
do_clobber() {
clobber=true
cd "$root_dir"
- rm -rf "$build_dir"
+ if [ -d "$build_dir" ]; then
+ rm -rf "$old_build_dir"
+ mv "$build_dir" "$old_build_dir"
+ fi
}