Skip to content

Commit 4955758

Browse files
tannevaledclaude
andcommitted
fix(bkpyvenv): create relocatable venvs via --copies
Without the flag, `python -m venv` defaults to --symlinks on Linux, so the resulting `$PREFIX/venv/bin/python` is an absolute symlink to the python.org bottle's `/opt/python.org/v<X>/bin/python`. Any bottle installed outside `/opt/` (eg. `/usr/local/pkgs/...` via pkgm) ends up with a broken venv whose python entry point doesn't exist. Pass `--copies` so the python binary is physically copied into the venv instead of symlinked. This is the standard relocation pattern for python venvs and matches what recipes that opt out of `bkpyvenv` already do by hand (eg. pyqt5's recipe calls `python -m venv --copies`). Closes pkgxdev/pantry#8487. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 47eb6dd commit 4955758

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

libexec/bkpyvenv

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ stage)
3737
poetry config virtualenvs.create true
3838
poetry config virtualenvs.in-project true
3939
else
40-
python -m venv "$PREFIX"/venv
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
4147
fi
4248
;;
4349
seal)

0 commit comments

Comments
 (0)