Skip to content

gh-119696: Support copied virtual environments in relocatable builds - #45

Draft
zaniebot wants to merge 1 commit into
zb/relocatable-flag-ii-boltfrom
zb/relocatable-flag-ii-venv
Draft

zaniebot wants to merge 1 commit into
zb/relocatable-flag-ii-boltfrom
zb/relocatable-flag-ii-venv

Conversation

@zaniebot

@zaniebot zaniebot commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

In a relocatable shared build, copying the interpreter into a virtual environment makes its executable-relative search path point away from libpython in the base installation. PBS tracks this failure in astral-sh/python-build-standalone#381 and the macOS report astral-sh/python-build-standalone#707.

For non-framework shared builds using --enable-relocatable, add a second interpreter search path through lib/python-base, and have venv create that directory symlink when it copies the interpreter. This resolves the runtime library without modifying the copied executable or copying the base installation's libraries into each environment.

The link also allows libpython to find dependencies located in that directory. This requires filesystem support for directory symlinks even with --copies; virtual environments still depend on their base installation and must be recreated if it moves.

Stacked on #56.

@zaniebot
zaniebot force-pushed the zb/relocatable-flag-ii-venv branch 2 times, most recently from 358e598 to af27d32 Compare October 22, 2026 18:50
@zaniebot
zaniebot changed the base branch from zb/relocatable-flag-ii to zb/relocatable-flag-ii-linker October 22, 2026 18:51
@zaniebot
zaniebot force-pushed the zb/relocatable-flag-ii-venv branch from af27d32 to f7aa9d0 Compare October 22, 2026 19:04
@zaniebot
zaniebot force-pushed the zb/relocatable-flag-ii-venv branch from f7aa9d0 to f4d345d Compare October 22, 2026 19:30
@zaniebot
zaniebot force-pushed the zb/relocatable-flag-ii-venv branch from f4d345d to 392ff13 Compare October 22, 2026 22:19
@zaniebot
zaniebot changed the base branch from zb/relocatable-flag-ii-linker to zb/relocatable-flag-ii-bolt October 22, 2026 22:20
@zaniebot
zaniebot force-pushed the zb/relocatable-flag-ii-venv branch from 392ff13 to 776991b Compare October 22, 2026 22:52
@zanieb
zanieb added this pull request to stack #57 October 22, 2026 22:53
@zaniebot
zaniebot removed this pull request from stack #57 October 22, 2026 22:59
@zaniebot
zaniebot added this pull request to stack #58 October 22, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant