From 584d6cc9df9902885c6eb6be3eb9d9aa2848b2a6 Mon Sep 17 00:00:00 2001 From: Greg Estren Date: Wed, 30 Jul 2025 18:47:41 +0000 Subject: [PATCH 1/5] configurations/** cleanups: - Remove _allowlist_function_transition attribute: no longer required since https://github.com/bazelbuild/bazel/commit/bb7fb2d32f055f2a70a5ab394cf5aef29bc74b2e (Bazel 7.0+) - WORKSPACE -> MODULE.bazel --- configurations/WORKSPACE | 1 - .../attaching_transitions_to_rules/defs.bzl | 6 ------ configurations/cc_binary_selectable_copts/defs.bzl | 11 ----------- configurations/cc_test/README.md | 3 +-- configurations/cc_test/defs.bzl | 3 --- configurations/multi_arch_binary/defs.bzl | 6 ------ configurations/read_attr_in_transition/defs.bzl | 3 --- configurations/transition_on_native_flag/defs.bzl | 6 ------ 8 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 configurations/WORKSPACE diff --git a/configurations/WORKSPACE b/configurations/WORKSPACE deleted file mode 100644 index 1fc7a6a83..000000000 --- a/configurations/WORKSPACE +++ /dev/null @@ -1 +0,0 @@ -# Marker that this folder is the root of a Bazel workspace. diff --git a/configurations/attaching_transitions_to_rules/defs.bzl b/configurations/attaching_transitions_to_rules/defs.bzl index 14944c60e..385f48adf 100644 --- a/configurations/attaching_transitions_to_rules/defs.bzl +++ b/configurations/attaching_transitions_to_rules/defs.bzl @@ -52,12 +52,6 @@ shirt = rule( # Use a private attribute (one that is prefixed with "_") so that target writers # can't override the value. "_color": attr.label(default = ":color"), - # This attribute is required to use starlark transitions. It allows - # allowlisting usage of this rule. For more information, see - # https://bazel.build/extending/config#user-defined-transitions - "_allowlist_function_transition": attr.label( - default = "@bazel_tools//tools/allowlists/function_transition_allowlist", - ), }, ) diff --git a/configurations/cc_binary_selectable_copts/defs.bzl b/configurations/cc_binary_selectable_copts/defs.bzl index 337d76af2..b39d90c0f 100644 --- a/configurations/cc_binary_selectable_copts/defs.bzl +++ b/configurations/cc_binary_selectable_copts/defs.bzl @@ -56,17 +56,6 @@ transition_rule = rule( # Note specificaly how it's configured with _copt_transition, which # ensures that setting propagates down the graph. "actual_binary": attr.label(cfg = _copt_transition), - # This is a stock Bazel requirement for any rule that uses Starlark - # transitions. It's okay to copy the below verbatim for all such rules. - # - # The purpose of this requirement is to give the ability to restrict - # which packages can invoke these rules, since Starlark transitions - # make much larger graphs possible that can have memory and performance - # consequences for your build. The allowlist defaults to "everything". - # But you can redefine it more strictly if you feel that's prudent. - "_allowlist_function_transition": attr.label( - default = "@bazel_tools//tools/allowlists/function_transition_allowlist", - ), }, # Making this executable means it works with "$ bazel run". executable = True, diff --git a/configurations/cc_test/README.md b/configurations/cc_test/README.md index 1ebebe33d..664fd9a52 100644 --- a/configurations/cc_test/README.md +++ b/configurations/cc_test/README.md @@ -1,5 +1,4 @@ -### Example showing how to use [Starlark configuration](https://bazel.build/extending/config) to write a -`cc_test` wrapper with a starlark transition +### Example showing how to use [Starlark configuration](https://bazel.build/extending/config) to write a`cc_test` wrapper with a starlark transition the `test_arg_cc_test` macro in `defs.bzl` defines a wrapper for basically a `cc_test` that has been transitioned. This allows, e.g., the test itself to select attribute values based on the value of that transition. There is some diff --git a/configurations/cc_test/defs.bzl b/configurations/cc_test/defs.bzl index 6d47a43da..10ec7a32b 100644 --- a/configurations/cc_test/defs.bzl +++ b/configurations/cc_test/defs.bzl @@ -32,9 +32,6 @@ transition_rule_test = rule( implementation = _test_transition_rule_impl, attrs = { "actual_test": attr.label(cfg = "target", executable = True), - "_allowlist_function_transition": attr.label( - default = "@bazel_tools//tools/allowlists/function_transition_allowlist", - ), }, test = True, ) diff --git a/configurations/multi_arch_binary/defs.bzl b/configurations/multi_arch_binary/defs.bzl index 11cdc62ef..4de9a0f40 100644 --- a/configurations/multi_arch_binary/defs.bzl +++ b/configurations/multi_arch_binary/defs.bzl @@ -38,12 +38,6 @@ foo_binary = rule( implementation = _rule_impl, attrs = { "tool": attr.label(cfg = fat_transition), - # This attribute is required to use Starlark transitions. It allows - # allowlisting usage of this rule. For more information, see - # https://bazel.build/extending/config#user-defined-transitions. - "_allowlist_function_transition": attr.label( - default = "@bazel_tools//tools/allowlists/function_transition_allowlist", - ), }, ) diff --git a/configurations/read_attr_in_transition/defs.bzl b/configurations/read_attr_in_transition/defs.bzl index 4cd8409bf..1c3b39353 100644 --- a/configurations/read_attr_in_transition/defs.bzl +++ b/configurations/read_attr_in_transition/defs.bzl @@ -28,8 +28,5 @@ my_rule = rule( attrs = { "do_transition": attr.bool(), "_some_string": attr.label(default = Label("//read_attr_in_transition:some-string")), - "_allowlist_function_transition": attr.label( - default = "@bazel_tools//tools/allowlists/function_transition_allowlist", - ), }, ) diff --git a/configurations/transition_on_native_flag/defs.bzl b/configurations/transition_on_native_flag/defs.bzl index 8bac50fe1..3a8a61579 100644 --- a/configurations/transition_on_native_flag/defs.bzl +++ b/configurations/transition_on_native_flag/defs.bzl @@ -32,12 +32,6 @@ cpu_rule = rule( # the configuration of this target, which the target's descendents will inherit. cfg = cpu_transition, attrs = { - # This attribute is required to use starlark transitions. It allows - # allowlisting usage of this rule. For more information, see - # https://bazel.build/extending/config#user-defined-transitions - "_allowlist_function_transition": attr.label( - default = "@bazel_tools//tools/allowlists/function_transition_allowlist", - ), "cpu": attr.string(default = "x86"), }, ) From 7dd22250d9e02485e62f410c64778e73fd8f59c1 Mon Sep 17 00:00:00 2001 From: Greg Estren Date: Wed, 30 Jul 2025 18:52:00 +0000 Subject: [PATCH 2/5] Put WORKsPACE back since we already have a MODULE.bazel. --- configurations/WORKSPACE | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 configurations/WORKSPACE diff --git a/configurations/WORKSPACE b/configurations/WORKSPACE new file mode 100644 index 000000000..e69de29bb From 54885c08c342ddcbd42d0387cd77256848c81e7e Mon Sep 17 00:00:00 2001 From: Greg Estren Date: Wed, 30 Jul 2025 18:53:00 +0000 Subject: [PATCH 3/5] WORKSPACE contents. --- configurations/WORKSPACE | 1 + 1 file changed, 1 insertion(+) diff --git a/configurations/WORKSPACE b/configurations/WORKSPACE index e69de29bb..1fc7a6a83 100644 --- a/configurations/WORKSPACE +++ b/configurations/WORKSPACE @@ -0,0 +1 @@ +# Marker that this folder is the root of a Bazel workspace. From e5517b039cef3294506320b9577e3c35921a85a3 Mon Sep 17 00:00:00 2001 From: Greg Date: Fri, 1 Aug 2025 15:50:54 -0400 Subject: [PATCH 4/5] Update configurations/cc_test/README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Xùdōng Yáng --- configurations/cc_test/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configurations/cc_test/README.md b/configurations/cc_test/README.md index 664fd9a52..30ee75b3f 100644 --- a/configurations/cc_test/README.md +++ b/configurations/cc_test/README.md @@ -1,4 +1,4 @@ -### Example showing how to use [Starlark configuration](https://bazel.build/extending/config) to write a`cc_test` wrapper with a starlark transition +### Example showing how to use [Starlark configuration](https://bazel.build/extending/config) to write a `cc_test` wrapper with a starlark transition the `test_arg_cc_test` macro in `defs.bzl` defines a wrapper for basically a `cc_test` that has been transitioned. This allows, e.g., the test itself to select attribute values based on the value of that transition. There is some From bd295f0bd7a7c16bc24c35ea186a84f1870bc026 Mon Sep 17 00:00:00 2001 From: Greg Estren Date: Fri, 1 Aug 2025 19:57:17 +0000 Subject: [PATCH 5/5] Remove WORKSPACE. --- configurations/WORKSPACE | 1 - 1 file changed, 1 deletion(-) delete mode 100644 configurations/WORKSPACE diff --git a/configurations/WORKSPACE b/configurations/WORKSPACE deleted file mode 100644 index 1fc7a6a83..000000000 --- a/configurations/WORKSPACE +++ /dev/null @@ -1 +0,0 @@ -# Marker that this folder is the root of a Bazel workspace.