Use depot_tools python3 to call ninja.py

This guarantees the python version used to call ninja.py.

Bug: 1398687
Change-Id: Ife58b285bb621dddb20b947010bc19818cd41395
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4091206
Commit-Queue: Junji Watanabe <jwata@google.com>
Reviewed-by: Nico Weber <thakis@chromium.org>
Auto-Submit: Junji Watanabe <jwata@google.com>
Commit-Queue: Nico Weber <thakis@chromium.org>
This commit is contained in:
Junji Watanabe
2022-12-09 02:19:29 +00:00
committed by LUCI CQ
parent 22bbba13ce
commit 8e77bba1ae
2 changed files with 5 additions and 3 deletions

2
ninja
View File

@@ -5,4 +5,4 @@
# found in the LICENSE file. # found in the LICENSE file.
base_dir=$(dirname "$0") base_dir=$(dirname "$0")
PYTHONDONTWRITEBYTECODE=1 exec python3 "$base_dir/ninja.py" "$@" PYTHONDONTWRITEBYTECODE=1 exec "$base_dir/python-bin/python3" "$base_dir/ninja.py" "$@"

View File

@@ -4,9 +4,11 @@
:: found in the LICENSE file. :: found in the LICENSE file.
setlocal setlocal
set scriptdir=%~dp0
:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used
:: standalone, but allow other PATH manipulations to take priority. :: standalone, but allow other PATH manipulations to take priority.
set PATH=%PATH%;%~dp0 set PATH=%PATH%;%scriptdir%
:: Defer control. :: Defer control.
python3 "%~dp0\ninja.py" %* call %scriptdir%python-bin\python3.bat "%~dp0\ninja.py" %*