Skip to content

Commit

Permalink
skip linking/copying the stdlib specifically, extensively comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip committed Oct 4, 2021
1 parent 6587467 commit eccacfe
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,18 @@ def to_lib(self, src):
def sources(cls, interpreter):
for src in super(PyPy3Posix, cls).sources(interpreter):
yield src
# 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
# (on PyPy3.8+ it will, like on CPython, hold the stdlib).
host_lib = Path(interpreter.system_prefix) / "lib"
stdlib = Path(interpreter.system_stdlib)
if host_lib.exists() and host_lib.is_dir():
for path in host_lib.iterdir():
if path.is_dir():
if stdlib == path:
# For PyPy3.8+ the stdlib lives in lib/pypy3.8
# We need to avoid creating a symlink to it since that
# will defeat the purpose of a virtualenv
continue
yield PathRefToDest(path, dest=cls.to_lib)

Expand Down

0 comments on commit eccacfe

Please sign in to comment.