From 6ec83a24266f06e954f60e375c480bcc27df1c31 Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Mon, 21 Mar 2022 15:42:41 +0000 Subject: [PATCH] Revert "Add VPYTHON_BYPASS support for vpython on Windows" This reverts commit bc93924b3b2b84515d91ba49bb60ac0b89d928e1. 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 > Change-Id: I63da0495463ace87d34c3c6fad1c03dee108d14b > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3525642 > Reviewed-by: Josip Sokcevic > Commit-Queue: Josip Sokcevic Bug: 1308393 Change-Id: I8cea8827e185d516b8f860b2aa8a8f21a75a8b1e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3539039 Bot-Commit: Rubber Stamper Commit-Queue: Josip Sokcevic --- vpython.bat | 44 -------------------------------------------- vpython3.bat | 44 -------------------------------------------- 2 files changed, 88 deletions(-) diff --git a/vpython.bat b/vpython.bat index 558648d39b..0b18261721 100644 --- a/vpython.bat +++ b/vpython.bat @@ -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% diff --git a/vpython3.bat b/vpython3.bat index 630e677261..d40cca59a7 100644 --- a/vpython3.bat +++ b/vpython3.bat @@ -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%