db82b6fedb
This permits Magenta to build properly on systems where bash is not the default shell and/or is installed in locations other than /bin. Change-Id: Ic95e215c5d28b1a6e653bec53283540868c628f8
39 linhas
1.5 KiB
Bash
Arquivo Executável
39 linhas
1.5 KiB
Bash
Arquivo Executável
#!/usr/bin/env bash
|
|
|
|
# Copyright 2016 The Fuchsia Authors
|
|
#
|
|
# Use of this source code is governed by a MIT-style
|
|
# license that can be found in the LICENSE file or at
|
|
# https://opensource.org/licenses/MIT
|
|
|
|
# Use this to use git bisect with prebuilt binary artifacts. To use, first copy the script somewhere
|
|
# outside of the source tree (so git bisect won't mess with it) then run the following commands:
|
|
# git bisect start <bad> <good>
|
|
# git bisect run PATH_TO/bisect-helper <optional additional args to run-magenta>
|
|
# The script will download the prebuilt magenta.bin associated with each commit, if it exists, and
|
|
# start it up in qemu. After qemu exits, the script will ask if the build is good or bad. Type 'y'
|
|
# or 'n' and the bisect will proceed.
|
|
|
|
set -e
|
|
|
|
readonly SCRIPT_DIR="$1"
|
|
|
|
readonly TEMP_DIR="$(mktemp -d)"
|
|
trap "rm -rf -- "${TEMP_DIR}"" EXIT
|
|
readonly CURRENT_COMMIT="$(git rev-parse HEAD)"
|
|
readonly MAGENTA_BIN_URL="https://storage-download.googleapis.com/fuchsia-build/magenta/pc-x86-64/magenta.bin/${CURRENT_COMMIT}"
|
|
readonly DOWNLOAD_STATUS="$(curl -s -w %{http_code} --progress-bar --output "${TEMP_DIR}/magenta.bin" "${MAGENTA_BIN_URL}")"
|
|
if [[ "${DOWNLOAD_STATUS}" != 200 ]]; then
|
|
echo "Could not find prebuilt at ${MAGENTA_BIN_URL}: ${DOWNLOAD_STATUS}"
|
|
exit 125 # could not evaluate this commit, no prebuilt available
|
|
fi
|
|
"${SCRIPT_DIR}/run-magenta-x86-64" -o "${TEMP_DIR}"
|
|
|
|
echo "Did it work? y/n"
|
|
read RESULT
|
|
if [[ "${RESULT}" == y ]]; then
|
|
exit 0
|
|
else
|
|
exit 1
|
|
fi
|