Skip to content

Commit

Permalink
Avoid symlinking the contents of /usr into PyPy3 virtualenvs
Browse files Browse the repository at this point in the history
PyPy >= 3.8 supports a standard prefix installation, where older
versions always used a portable/developent style installation.
If this is a standard prefix installation, skip the logic that symlinks
libraries in a portable PyPy distribution.

Fixes: #2309
  • Loading branch information
stefanor committed Mar 5, 2022
1 parent bb3131a commit 3b0557f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ def to_lib(self, src):
def sources(cls, interpreter):
for src in super(PyPy3Posix, cls).sources(interpreter):
yield src
# PyPy >= 3.8 supports a standard prefix installation, where older
# versions always used a portable/developent style installation.
# If this is a standard prefix installation, skip the below:
if interpreter.system_prefix == "/usr":
return
# Also copy/symlink anything under prefix/lib, which, for "portable"
# PyPy builds, includes the tk,tcl runtime and a number of shared
# objects. In distro-specific builds or on conda this should be empty
Expand Down

0 comments on commit 3b0557f

Please sign in to comment.