From 1b4881c9300a81bac80eace84caa2c10c2e41fa5 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Wed, 9 Mar 2022 17:42:49 +0000 Subject: [PATCH] Fix vpython3 version mismatch error I ran into this error coming from the gclient.py script when I was trying to run it on a Cygwin setup on Windows: ... ________ running 'vpython.bat -vpython-spec src/.vpython -vpython-tool install' in '/c/Users/circleci/project' Hook 'vpython.bat -vpython-spec src/.vpython -vpython-tool install' took 34.10 secs ________ running 'vpython3 -vpython-spec src/.vpython3 -vpython-tool install' in '/c/Users/circleci/project' [E2022-02-17T07:07:56.374746Z 10204 0 annotate.go:273] goroutine 1: #0 go.chromium.org/luci/vpython/venv/config.go:309 - venv.(*Config).resolvePythonInterpreter() reason: none of [C:/Users/circleci/project/vendor/depot_tools/bootstrap-2@3_8_10_chromium_23_binpython3bin/python3] matched specification 3.8.0 #1 go.chromium.org/luci/vpython/venv/config.go:153 - venv.(*Config).resolveRuntime() reason: failed to resolve system Python interpreter #2 go.chromium.org/luci/vpython/venv/venv.go:143 - venv.With() reason: failed to resolve python runtime #3 go.chromium.org/luci/vpython/application/subcommand_install.go:61 - application.(*installCommandRun).Run.func1() reason: failed to setup the environment ... Similar to the Windows-only "vpython" -> "vpython.bat" modification, I added the necessary code to do it for vpython3 too, i.e., "vpython3" -> "vpython3.bat", and it fixed the problem for me. Signed-off-by: Darshan Sen Change-Id: Iac167ffe61b04a2836b03e620b98ee97b56965e1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3513473 Reviewed-by: Josip Sokcevic Commit-Queue: Josip Sokcevic --- gclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gclient.py b/gclient.py index 83fcbbd9d..c2a6fb349 100755 --- a/gclient.py +++ b/gclient.py @@ -242,7 +242,7 @@ class Hook(object): if cmd[0] == 'python': cmd[0] = 'vpython' - if cmd[0] == 'vpython' and _detect_host_os() == 'win': + if (cmd[0] in ['vpython', 'vpython3']) and _detect_host_os() == 'win': cmd[0] += '.bat' exit_code = 2