Commit 1b4881c9 authored by Darshan Sen's avatar Darshan Sen Committed by LUCI CQ

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: 's avatarDarshan Sen <raisinten@gmail.com>
Change-Id: Iac167ffe61b04a2836b03e620b98ee97b56965e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3513473Reviewed-by: 's avatarJosip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
parent 8edc960e
...@@ -242,7 +242,7 @@ class Hook(object): ...@@ -242,7 +242,7 @@ class Hook(object):
if cmd[0] == 'python': if cmd[0] == 'python':
cmd[0] = 'vpython' 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' cmd[0] += '.bat'
exit_code = 2 exit_code = 2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment