Bug 1670039 - Always call virtualenv with python -S. r=firefox-build-system-reviewers,perftest-reviewers,mhentges

It disables site modules from the caller python, which are irrelevant
anyways as virtualenv is self-contained.

Differential Revision: https://phabricator.services.mozilla.com/D93064
This commit is contained in:
Mike Hommey 2020-10-09 15:39:22 +00:00
Родитель 0c7b531573
Коммит 6d61924d28
5 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -250,7 +250,7 @@ class VirtualenvManager(VirtualenvHelper):
if os.path.exists(self.virtualenv_root):
shutil.rmtree(self.virtualenv_root)
args = [python, self.virtualenv_script_path,
args = [python, '-S', self.virtualenv_script_path,
# Without this, virtualenv.py may attempt to contact the outside
# world and search for or download a newer version of pip,
# setuptools, or wheel. This is bad for security, reproducibility,

Просмотреть файл

@ -381,6 +381,7 @@ class VirtualenvMixin(object):
virtualenv = [
sys.executable,
'-S',
venv_py_path,
]
virtualenv_options = c.get('virtualenv_options', [])

Просмотреть файл

@ -154,7 +154,7 @@ class RaptorRunner(MozbuildObject):
'base_work_dir': self.mozharness_dir,
'exes': {
'python': self.python,
'virtualenv': [self.python, self.virtualenv_script],
'virtualenv': [self.python, '-S', self.virtualenv_script],
},
'title': socket.gethostname(),
'default_actions': default_actions,

Просмотреть файл

@ -80,7 +80,7 @@ class TalosRunner(MozbuildObject):
'base_work_dir': self.mozharness_dir,
'exes': {
'python': self.python_interp,
'virtualenv': [self.python_interp, self.virtualenv_script]
'virtualenv': [self.python_interp, '-S', self.virtualenv_script]
},
'title': socket.gethostname(),
'default_actions': default_actions,

Просмотреть файл

@ -75,7 +75,7 @@ def setup_virtualenv(target, python_bin=None):
f.extractall(here)
print('Creating new virtual environment')
cmd_args = [sys.executable, script_path, target]
cmd_args = [sys.executable, '-S', script_path, target]
if python_bin:
cmd_args.extend(['-p', python_bin])