Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make sys.executable work with script bootstrap #2409

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rickeylev
Copy link
Contributor

@rickeylev rickeylev commented Nov 14, 2024

When --bootstrap_impl=script is used, PYTHONPATH is no longer used to set the import
paths, which means subprocesses no longer inherit the Bazel paths. This is generally a
good thing, but breaks when sys.executable is used to directly invoke the interpreter.
Such an invocation assumes the interpreter will have the same packages available and works
with the system_python bootstrap.

To fix, have the script bootstrap use a virtual env. This allows it to intercept interpreter
startup even when the Bazel executable isn't invoked.

DO NOT MERGE:

  • Update VERSION_NEXT markers
  • Remove ## markers from stage2 bootstrap

Fixes #2169

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.

plain invocation of python subprocess doesn't inherit sys.path for bootstrap_impl=script
1 participant