Closed Bug 1660351 Opened 4 years ago Closed 4 years ago

Tweak inherit-from-parent-environment implementation in virtualenv.py

Categories

(Firefox Build System :: General, task)

task

Tracking

(firefox82 fixed)

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: rstewart, Assigned: rstewart)

References

Details

Attachments

(1 file)

No description provided.
Blocks: 1660353

The intended behavior of inherit-from-parent-environment is that the packages from the parent Python environment are available to the sub-virtualenv. The implementation of that behavior thus far has been around "site directories", the idea being that custom (non-stdlib) packages are likely to be installed in the "site directory". The limitation of this approach is that there's no one location, in practice, where packages are installed, and it's hard to enumerate a static list of all those possible locations across all platforms.

This patch circumvents the issue by ignoring the "site directory" question entirely and just looking at sys.path. If we're inheriting from the parent environment when creating a virtualenv, we just ask the parent Python what its sys.path is and configure the virtualenv's sys.path on startup.

Pushed by rstewart@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f50e4bee2efb
Tweak `inherit-from-parent-environment` implementation in `virtualenv.py` r=ahal
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch

This PR regressed build on Arch Linux:

0:02.65 File "/projects/mozilla-unified/build/moz.configure/init.configure", line 382, in virtualenv_python3
0:02.65 if not distutils.sysconfig.get_python_lib():
0:02.65 AttributeError: module 'distutils' has no attribute 'sysconfig'
0:02.66 *** Fix above errors and then restart with\
0:02.66 "./mach build"
0:02.66 make: *** [client.mk:115: configure] Error 1
Regressions: 1662130

Bug 1662130 will track that.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: