Commit ab816ce8 authored by Chris Nardi's avatar Chris Nardi Committed by Commit Bot

Fix depot_tools errors that cause runhooks to be inoperable for Cygwin

The vpython/CIPD work created some errors when attempting to build on
Cygwin. This patch fixes these errors by converting Cygwin paths to
Windows paths or using the depot_tools python instead of Cygwin python.

Bug:
Change-Id: Id62f59a357fa2937c7eb843bf306ef4303b0910e
Reviewed-on: https://chromium-review.googlesource.com/745727Reviewed-by: 's avatarRobbie Iannucci <iannucci@chromium.org>
Reviewed-by: 's avatarVadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
parent 7d1c484e
......@@ -4,9 +4,19 @@
function cipd_bin_setup {
local MYPATH=$(dirname "${BASH_SOURCE[0]}")
local ENSURE="$MYPATH/cipd_manifest.txt"
local ROOT="$MYPATH/.cipd_bin"
UNAME=`uname -s | tr '[:upper:]' '[:lower:]'`
case $UNAME in
cygwin*)
ENSURE="$(cygpath -w $ENSURE)"
ROOT="$(cygpath -w $ROOT)"
;;
esac
"$MYPATH/cipd" ensure \
-log-level warning \
-ensure-file "$MYPATH/cipd_manifest.txt" \
-root "$MYPATH/.cipd_bin"
-ensure-file "$ENSURE" \
-root "$ROOT"
}
......@@ -130,6 +130,16 @@ def run_gsutil(force_version, fallback, target, args, clean=False):
gsutil_bin = fallback
disable_update = ['-o', 'GSUtil:software_update_check_period=0']
if sys.platform == 'cygwin':
# This script requires Windows Python, so invoke with depot_tools'
# Python.
def winpath(path):
return subprocess.check_output(['cygpath', '-w', path]).strip()
cmd = ['python.bat', winpath(__file__)]
cmd.extend(args)
sys.exit(subprocess.call(cmd))
assert sys.platform != 'cygwin'
# Run "gsutil" through "vpython". We need to do this because on GCE instances,
# expectations are made about Python having access to "google-compute-engine"
# and "boto" packages that are not met with non-system Python (e.g., bundles).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment