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 3380bad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changelog/2310.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Avoid symlinking the contents of ``/usr`` into PyPy3.8+ virtualenvs - by :user:`stefanor`.
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 3380bad

Please sign in to comment.