summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-01-13 07:08:41 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-01-13 08:00:25 +0000
commit86ea496c22e0185614a0476ea9e4d004c8171dd3 (patch)
tree53ca03ef237cf57eefe42c022b56959267bcd133
parent1f420053793581e04322474bd5aa3d76ef3026cc (diff)
tcwg_kernel-bisect.sh: Handle git-bisect's smartness.
Handle transitive assumptions of git-bisect about parent commits. See inline comment for details. Change-Id: I28e35b249e43325f37155059de4ec356cf140de4
-rwxr-xr-xtcwg_kernel-bisect.sh26
1 files changed, 25 insertions, 1 deletions
diff --git a/tcwg_kernel-bisect.sh b/tcwg_kernel-bisect.sh
index dada7b39..ec54d1f7 100755
--- a/tcwg_kernel-bisect.sh
+++ b/tcwg_kernel-bisect.sh
@@ -55,6 +55,7 @@ EOF
exit 0
fi
mv "$artifacts/build-bad" "$artifacts/build-$bad_rev-bad"
+ echo "$bad_rev" >> $artifacts/bad_revs
elif [ x"$bad_rev" = x"default" ]; then
echo "ERROR: Need explicit --bad_rev"
exit 1
@@ -80,7 +81,8 @@ cd $current_project
# Remember $good_rev from the baseline build above.
good_rev=$(git rev-parse HEAD)
baseline_rev="$good_rev"
-mv "$artifacts/build-baseline" "$artifacts/build-$good_rev-baseline"
+mv "$artifacts/build-baseline" "$artifacts/build-$baseline_rev-baseline"
+echo "$baseline_rev" >> $artifacts/good_revs
# Bisect script.
#
@@ -116,10 +118,13 @@ $scripts/tcwg_kernel-build.sh \
--verbose "$verbose" &
res=0 && wait \$! || res=\$?
if [ -f $artifacts/build-\$rev/failures ]; then
+ echo "\$rev" >> $artifacts/bad_revs
exit 1
elif [ x"\$res" != x"0" ]; then
+ echo "\$rev" >> $artifacts/skipped_revs
exit 125
else
+ echo "\$rev" >> $artifacts/good_revs
exit 0
fi
EOF
@@ -244,6 +249,25 @@ if [ -f $artifacts/first-bad ]; then
fi
last_good=$(git -C $current_project rev-parse $first_bad^)
+ if ! grep -q $last_good "$artifacts/good_revs"; then
+ # It seems that git-bisect assumes parent commit as "good" on
+ # the basis of one of its children being "good". Therefore we
+ # can have a situation when we have parent P with children C1 and C2,
+ # and child C1 has a child of its own CB. Git-bisect tests C2 as
+ # "good", and CB as "bad". From C2 being good it assumes P as "good",
+ # and it knows CB is "bad", so git-bisect returns C1 as the first bad
+ # commit.
+ # To simplify investigations we explicitly test parent of $first_bad.
+ echo "Testing last_good $last_good (hoping for success)"
+ git checkout --detach "$last_good"
+ ../bisect-run.sh &
+ res=0 && wait $! || res=$?
+ if [ x"$res" != x"0" ]; then
+ echo "ERROR: build for last_good $last_good failed"
+ exit 1
+ fi
+ fi
+
if [ x"$last_good" != x"$baseline_rev" ]; then
mv "$artifacts/build-$last_good" "$artifacts/build-$last_good-last_good"
else