From d370b93011cf255317010378ba69644065a5a5a7 Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Thu, 30 Aug 2018 21:14:25 +0100 Subject: 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 --- check-bisect.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 check-bisect.sh 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!" -- cgit v1.2.3