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

Issue 826871 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 825290



Sign in to add a comment

Catapult Presubmit seems to be having PYTHONPATH sadness

Project Member Reported by iannucci@chromium.org, Mar 28 2018

Issue description

This is very likely related to pruning sys.path out of PYTHONPATH ( issue 825290 ).

https://build.chromium.org/p/tryserver.client.catapult/builders/Catapult%20Presubmit/

The remedy is likely to add additional `extra_paths_list` entries to the various PRESUBMIT.py files.
 
(For context, it used to be the case that presubmit would export the entire sys.path from buildbot back into PYTHONPATH, so lots of installed-on-the-system packages and vendored-into-build.git packages were available to presubmit subprocesses).
Cc: d...@chromium.org
Poked at this a bit (https://chromium-review.googlesource.com/c/catapult/+/984721), and it looks like:
  * There are lots of existing errors in the PRESUBMITs for this repo ( :'C )
  * VirtualENV screws with distutils in a way that the current pylint doesn't know how to deal with (meaning that under vpython, pylint thinks that distutils is ~empty).

The first one I think will take someone more familiar with catapult to fully fix (possibly taking inspiration from the CL I uploaded). The second one will take some additional work.

There are a couple ways to fix the second problem. The first way would be to screw (more?) with distutils when installed via vpython. Instead of using virtualenv's... "creative" patch to distutils/__init__ (https://pastebin.com/ecF8Kuzj), vpython would actually copy the underlying system's distutils python bits into the virtualenv. Currently vpython adds a distutils/__init__.py which adjusts its __path__ value so that the sub-modules in distutils get chain-loaded when doing an import. Pylint (at least the version in depot_tools) has no idea how to follow this, and so it just assumes that distutils has no files in it (*facepalm*).

The other way to fix the problem (assuming newer pylints know how to deal with this, which I haven't verified) is to upgrade pylint in depot_tools. This may have further-reaching implications, and we may want to make such an upgrade contingent on the resolution of issue 825426.

Cc: dtu@chromium.org
+dtu in case he's more familiar with this.
Cc: -eakuefner@chromium.org

Sign in to add a comment