autoninja: Invoke python3, or batch file on Win.

Bug: 941669
Change-Id: I7f196860d87566cdbd2dda99da151124d9ba917f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2826237
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
changes/37/2826237/2
Jamie Madill 4 years ago committed by LUCI CQ
parent d548d5a90e
commit 5f16d6dce6

@ -4,6 +4,12 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
# In git bash on Windows, invoke the batch file.
if [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
autoninja.bat "$@"
exit
fi
# Set unique build ID. # Set unique build ID.
AUTONINJA_BUILD_ID="$(python3 -c "import uuid; print(uuid.uuid4())")" AUTONINJA_BUILD_ID="$(python3 -c "import uuid; print(uuid.uuid4())")"
export AUTONINJA_BUILD_ID export AUTONINJA_BUILD_ID
@ -14,8 +20,7 @@ fi
# Execute whatever is printed by autoninja.py. # Execute whatever is printed by autoninja.py.
# Also print it to reassure that the right settings are being used. # Also print it to reassure that the right settings are being used.
# Don't use python3 because it doesn't work in git bash on Windows. command=$(python3 "$(dirname -- "$0")/autoninja.py" "$@")
command=$(python "$(dirname -- "$0")/autoninja.py" "$@")
if [ "$NINJA_SUMMARIZE_BUILD" == "1" ]; then if [ "$NINJA_SUMMARIZE_BUILD" == "1" ]; then
echo "$command" echo "$command"
fi fi

Loading…
Cancel
Save