Skip to content

Commit 5539eaf

Browse files
committed
better-pyvenv-fix
1 parent 0b25384 commit 5539eaf

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

‎libexec/bkpyvenv‎

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,23 @@ stage)
3737
poetry config virtualenvs.create true
3838
poetry config virtualenvs.in-project true
3939
else
40-
# --copies: copy the python binary into the venv instead of
41-
# symlinking it. With the default --symlinks behavior the resulting
42-
# `$PREFIX/venv/bin/python` is an absolute symlink to
43-
# `/opt/python.org/v<ver>/bin/python`, which breaks any bottle
44-
# installed somewhere other than /opt (eg. /usr/local/pkgs/...
45-
# via pkgm). See pkgxdev/pantry#8487 for the original report.
46-
python -m venv --copies "$PREFIX"/venv
40+
case "$(uname -s)" in
41+
Linux)
42+
# --copies: copy the python binary into the venv instead of
43+
# symlinking it. With the default --symlinks behavior the resulting
44+
# `$PREFIX/venv/bin/python` is an absolute symlink to
45+
# `/opt/python.org/v<ver>/bin/python`, which breaks any bottle
46+
# installed somewhere other than /opt (eg. /usr/local/pkgs/...
47+
# via pkgm). See pkgxdev/pantry#8487 for the original report.
48+
python -m venv --copies "$PREFIX"/venv
49+
;;
50+
*)
51+
# macOS: --copies breaks signed/framework python binaries.
52+
# The pkgm-relocation problem #8487 doesn't apply on darwin in
53+
# the same way (different runtime resolution)
54+
python -m venv "$PREFIX"/venv
55+
;;
56+
esac
4757
fi
4858
;;
4959
seal)

0 commit comments

Comments
 (0)