summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-07-11 18:43:44 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-07-11 18:43:44 +0000
commite599832c459dfecc00d2ab9c61f800aaeaf390d3 (patch)
tree2d02e04e8fd7ba9709010829238cda1effa65375
parent0f2ef62d12266989aee544affee2bd5cc4b6d0ea (diff)
round-robin-bisect.sh: Save/restore baseline state
... to avoid bisect tests cloberring shared state. Change-Id: Ibd8059d513df9ec5cf5fe49777c020c655a46fd4
-rwxr-xr-xround-robin-bisect.sh44
-rw-r--r--round-robin.sh9
2 files changed, 31 insertions, 22 deletions
diff --git a/round-robin-bisect.sh b/round-robin-bisect.sh
index 1c65070e..fa3aa278 100755
--- a/round-robin-bisect.sh
+++ b/round-robin-bisect.sh
@@ -85,6 +85,16 @@ EOF
ln -f -s "build-baseline" "$artifacts/build-$baseline_rev"
ln -f -s "build-baseline.sh" "$artifacts/manifests/build-$baseline_rev.sh"
+mkdir -p bisect/baseline
+
+# Save baseline build state, which we restore before individual bisect tests.
+# This ensures that "bad" bisect tests won't affect "good" ones and vice versa.
+baseline_exclude=(
+ --exclude bisect/ --exclude $rel_artifacts/ --exclude $current_project/
+)
+rsync -a --del --delete-excluded "${baseline_exclude[@]}"
+ ./ ./bisect/baseline/
+
cd $current_project
mkdir $artifacts/git-logs
@@ -146,6 +156,9 @@ fi
cd ..
+# Restore known-good baseline state.
+rsync -a --del "${baseline_exclude[@]}" ./bisect/baseline/ ./
+
$build_script \
^^ $reproduce_bisect \
%% $rel_artifacts/manifests/build-\$rev.sh \
@@ -259,9 +272,10 @@ fi
# Clone interesting-commits.git repo, which contains a list of SHA1s
# that might cut down bisection time. Mostly, these are first_bad and
# last_good commits.
+interesting_commits="../bisect/interesting-commits"
interesting_commits_rev=${interesting_commits_rev-linaro-local/ci/${rr[ci_project]}}
-clone_or_update_repo ../interesting-commits $interesting_commits_rev https://git-us.linaro.org/toolchain/ci/interesting-commits.git auto $interesting_commits_rev
-interesting_commits_rev=$(git -C ../interesting-commits rev-parse HEAD)
+clone_or_update_repo $interesting_commits $interesting_commits_rev https://git-us.linaro.org/toolchain/ci/interesting-commits.git auto $interesting_commits_rev
+interesting_commits_rev=$(git -C $interesting_commits rev-parse HEAD)
cat <<EOF | manifest_out
declare -g interesting_commits_rev=$interesting_commits_rev
EOF
@@ -280,31 +294,31 @@ push_interesting_commit ()
local kind="$2"
local -a configs
- if ! grep -q "^$sha1" ../interesting-commits/$current_project; then
- echo "$sha1" >> ../interesting-commits/$current_project
+ if ! grep -q "^$sha1" $interesting_commits/$current_project; then
+ echo "$sha1" >> $interesting_commits/$current_project
fi
if [ x"$kind" = x"regression" ]; then
- mapfile -t configs < <(grep "^$sha1" ../interesting-commits/$current_project | sed -e "s/^$sha1 *//")
+ mapfile -t configs < <(grep "^$sha1" $interesting_commits/$current_project | sed -e "s/^$sha1 *//")
configs+=("${rr[ci_project]}"/"${rr[ci_config]}")
mapfile -t configs < <(echo "${configs[@]}" | tr ' ' '\n' | sort -u)
- sed -i -e "s#^$sha1.*\$#$sha1 ${configs[*]}#" ../interesting-commits/$current_project
+ sed -i -e "s#^$sha1.*\$#$sha1 ${configs[*]}#" $interesting_commits/$current_project
fi
- git -C ../interesting-commits add .
- if [ x"$(git -C ../interesting-commits status --short)" = x"" ]; then
+ git -C $interesting_commits add .
+ if [ x"$(git -C $interesting_commits status --short)" = x"" ]; then
# No file has changed. We've been here before...
# E.g., this is a re-occuring regression in linux-next.
exit 125
fi
- git -C ../interesting-commits commit -m "Add $kind $sha1 from $BUILD_URL
+ git -C $interesting_commits commit -m "Add $kind $sha1 from $BUILD_URL
${configs[*]}" &
local res=0 && wait $! || res=$?
if [ x"$res" = x"0" ]; then
- git_init_linaro_local_remote ../interesting-commits baseline false
- git_push ../interesting-commits baseline linaro-local/ci/${rr[ci_project]}
+ git_init_linaro_local_remote $interesting_commits baseline false
+ git_push $interesting_commits baseline linaro-local/ci/${rr[ci_project]}
fi
) &
wait $! || push_interesting_commit_result=$?
@@ -342,7 +356,7 @@ print_tested_revs ()
# Try to reduce bisection range by testing regressions (and their parents)
# identified in other configurations.
-touch ../interesting-commits/$current_project
+touch $interesting_commits/$current_project
# Generate list of commits inside the bisection range.
commits_to_test=$artifacts/git-logs/commits_to_test
git bisect view --pretty=%H > $commits_to_test
@@ -387,7 +401,7 @@ while [ x"$(get_first_bad </dev/null)" = x"" ] && read -a arr; do
fi
git bisect view --pretty=%H > $commits_to_test
) </dev/null
-done < <(cat ../interesting-commits/$current_project)
+done < <(cat $interesting_commits/$current_project)
if $verbose; then set -x; fi
if [ x"$(get_first_bad)" = x"" ]; then
@@ -697,6 +711,10 @@ chmod +x $rel_artifacts/test.sh
# Reproduce the baseline build (build all pre-requisites)
$build_script @@ $rel_artifacts/manifests/build-baseline.sh
+# Save baseline build state (which is then restored in $rel_artifacts/test.sh)
+rsync -a --del --delete-excluded "${baseline_exclude[@]}"
+ ./ ./bisect/baseline/
+
cd $current_project
# Reproduce $bad_name build
diff --git a/round-robin.sh b/round-robin.sh
index 491c1655..1b156c9d 100644
--- a/round-robin.sh
+++ b/round-robin.sh
@@ -388,15 +388,6 @@ build_abe ()
# to do on a check step.
if ! $check; then
set +f; rm -rf builds/*/*/$project-*; set -f
-
- if [ x"$project" = x"gcc" ] && [ -d builds/destdir ]; then
- # Delete previously-built GCC so that we avoid using it in native
- # builds. Otherwise, when we are bisecting GCC bootstrap failure,
- # we could use broken GCC.
- find builds/destdir \
- \( -path "*/bin/*gcc" -o -path "*/bin/*g++" \
- -o -path "*/bin/*cpp" -o -path "*/bin/*c++" \) -delete
- fi
fi
PATH=$(pwd)/bin:$PATH