Skip to content

Commit 048b495

Browse files
committed
feat(core): switch to script bootstrap as a default
Work towards #2156 Work towards #2521 Relands #2858 and reverts #2968 Fixes #2983
1 parent 0cd9bfa commit 048b495

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ END_UNRELEASED_TEMPLATE
6969
* (bootstrap) For {obj}`--bootstrap_impl=system_python`, the sys.path order has
7070
changed from `[app paths, stdlib, runtime site-packages]` to `[stdlib, app
7171
paths, runtime site-packages]`.
72+
* If using the (deprecated) autodetecting/runtime_env toolchain, then the Python
73+
version specified at build-time *must* match the Python version used at
74+
runtime (the {obj}`--@rules_python//python/config_settings:python_version`
75+
flag and the {attr}`python_version` attribute control the build-time version
76+
for a target). If they don't match, dependencies won't be importable. (Such a
77+
misconfiguration was unlikely to work to begin with; this is called out as an
78+
FYI).
79+
* (rules) {obj}`--bootstrap_impl=script` is the default for non-Windows for bazel 8 and above.
7280

7381
{#v0-0-0-fixed}
7482
### Fixed

docs/api/rules_python/python/config_settings/index.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,12 @@ Values:
245245
::::{bzl:flag} bootstrap_impl
246246
Determine how programs implement their startup process.
247247

248+
The default for this depends on the platform:
249+
* Windows: `system_python` (**always** used)
250+
* Other: `script`
251+
248252
Values:
249-
* `system_python`: (default) Use a bootstrap that requires a system Python available
253+
* `system_python`: Use a bootstrap that requires a system Python available
250254
in order to start programs. This requires
251255
{obj}`PyRuntimeInfo.bootstrap_template` to be a Python program.
252256
* `script`: Use a bootstrap that uses an arbitrary executable script (usually a
@@ -269,6 +273,11 @@ instead.
269273
:::{versionadded} 0.33.0
270274
:::
271275

276+
:::{versionchanged} VERSION_NEXT_FEATURE
277+
* The default for non-Windows changed from `system_python` to `script`.
278+
* On Windows, the value is forced to `system_python`.
279+
:::
280+
272281
::::
273282

274283
::::{bzl:flag} current_config

python/config_settings/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ string_flag(
9090

9191
rp_string_flag(
9292
name = "bootstrap_impl",
93-
build_setting_default = BootstrapImplFlag.SYSTEM_PYTHON,
93+
build_setting_default = BootstrapImplFlag.SCRIPT,
9494
override = select({
9595
# Windows doesn't yet support bootstrap=script, so force disable it
9696
":_is_windows": BootstrapImplFlag.SYSTEM_PYTHON,

0 commit comments

Comments
 (0)