New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 730649 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Implement thorough Git-wrapper-style probing in vpython.

Project Member Reported by d...@chromium.org, Jun 7 2017

Issue description

Currently, "vpython" probes for the underlying Python binary by searching PATH for a filename. This fails if "vpython" is named something like "python" or "python2.7", as it will infinitely discover and run itself, thinking that it is the wrapper. Replace this naive probing with the thorough probing used by the Infra Git wrapper:

https://chromium.googlesource.com/infra/infra/+/444e6a3f1c2cac2a8b1232aa1321c2f4cc1ae2b0/go/src/infra/tools/git
 

Comment 1 by d...@chromium.org, Jun 7 2017

Cc: iannucci@chromium.org no...@chromium.org
The planned Python probe is "python --version". Note that currently, "vpython" will already call "python --version" on its target executable in order to determine whether or not it is the desired Python version. The plan is to have the "vpython" probe implementation forward the output from its "--version" probe call so that no additional "exec" is necessary.
Project Member

Comment 3 by bugdroid1@chromium.org, Jun 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/external/github.com/luci/luci-go.git/+/5cf5e3db67fbf52c83ae0875d70d58ece1b73b86

commit 5cf5e3db67fbf52c83ae0875d70d58ece1b73b86
Author: dnj <dnj@google.com>
Date: Wed Jun 07 18:15:12 2017

[vpython] Implement smart probing.

Use the "prober" package to enable "vpython" to probe for its
wrapped Python instance without risk of hitting another "vpython"
instance. Previously, identification was just done by name.

This allows "vpython" to be named "python" without infinitely calling
itself.

BUG= chromium:730649 
TEST=local

Review-Url: https://codereview.chromium.org/2925723004

[modify] https://crrev.com/5cf5e3db67fbf52c83ae0875d70d58ece1b73b86/vpython/application/application.go
[add] https://crrev.com/5cf5e3db67fbf52c83ae0875d70d58ece1b73b86/vpython/application/probe.go
[modify] https://crrev.com/5cf5e3db67fbf52c83ae0875d70d58ece1b73b86/vpython/python/find.go
[modify] https://crrev.com/5cf5e3db67fbf52c83ae0875d70d58ece1b73b86/vpython/python/interpreter.go
[modify] https://crrev.com/5cf5e3db67fbf52c83ae0875d70d58ece1b73b86/vpython/venv/config.go
[modify] https://crrev.com/5cf5e3db67fbf52c83ae0875d70d58ece1b73b86/vpython/venv/venv_test.go

Comment 4 by no...@chromium.org, Jun 7 2017

why vpython would be named "python" or "python2.7"?

Comment 5 by d...@chromium.org, Jun 7 2017

Chat w/ iannucci@, possibly actually using it as a Python entry point w/ a default VirtualEnv environment exported by BuildBot / LUCI via environment variable.

Comment 6 by d...@chromium.org, Jun 8 2017

Status: Fixed (was: Untriaged)

Sign in to add a comment