From 3b0557f743361f9d3f78ec49966cb98b3099d328 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Fri, 4 Mar 2022 21:04:04 -0400 Subject: [PATCH] Avoid symlinking the contents of /usr into PyPy3 virtualenvs 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 --- src/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py b/src/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py index f1726ec96..cc72c1459 100644 --- a/src/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py +++ b/src/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py @@ -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