From 5de16231c29bd674a2b2c3d92b81a5ed2567e9d8 Mon Sep 17 00:00:00 2001 From: Richard Lavoie Date: Sat, 4 Jul 2026 09:35:01 -0400 Subject: [PATCH 1/4] Support for * in toolchains_aspects --- features.bzl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/features.bzl b/features.bzl index 61bf180..2cee15e 100644 --- a/features.bzl +++ b/features.bzl @@ -10,6 +10,13 @@ _apple = struct( xcode_config_migrated = ge("8.0.0"), ) +_aspects = struct( + # Whether toolchains_aspects accept "*" to propagate to all toolchains + # 8.8.0 : https://github.com/bazelbuild/bazel/commit/dd6a292e2b160bbd35b9d9b67d21971f4efeb94c + # 9.2.0+ : https://github.com/bazelbuild/bazel/commit/584eeed4de4e0c76e451d0212ab582e2109ceacb + supports_toolchains_aspects_star = ge_same_major("8.8.0") or ge("9.2.0-rc.1") +) + _cc = struct( # Whether @bazel_tools//tools/cpp:optional_current_cc_toolchain and the `mandatory` parameter # on find_cpp_toolchain are available (#17308). @@ -217,6 +224,7 @@ _toolchains = struct( bazel_features = struct( apple = _apple, + aspects = _aspects, cc = _cc, docs = _docs, external_deps = _external_deps, From a8bd819fdcff8c3e24df1f787412f37832d6007c Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Mon, 6 Jul 2026 16:25:08 +0200 Subject: [PATCH 2/4] Apply suggestion from @fmeum --- features.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features.bzl b/features.bzl index 2cee15e..03b39b7 100644 --- a/features.bzl +++ b/features.bzl @@ -14,7 +14,7 @@ _aspects = struct( # Whether toolchains_aspects accept "*" to propagate to all toolchains # 8.8.0 : https://github.com/bazelbuild/bazel/commit/dd6a292e2b160bbd35b9d9b67d21971f4efeb94c # 9.2.0+ : https://github.com/bazelbuild/bazel/commit/584eeed4de4e0c76e451d0212ab582e2109ceacb - supports_toolchains_aspects_star = ge_same_major("8.8.0") or ge("9.2.0-rc.1") + supports_toolchains_aspects_star = ge_same_major("8.8.0") or ge("9.2.0rc1") ) _cc = struct( From 470576c52d61f809a6e6ca1dd936ba9aceeb7385 Mon Sep 17 00:00:00 2001 From: Richard Lavoie Date: Mon, 6 Jul 2026 11:23:55 -0400 Subject: [PATCH 3/4] Move feature to rules --- features.bzl | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/features.bzl b/features.bzl index 03b39b7..ad2d4ef 100644 --- a/features.bzl +++ b/features.bzl @@ -10,13 +10,6 @@ _apple = struct( xcode_config_migrated = ge("8.0.0"), ) -_aspects = struct( - # Whether toolchains_aspects accept "*" to propagate to all toolchains - # 8.8.0 : https://github.com/bazelbuild/bazel/commit/dd6a292e2b160bbd35b9d9b67d21971f4efeb94c - # 9.2.0+ : https://github.com/bazelbuild/bazel/commit/584eeed4de4e0c76e451d0212ab582e2109ceacb - supports_toolchains_aspects_star = ge_same_major("8.8.0") or ge("9.2.0rc1") -) - _cc = struct( # Whether @bazel_tools//tools/cpp:optional_current_cc_toolchain and the `mandatory` parameter # on find_cpp_toolchain are available (#17308). @@ -71,7 +64,6 @@ _cc = struct( # Internal only, don't use outside rules_cc. # https://github.com/bazelbuild/bazel/commit/d788aa269a3300771696a0f9e00868a43cadf7d3 _get_link_args_has_param_file_name = ge("10.0.0-pre.20260608.1"), - ) _docs = struct( @@ -205,6 +197,11 @@ _rules = struct( # TODO: Use a larger version range after cherry-picking # https://github.com/bazelbuild/bazel/commit/e81949554f3ecab5e2c4afd79031f498f36427fe _has_launcher_maker_toolchain = ge_same_major("8.3.0") or ge("9.0.0-pre.20250516.1"), + + # Whether toolchains_aspects accept "*" to propagate to all toolchains + # 8.8.0 : https://github.com/bazelbuild/bazel/commit/dd6a292e2b160bbd35b9d9b67d21971f4efeb94c + # 9.2.0+ : https://github.com/bazelbuild/bazel/commit/584eeed4de4e0c76e451d0212ab582e2109ceacb + supports_toolchains_aspects_star = ge_same_major("8.8.0") or ge("9.2.0rc1"), ) _toolchains = struct( @@ -224,7 +221,6 @@ _toolchains = struct( bazel_features = struct( apple = _apple, - aspects = _aspects, cc = _cc, docs = _docs, external_deps = _external_deps, From 982d773e9267933374d3ebe54c4d6f9c12540040 Mon Sep 17 00:00:00 2001 From: Richard Lavoie Date: Mon, 6 Jul 2026 11:45:42 -0400 Subject: [PATCH 4/4] keep internal feature last --- features.bzl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/features.bzl b/features.bzl index ad2d4ef..6387f73 100644 --- a/features.bzl +++ b/features.bzl @@ -193,15 +193,15 @@ _rules = struct( # https://github.com/bazelbuild/bazel/commit/a59ad366453bb731b255916277d34d5d536ca696 constraint_setting_has_refines_constraint_value = gt("10.0.0-pre.20260524.1"), - # Internal only, don't use outside rules_java, rules_python & rules_shell. - # TODO: Use a larger version range after cherry-picking - # https://github.com/bazelbuild/bazel/commit/e81949554f3ecab5e2c4afd79031f498f36427fe - _has_launcher_maker_toolchain = ge_same_major("8.3.0") or ge("9.0.0-pre.20250516.1"), - # Whether toolchains_aspects accept "*" to propagate to all toolchains # 8.8.0 : https://github.com/bazelbuild/bazel/commit/dd6a292e2b160bbd35b9d9b67d21971f4efeb94c # 9.2.0+ : https://github.com/bazelbuild/bazel/commit/584eeed4de4e0c76e451d0212ab582e2109ceacb supports_toolchains_aspects_star = ge_same_major("8.8.0") or ge("9.2.0rc1"), + + # Internal only and keep last, don't use outside rules_java, rules_python & rules_shell. + # TODO: Use a larger version range after cherry-picking + # https://github.com/bazelbuild/bazel/commit/e81949554f3ecab5e2c4afd79031f498f36427fe + _has_launcher_maker_toolchain = ge_same_major("8.3.0") or ge("9.0.0-pre.20250516.1"), ) _toolchains = struct(