Skip to content

Commit 42dac20

Browse files
committed
conditional support for the bootstrap=script
1 parent 048b495 commit 42dac20

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

python/config_settings/BUILD.bazel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ load(
1313
"VenvsUseDeclareSymlinkFlag",
1414
rp_string_flag = "string_flag",
1515
)
16+
load("//python/private:util.bzl", "IS_BAZEL_8_OR_HIGHER")
1617
load(
1718
"//python/private/pypi:flags.bzl",
1819
"UniversalWhlFlag",
@@ -90,7 +91,7 @@ string_flag(
9091

9192
rp_string_flag(
9293
name = "bootstrap_impl",
93-
build_setting_default = BootstrapImplFlag.SCRIPT,
94+
build_setting_default = BootstrapImplFlag.SCRIPT if IS_BAZEL_8_OR_HIGHER else BootstrapImplFlag.SYSTEM_PYTHON,
9495
override = select({
9596
# Windows doesn't yet support bootstrap=script, so force disable it
9697
":_is_windows": BootstrapImplFlag.SYSTEM_PYTHON,

python/private/util.bzl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ def define_bazel_6_provider(doc, fields, **kwargs):
9999
return provider("Stub, not used", fields = []), None
100100
return provider(doc = doc, fields = fields, **kwargs)
101101

102+
# Only bazel 8 can distinguish symlinks within the file depsets.
103+
IS_BAZEL_8_OR_HIGHER = hasattr(config, "none")
104+
102105
IS_BAZEL_7_4_OR_HIGHER = hasattr(native, "legacy_globals")
103106

104107
IS_BAZEL_7_OR_HIGHER = hasattr(native, "starlark_doc_extract")

0 commit comments

Comments
 (0)