Skip to content

Implement venv support for bootstrap system_python #3245

@rickeylev

Description

@rickeylev

PR #3242 mostly unifies how system_python and script bootstraps work. After that PR, the system_python bootstrap creates a venv-like file structure, except without pyvenv.cfg and bin/python3.

It should be pretty easy to update the code to create a real venv; just remove the codepaths where create_full_venv is false.

This would then make the venv-based implementation the only implementation.

That is overall a net win, however, the raw symlinks and "python home is found via symlink" functionality they rely on have some known friction points:

  • Python 3.9 and earlier don't have the necessary interpreter logic
  • It hasn't been vetted on windows (venv+windows tests are disabled)
  • The runtime_env toolchain can't always detect/activate the venv
  • It requires symlinks being enabled on windows

The fallback work around we have for all of those is to create a temp directory that is run out of. Creating a temp dir at runtime has its own problems (overhead, cleanup, being reaped while running), so I'm hesitant to make it the sole option. Until something like PEP 796 is accepted, things feel a bit dicey.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions