From 7c4bd3f94e9fb2c4b1ee839e67fc3a02da74f7d5 Mon Sep 17 00:00:00 2001 From: Anne Redulla Date: Mon, 10 Feb 2025 14:39:20 -0800 Subject: [PATCH] [win-bootstrap] Update the comments in update_depot_tools.bat Also adds an echo to win_tools.bat so a user will know when the bootstrapping script is skipped after a CIPD install error. This should hopefully help when troubleshooting. Bug: b/360206460 Change-Id: Ic8bfcbddfe4681a7716ca9f3793d045e0de704cf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6242904 Reviewed-by: Josip Sokcevic Commit-Queue: Anne Redulla --- bootstrap/win_tools.bat | 7 +++++-- update_depot_tools.bat | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/bootstrap/win_tools.bat b/bootstrap/win_tools.bat index 5f436849e..7d4d236e7 100644 --- a/bootstrap/win_tools.bat +++ b/bootstrap/win_tools.bat @@ -58,9 +58,12 @@ set BOOTSTRAP_EXTRA_ARGS=--bootstrap-name "%BOOTSTRAP_NAME%" :: See "//cipd.bat" and "//.cipd_impl.ps1" for more information. set CIPD_EXE=%BOOTSTRAP_ROOT_DIR%\cipd.bat call "%CIPD_EXE%" ensure -log-level warning -ensure-file "%~dp0%CIPD_MANIFEST%" -root "%BOOTSTRAP_PATH%" -if errorlevel 1 goto :END +if errorlevel 1 ( + echo Error installing CIPD packages. + goto :END +) -:: This executes "win_tools.py" using the bundle's Python interpreter. +:: This executes "bootstrap.py" using the bundle's Python interpreter. set BOOTSTRAP_PYTHON_BIN=%BOOTSTRAP_PATH%\python3\bin\python3.exe call "%BOOTSTRAP_PYTHON_BIN%" "%~dp0bootstrap.py" %BOOTSTRAP_EXTRA_ARGS% diff --git a/update_depot_tools.bat b/update_depot_tools.bat index b4d6b26ba..0aabd9f7e 100644 --- a/update_depot_tools.bat +++ b/update_depot_tools.bat @@ -34,12 +34,15 @@ IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :EOF echo Updating depot_tools... -:: Download git for the first time if it's not present. +:: Trigger generating depot_tools' git wrappers in case they are in a bad state. +:: This can happen if there was a problem installing CIPD packages in the +:: previous attempt to update depot_tools, and the bootstrapping script was not +:: run. call git --version > nul 2>&1 if %ERRORLEVEL% == 0 goto :GIT_UPDATE call "%DEPOT_TOOLS_DIR%bootstrap\win_tools.bat" if errorlevel 1 ( - echo Error updating depot_tools, no revision tool found. + echo Error updating depot_tools - Git not found. exit /b %ERRORLEVEL% ) @@ -65,5 +68,5 @@ if errorlevel 1 ( :: Sync CIPD and CIPD client tools. call "%~dp0\cipd_bin_setup.bat" -:: Update git and python. +:: Update python and generate git wrappers. call "%DEPOT_TOOLS_DIR%bootstrap\win_tools.bat"