From c3a48f9ded25545d5df20421af0d7878be875d2e Mon Sep 17 00:00:00 2001 From: Bruce Dawson Date: Tue, 2 Mar 2021 23:22:14 +0000 Subject: [PATCH] Make autoninja.py handle git bash better If autoninja.py detects that goma is not running when it should be then it prints 'cmd /c exit 1' as the command to be run. This ensures that errorlevel will be set so that the failure will be detected. Unfortunately this doesn't work when running autoninja from git bash. Instead of launching a cmd.exe instance which immediately exits, it launches a cmd.exe instance which the user must manually exit. This change adds quotes so that this works from git bash (which invokes the shell script) as well as from cmd.exe (invoking the batch file). Bug: 868590 Change-Id: I482f22830f9bd4f7b70c51de9647a70d946ec145 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2726085 Reviewed-by: Joe Mason Reviewed-by: Bruce Dawson Reviewed-by: Dirk Pranke Owners-Override: Bruce Dawson Auto-Submit: Bruce Dawson Commit-Queue: Dirk Pranke --- autoninja.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoninja.py b/autoninja.py index 3afdff68ce..424cebb642 100755 --- a/autoninja.py +++ b/autoninja.py @@ -132,7 +132,7 @@ if use_goma: file=sys.stderr) if sys.platform.startswith('win'): # Set an exit code of 1 in the batch file. - print('cmd /c exit 1') + print('cmd "/c exit 1"') else: # Set an exit code of 1 by executing 'false' in the bash script. print('false')