summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Lindholm <leif.lindholm@linaro.org>2018-08-30 21:14:25 +0100
committerLeif Lindholm <leif.lindholm@linaro.org>2018-08-30 21:14:25 +0100
commitd370b93011cf255317010378ba69644065a5a5a7 (patch)
tree94605ba1c65d060ba41a2715999a4bea99dc5856
parentf702d409ca697674bf7a57d122020b464aee49e6 (diff)
add new check-bisect.sh
check-bisect.sh, if run like you would run edk2-build.sh, will look for a common ancestor between current branch in ../edk2-platforms and origin/master in that repo. Then it will repeatedly try to build every commit (newest-> oldest) until it successfully reaches that common ancestor - or exit with an error if any platform/target fails to build. This *will* discard commits on that branch, so only ever use it on a temporary branch for this purpose. Usage example: ../uefi-tools/check-bisect.sh d03 d05 overdrive All command line parameters will be passed straight over to edk2-build.sh. Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
-rwxr-xr-xcheck-bisect.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/check-bisect.sh b/check-bisect.sh
new file mode 100755
index 0000000..81a29d1
--- /dev/null
+++ b/check-bisect.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+TOOLS_DIR="`dirname $0`"
+TOOLS_DIR="`readlink -f \"$TOOLS_DIR\"`"
+
+REPO_DIR=../edk2-platforms
+GIT="git -C $REPO_DIR"
+
+START_HASH=`$GIT rev-parse HEAD`
+STOP_HASH=`$GIT rev-parse origin/master`
+
+$GIT merge-base --is-ancestor $STOP_HASH $START_HASH 2>/dev/null
+if [ $? -eq 0 ]; then
+ echo "$STOP_HASH is an ancestor - proceeding."
+else
+ echo "$STOP_HASH is not an ancestor - aborting!" >&2
+ exit 1
+fi
+
+PLATFORMS=$*
+
+echo $PLATFORMS
+
+while [ `$GIT rev-parse HEAD` != $STOP_HASH ]; do
+ $TOOLS_DIR/edk2-build.sh --strict -e ../edk2 -p ../edk2-platforms -n ../edk2-non-osi -b DEBUG -b RELEASE $PLATFORMS
+ if [ $? -ne 0 ]; then
+ echo "`$GIT rev-parse HEAD` failed to build" >&2
+ exit 2
+ fi
+ $GIT reset --hard HEAD^
+done
+
+echo "SUCCESS: all commits from"
+echo " $START_HASH to"
+echo " $STOP_HASH"
+echo "built successfully for $PLATFORMS!"