Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ END_UNRELEASED_TEMPLATE
* (toolchains) use "command -v" to find interpreter in `$PATH`
([#3150](https://github.com/bazel-contrib/rules_python/pull/3150)).
* (pypi) `bazel vendor` now works in `bzlmod` ({gh-issue}`3079`).
* (core) builds work again on `7.x` `WORKSPACE` configurations
([#3119](https://github.com/bazel-contrib/rules_python/issues/3119)).

{#v0-0-0-added}
### Added
Expand Down
8 changes: 6 additions & 2 deletions python/private/py_executable.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@ def _create_stage1_bootstrap(
is_for_zip,
runtime_details,
venv = None):
"""Create a legacy bootstrap script that is written in Python."""
runtime = runtime_details.effective_runtime

if venv:
Expand All @@ -805,8 +806,11 @@ def _create_stage1_bootstrap(

python_binary_actual = venv.interpreter_actual_path if venv else ""

# Runtime may be None on Windows due to the --python_path flag.
if runtime and runtime.supports_build_time_venv:
# Guard against the following:
# * Runtime may be None on Windows due to the --python_path flag.
# * Runtime may not have 'supports_build_time_venv' if a really old version is autoloaded
# on bazel 7.6.x.
if runtime and getattr(runtime, "supports_build_time_venv", False):
resolve_python_binary_at_runtime = "0"
else:
resolve_python_binary_at_runtime = "1"
Expand Down