Skip to content

Commit 587469a

Browse files
committed
refactor: remove is_bazel_6_4_or_higher
1 parent 135c118 commit 587469a

3 files changed

Lines changed: 1 addition & 24 deletions

File tree

python/private/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ bzl_library(
264264
":pythons_hub_bzl",
265265
":repo_utils_bzl",
266266
":toolchains_repo_bzl",
267-
":util_bzl",
268267
":version_bzl",
269268
"@bazel_features//:features",
270269
],

python/private/python.bzl

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ load(
2929
"sorted_host_platform_names",
3030
"sorted_host_platforms",
3131
)
32-
load(":util.bzl", "IS_BAZEL_6_4_OR_HIGHER")
3332
load(":version.bzl", "version")
3433

3534
def parse_modules(*, module_ctx, logger, _fail = fail):
@@ -932,14 +931,6 @@ def _create_toolchain_attrs_struct(*, tag = None, python_version = None, toolcha
932931
ignore_root_user_error = getattr(tag, "ignore_root_user_error", True),
933932
)
934933

935-
def _get_bazel_version_specific_kwargs():
936-
kwargs = {}
937-
938-
if IS_BAZEL_6_4_OR_HIGHER:
939-
kwargs["environ"] = ["RULES_PYTHON_BZLMOD_DEBUG"]
940-
941-
return kwargs
942-
943934
_defaults = tag_class(
944935
doc = """Tag class to specify the default Python version.""",
945936
attrs = {
@@ -1356,7 +1347,7 @@ python = module_extension(
13561347
"single_version_platform_override": _single_version_platform_override,
13571348
"toolchain": _toolchain,
13581349
},
1359-
**_get_bazel_version_specific_kwargs()
1350+
environ = ["RULES_PYTHON_BZLMOD_DEBUG"],
13601351
)
13611352

13621353
_DEBUG_BUILD_CONTENT = """

python/private/util.bzl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,3 @@ def add_tag(attrs, tag):
7373
IS_BAZEL_7_4_OR_HIGHER = hasattr(native, "legacy_globals")
7474

7575
IS_BAZEL_7_OR_HIGHER = hasattr(native, "starlark_doc_extract")
76-
77-
_marker_rule_to_detect_bazel_6_4_or_higher = rule(implementation = lambda ctx: None)
78-
79-
# Bazel 6.4 and higher have a bug fix where rule names show up in the str()
80-
# of a rule. See
81-
# https://github.com/bazelbuild/bazel/commit/002490b9a2376f0b2ea4a37102c5e94fc50a65ba
82-
# https://github.com/bazelbuild/bazel/commit/443cbcb641e17f7337ccfdecdfa5e69bc16cae55
83-
# This technique is done instead of using native.bazel_version because,
84-
# under stardoc, the native.bazel_version attribute is entirely missing, which
85-
# prevents doc generation from being able to correctly generate docs.
86-
IS_BAZEL_6_4_OR_HIGHER = "_marker_rule_to_detect_bazel_6_4_or_higher" in str(
87-
_marker_rule_to_detect_bazel_6_4_or_higher,
88-
)

0 commit comments

Comments
 (0)