Skip to content

Commit

Permalink
Remove experimental_enable_rule_based_toolchains flag
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Googler authored and copybara-github committed Sep 13, 2024
1 parent de86823 commit 58debbf
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
7 changes: 0 additions & 7 deletions cc/toolchains/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,9 @@
# limitations under the License.

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("@stardoc//stardoc:stardoc.bzl", "stardoc")

bool_flag(
name = "experimental_enable_rule_based_toolchains",
build_setting_default = False,
visibility = ["//visibility:public"],
)

bzl_library(
name = "toolchain_rules",
srcs = glob(["*.bzl"]),
Expand Down
6 changes: 0 additions & 6 deletions cc/toolchains/impl/toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.
"""Implementation of the cc_toolchain rule."""

load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
load(
"//cc/toolchains:cc_toolchain_info.bzl",
"ActionTypeSetInfo",
Expand Down Expand Up @@ -52,9 +51,6 @@ def _cc_toolchain_config_impl(ctx):
if ctx.attr.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(
label = ctx.label,
known_features = ctx.attr.known_features + [ctx.attr._builtin_features],
Expand Down Expand Up @@ -101,9 +97,7 @@ cc_toolchain_config = rule(
"args": attr.label_list(providers = [ArgsListInfo]),
"known_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"),
"_enabled": attr.label(default = "//cc/toolchains:experimental_enable_rule_based_toolchains"),
},
provides = [ToolchainConfigInfo],
)
1 change: 0 additions & 1 deletion tests/rule_based_toolchain/toolchain_config/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ util.helper_target(
],
enabled_features = [":simple_feature"],
known_features = [":compile_feature"],
skip_experimental_flag_validation_for_test = True,
tool_map = ":compile_tool_map",
)

Expand Down

0 comments on commit 58debbf

Please sign in to comment.