depot_tools: Don't add a python3 shim to depot_tools on bootstrap.
pythond and python3 are still downloaded from cipd, but python3 is no longer shim'd into depot_tools on Linux, so is not available on PATH. Modify PATH in vpython and vpython3 on Linux to point to the python3 download directory, so that the version downloaded from cipd is used. Bug: 1017812 Change-Id: I70bc8e7d460f60dcbfa5e141127edecfc2b44744 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1893982 Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org> Reviewed-by: Anthony Polito <apolito@google.com> Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Dirk Pranke <dpranke@chromium.org>changes/82/1893982/18
parent
89863242a4
commit
9577daf667
@ -1,46 +0,0 @@
|
||||
@echo off
|
||||
:: Copyright 2017 The Chromium Authors. All rights reserved.
|
||||
:: Use of this source code is governed by a BSD-style license that can be
|
||||
:: found in the LICENSE file.
|
||||
|
||||
setlocal
|
||||
set PYTHON_BAT_RUNNER=1
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:: This file is automatically generated by "bootstrap\win\win_tools.py", and
|
||||
:: should not be modified.
|
||||
::
|
||||
:: The previous "::" block acts as a nop-sled. Each time a batch file executes
|
||||
:: a command, it reloads itself and seeks to its previous execution offset to
|
||||
:: begin execution. Updating this batch file is, therefore, risky, since any
|
||||
:: running Python instance that is using the old batch file will reload the new
|
||||
:: batch file once the Python command terminates and resume at some unknown
|
||||
:: offset.
|
||||
::
|
||||
:: With the sled in place, a previous instance will resume mid-label. We are
|
||||
:: assuming that the offset of the Python invocation is greater than the
|
||||
:: PYTHON_BAT_RUNNER set command, which is the case since the old instance has
|
||||
:: a large PATH set block before the Python execution. Old instances will hit
|
||||
:: the next block of code without PYTHON_BAT_RUNNER set. New instances will have
|
||||
:: it set.
|
||||
::
|
||||
:: We remedy this in the future by having the batch file load its core paths
|
||||
:: from an external file with for/set, removing the need to modify "python.bat"
|
||||
:: during upgrade.
|
||||
::
|
||||
:: After all of the old batch files are believed to be replaced, we can remove
|
||||
:: the PYTHON_BAT_RUNNER block and the sled. For this update, old instances
|
||||
:: will resume past the end of the file and terminate.
|
||||
|
||||
if not "%PYTHON_BAT_RUNNER%" == "1" goto :END
|
||||
|
||||
for /f %%i in (%~dp0python_bin_reldir.txt) do set PYTHON_BIN_RELDIR=%%i
|
||||
set PATH=%~dp0%PYTHON_BIN_RELDIR%;%~dp0%PYTHON_BIN_RELDIR%\Scripts;%PATH%
|
||||
"%~dp0%PYTHON_BIN_RELDIR%\python.exe" %*
|
||||
|
||||
:END
|
@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
base_dir=$(dirname "$0")
|
||||
|
||||
PYTHON3_BIN_RELDIR="$(cat $base_dir/python3_bin_reldir.txt | xargs echo)"
|
||||
PATH="${PYTHON3_BIN_RELDIR}":"${PYTHON3_BIN_RELDIR}/Scripts":"$PATH"
|
||||
"$base_dir/${PYTHON3_BIN_RELDIR}/python3" "$@"
|
@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
base_dir=$(dirname "$0")
|
||||
|
||||
PYTHON3_BIN_RELDIR="$(cat $base_dir/python3_bin_reldir.txt | xargs echo)"
|
||||
PATH="${PYTHON3_BIN_RELDIR}":"${PYTHON3_BIN_RELDIR}/Scripts":"$PATH"
|
||||
"$base_dir/${PYTHON3_BIN_RELDIR}/python3" "$@"
|
@ -1,46 +0,0 @@
|
||||
@echo off
|
||||
:: Copyright 2017 The Chromium Authors. All rights reserved.
|
||||
:: Use of this source code is governed by a BSD-style license that can be
|
||||
:: found in the LICENSE file.
|
||||
|
||||
setlocal
|
||||
set PYTHON_BAT_RUNNER=1
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:: This file is automatically generated by "bootstrap\win\win_tools.py", and
|
||||
:: should not be modified.
|
||||
::
|
||||
:: The previous "::" block acts as a nop-sled. Each time a batch file executes
|
||||
:: a command, it reloads itself and seeks to its previous execution offset to
|
||||
:: begin execution. Updating this batch file is, therefore, risky, since any
|
||||
:: running Python instance that is using the old batch file will reload the new
|
||||
:: batch file once the Python command terminates and resume at some unknown
|
||||
:: offset.
|
||||
::
|
||||
:: With the sled in place, a previous instance will resume mid-label. We are
|
||||
:: assuming that the offset of the Python invocation is greater than the
|
||||
:: PYTHON_BAT_RUNNER set command, which is the case since the old instance has
|
||||
:: a large PATH set block before the Python execution. Old instances will hit
|
||||
:: the next block of code without PYTHON_BAT_RUNNER set. New instances will have
|
||||
:: it set.
|
||||
::
|
||||
:: We remedy this in the future by having the batch file load its core paths
|
||||
:: from an external file with for/set, removing the need to modify "python.bat"
|
||||
:: during upgrade.
|
||||
::
|
||||
:: After all of the old batch files are believed to be replaced, we can remove
|
||||
:: the PYTHON_BAT_RUNNER block and the sled. For this update, old instances
|
||||
:: will resume past the end of the file and terminate.
|
||||
|
||||
if not "%PYTHON_BAT_RUNNER%" == "1" goto :END
|
||||
|
||||
for /f %%i in (%~dp0python3_bin_reldir.txt) do set PYTHON3_BIN_RELDIR=%%i
|
||||
set PATH=%~dp0%PYTHON3_BIN_RELDIR%;%~dp0%PYTHON3_BIN_RELDIR%\Scripts;%PATH%
|
||||
"%~dp0%PYTHON3_BIN_RELDIR%\python3.exe" %*
|
||||
|
||||
:END
|
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DEPOT_TOOLS=$(dirname "$0")/..
|
||||
|
||||
PYTHON3_BIN_DIR="$DEPOT_TOOLS/$(cat $DEPOT_TOOLS/python3_bin_reldir.txt | xargs echo)"
|
||||
PATH="$PYTHON3_BIN_DIR":"$PYTHON3_BIN_DIR/Scripts":"$PATH"
|
||||
"$PYTHON3_BIN_DIR/python3" "$@"
|
Loading…
Reference in New Issue