Remove experimental_enable_rule_based_toolchains flag

BEGIN_PUBLIC

Remove experimental_enable_rule_based_toolchains flag

Rule-based toolchains will not be gated by a flag when released with rules_cc v0.0.10. Also, this flag is unfortunately inherently incompatible with --experimental_exclude_starlark_flags_from_exec_config.

END_PUBLIC

PiperOrigin-RevId: 674072362
Change-Id: Iebda45d4daf4cec27c48296d61092dc513442911
This commit is contained in:
Googler 2024-09-12 17:30:42 -07:00 committed by Copybara-Service
parent de86823dde
commit 58debbffe4
3 changed files with 0 additions and 14 deletions

View File

@ -13,16 +13,9 @@
# limitations under the License. # limitations under the License.
load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("@bazel_skylib//rules:diff_test.bzl", "diff_test") load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
load("@stardoc//stardoc:stardoc.bzl", "stardoc") load("@stardoc//stardoc:stardoc.bzl", "stardoc")
bool_flag(
name = "experimental_enable_rule_based_toolchains",
build_setting_default = False,
visibility = ["//visibility:public"],
)
bzl_library( bzl_library(
name = "toolchain_rules", name = "toolchain_rules",
srcs = glob(["*.bzl"]), srcs = glob(["*.bzl"]),

View File

@ -13,7 +13,6 @@
# limitations under the License. # limitations under the License.
"""Implementation of the cc_toolchain rule.""" """Implementation of the cc_toolchain rule."""
load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
load( load(
"//cc/toolchains:cc_toolchain_info.bzl", "//cc/toolchains:cc_toolchain_info.bzl",
"ActionTypeSetInfo", "ActionTypeSetInfo",
@ -52,9 +51,6 @@ def _cc_toolchain_config_impl(ctx):
if ctx.attr.features: if ctx.attr.features:
fail("Features is a reserved attribute in bazel. Did you mean 'known_features' or 'enabled_features'?") fail("Features is a reserved attribute in bazel. Did you mean 'known_features' or 'enabled_features'?")
if not ctx.attr._enabled[BuildSettingInfo].value and not ctx.attr.skip_experimental_flag_validation_for_test:
fail("Rule based toolchains are experimental. To use it, please add --@rules_cc//cc/toolchains:experimental_enable_rule_based_toolchains to your bazelrc")
toolchain_config = toolchain_config_info( toolchain_config = toolchain_config_info(
label = ctx.label, label = ctx.label,
known_features = ctx.attr.known_features + [ctx.attr._builtin_features], known_features = ctx.attr.known_features + [ctx.attr._builtin_features],
@ -101,9 +97,7 @@ cc_toolchain_config = rule(
"args": attr.label_list(providers = [ArgsListInfo]), "args": attr.label_list(providers = [ArgsListInfo]),
"known_features": attr.label_list(providers = [FeatureSetInfo]), "known_features": attr.label_list(providers = [FeatureSetInfo]),
"enabled_features": attr.label_list(providers = [FeatureSetInfo]), "enabled_features": attr.label_list(providers = [FeatureSetInfo]),
"skip_experimental_flag_validation_for_test": attr.bool(default = False),
"_builtin_features": attr.label(default = "//cc/toolchains/features:all_builtin_features"), "_builtin_features": attr.label(default = "//cc/toolchains/features:all_builtin_features"),
"_enabled": attr.label(default = "//cc/toolchains:experimental_enable_rule_based_toolchains"),
}, },
provides = [ToolchainConfigInfo], provides = [ToolchainConfigInfo],
) )

View File

@ -63,7 +63,6 @@ util.helper_target(
], ],
enabled_features = [":simple_feature"], enabled_features = [":simple_feature"],
known_features = [":compile_feature"], known_features = [":compile_feature"],
skip_experimental_flag_validation_for_test = True,
tool_map = ":compile_tool_map", tool_map = ":compile_tool_map",
) )