From 265255f501b5954d24c851e360b5350322a6f6b3 Mon Sep 17 00:00:00 2001 From: Dan Jacques Date: Tue, 11 Jul 2017 15:57:06 +0000 Subject: [PATCH] [bootstrap/win] Replace "python.bat" only on downgrade. We're implementing a bootstrap downgrade for potential revert of https://chromium-review.googlesource.com/c/563036 Currently, the downgrade sees the presence of the landed patch as a sign to completely reinstall Python. However, this causes the "python276_bin" directory to be deleted, which both ruins any running process (notably "service manager" and BuildBot) and fails due to those running processes, leaving the system in a broken state. Instead, we'll view the revert path as a signal to swap in the old "python.bat" specifically, then fall through to standard installation detection. Since the upgrade will not actually delete "python276_bin", the expected revert case will leave it alone, preserving existing execution environments. BUG=chromium:740966, chromium:740171 TEST=local - Ran simulation of revert path with this change, observed better outcome. Change-Id: I0dfa5924a27bcaba49134272a344f7b9f1d475c5 Reviewed-on: https://chromium-review.googlesource.com/567167 Reviewed-by: Robbie Iannucci Commit-Queue: Daniel Jacques --- bootstrap/win/win_tools.bat | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bootstrap/win/win_tools.bat b/bootstrap/win/win_tools.bat index de121f981..eb8dd1034 100644 --- a/bootstrap/win/win_tools.bat +++ b/bootstrap/win/win_tools.bat @@ -33,9 +33,8 @@ if "%1" == "force" ( :: destroy our "python.bat" if we detect a "python_bin_reldir.txt" file :: present, causing us to reinstall Python. if exist "%WIN_TOOLS_ROOT_DIR%\python_bin_reldir.txt" ( - del "%WIN_TOOLS_ROOT_DIR%\python.bat" + call copy /y "%~dp0python276.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul del "%WIN_TOOLS_ROOT_DIR%\python_bin_reldir.txt" - goto :PY27_INSTALL ) if not exist "%WIN_TOOLS_ROOT_DIR%\python276_bin" goto :PY27_INSTALL