Commit 6ec83a24 authored by Josip Sokcevic's avatar Josip Sokcevic Committed by LUCI CQ

Revert "Add VPYTHON_BYPASS support for vpython on Windows"

This reverts commit bc93924b.

Reason for revert: https://crbug.com/1308393

Original change's description:
> Add VPYTHON_BYPASS support for vpython on Windows
>
> At Postman, we use a custom build of Electron which is built using a set
> of tools that are managed by us. Till now, we were using the
> VPYTHON_BYPASS environment variable to use our own managed version of
> Python on macOS but unfortunately, on Windows, depot_tools doesn't
> respect the value of this variable, so this change adds support for that
> on Windows too.
>
> Signed-off-by: Darshan Sen <raisinten@gmail.com>
> Change-Id: I63da0495463ace87d34c3c6fad1c03dee108d14b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3525642
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>

Bug: 1308393
Change-Id: I8cea8827e185d516b8f860b2aa8a8f21a75a8b1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3539039
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
parent f0bc2d24
......@@ -5,49 +5,5 @@
:: See revert instructions in cipd_manifest.txt
:: Note: we set EnableDelayedExpansion so we can perform string manipulations
:: in our arguments parsing loop. This only works on Windows XP+.
setlocal EnableDelayedExpansion
if "%VPYTHON_BYPASS%"=="manually managed python not supported by chrome operations" (
set "arguments="
set "ignore="
set "stop="
for %%x in (%*) do (
set "arg=%%x"
if defined stop (
set "arguments=!arguments! %%~x"
) else (
if "!arg!"=="--" (
set "stop=1"
) else (
:: These tools all do something vpython related and quit
if "!arg:~0,13!"=="-vpython-tool" (
goto :END
)
:: Delete any vpython specific flag
if "!arg:~0,8!"=="-vpython" (
set "ignore=1"
) else (
if defined ignore (
set "ignore="
) else (
set "arguments=!arguments! %%~x"
)
)
)
)
)
call "python" !arguments!
if errorlevel 1 goto :END
)
call "%~dp0\cipd_bin_setup.bat" > nul 2>&1
"%~dp0\.cipd_bin\vpython.exe" -vpython-interpreter "%~dp0\python.bat" %*
:END
endlocal
exit /b %ERRORLEVEL%
......@@ -3,46 +3,6 @@
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.
:: Note: we set EnableDelayedExpansion so we can perform string manipulations
:: in our arguments parsing loop. This only works on Windows XP+.
setlocal EnableDelayedExpansion
if "%VPYTHON_BYPASS%"=="manually managed python not supported by chrome operations" (
set "arguments="
set "ignore="
set "stop="
for %%x in (%*) do (
set "arg=%%x"
if defined stop (
set "arguments=!arguments! %%~x"
) else (
if "!arg!"=="--" (
set "stop=1"
) else (
:: These tools all do something vpython related and quit
if "!arg:~0,13!"=="-vpython-tool" (
goto :END
)
:: Delete any vpython specific flag
if "!arg:~0,8!"=="-vpython" (
set "ignore=1"
) else (
if defined ignore (
set "ignore="
) else (
set "arguments=!arguments! %%~x"
)
)
)
)
)
call "python3" !arguments!
if errorlevel 1 goto :END
)
:: TODO(crbug.com/1003139): Remove.
:: Add Python 3 to PATH to work around crbug.com/1003139.
for /f %%i in (%~dp0python3_bin_reldir.txt) do set PYTHON3_BIN_RELDIR=%%i
......@@ -50,7 +10,3 @@ set PATH=%~dp0%PYTHON3_BIN_RELDIR%;%~dp0%PYTHON3_BIN_RELDIR%\Scripts;%~dp0%PYTHO
call "%~dp0\cipd_bin_setup.bat" > nul 2>&1
"%~dp0\.cipd_bin\vpython3.exe" -vpython-interpreter "%~dp0\%PYTHON3_BIN_RELDIR%\python3.exe" %*
:END
endlocal
exit /b %ERRORLEVEL%
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