Skip to content

Commit 15b5da7

Browse files
authored
build: remove no-op _native_rules_allowlist (#3275)
Remove `_native_rules_allowlist` attribute as it is no-op This is needed to allow removing the deprecated flag `--native_rules_allowlist` from bazel. Work towards: #3252
1 parent ea4b040 commit 15b5da7

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

python/private/attributes.bzl

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,9 @@ load(":common_labels.bzl", "labels")
2121
load(":enum.bzl", "enum")
2222
load(":flags.bzl", "PrecompileFlag", "PrecompileSourceRetentionFlag")
2323
load(":py_info.bzl", "PyInfo")
24-
load(":py_internal.bzl", "py_internal")
2524
load(":reexports.bzl", "BuiltinPyInfo")
2625
load(":rule_builders.bzl", "ruleb")
2726

28-
_PackageSpecificationInfo = getattr(py_internal, "PackageSpecificationInfo", None)
29-
3027
# Due to how the common exec_properties attribute works, rules must add exec
3128
# groups even if they don't actually use them. This is due to two interactions:
3229
# 1. Rules give an error if users pass an unsupported exec group.
@@ -174,33 +171,9 @@ This is because Python has a concept of runtime resources.
174171
),
175172
}
176173

177-
def _create_native_rules_allowlist_attrs():
178-
if py_internal:
179-
# The fragment and name are validated when configuration_field is called
180-
default = configuration_field(
181-
fragment = "py",
182-
name = "native_rules_allowlist",
183-
)
184-
185-
# A None provider isn't allowed
186-
providers = [_PackageSpecificationInfo]
187-
else:
188-
default = None
189-
providers = []
190-
191-
return {
192-
"_native_rules_allowlist": lambda: attrb.Label(
193-
default = default,
194-
providers = providers,
195-
),
196-
}
197-
198-
NATIVE_RULES_ALLOWLIST_ATTRS = _create_native_rules_allowlist_attrs()
199-
200174
# Attributes common to all rules.
201175
COMMON_ATTRS = dicts.add(
202176
DATA_ATTRS,
203-
NATIVE_RULES_ALLOWLIST_ATTRS,
204177
# buildifier: disable=attr-licenses
205178
{
206179
# NOTE: This attribute is deprecated and slated for removal.

python/private/py_runtime_rule.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
load("@bazel_skylib//lib:dicts.bzl", "dicts")
1717
load("@bazel_skylib//lib:paths.bzl", "paths")
1818
load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
19-
load(":attributes.bzl", "NATIVE_RULES_ALLOWLIST_ATTRS")
2019
load(":common_labels.bzl", "labels")
2120
load(":flags.bzl", "FreeThreadedFlag")
2221
load(":py_internal.bzl", "py_internal")
@@ -191,7 +190,6 @@ py_runtime(
191190
""",
192191
fragments = ["py"],
193192
attrs = dicts.add(
194-
{k: v().build() for k, v in NATIVE_RULES_ALLOWLIST_ATTRS.items()},
195193
{
196194
"abi_flags": attr.string(
197195
default = "<AUTO>",

0 commit comments

Comments
 (0)