diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java b/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java index 693627323f0024..2dc55914ac06b3 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java @@ -708,18 +708,6 @@ public boolean useBaselineForOutputDirectoryNamingScheme() { + "Specifying - will disable the feature. " + "Negative features always override positive ones.") public List hostFeatures; - - @Option( - name = "incompatible_use_host_features", - defaultValue = "true", - documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS, - effectTags = {OptionEffectTag.CHANGES_INPUTS, OptionEffectTag.AFFECTS_OUTPUTS}, - metadataTags = {OptionMetadataTag.INCOMPATIBLE_CHANGE}, - help = - "If true, use --features only for the target configuration and --host_features for the" - + " exec configuration.") - public boolean incompatibleUseHostFeatures; - @Option( name = "target_environment", converter = LabelListConverter.class, diff --git a/src/main/starlark/builtins_bzl/common/builtin_exec_platforms.bzl b/src/main/starlark/builtins_bzl/common/builtin_exec_platforms.bzl index aafac7efcf62de..d5f647535b4244 100644 --- a/src/main/starlark/builtins_bzl/common/builtin_exec_platforms.bzl +++ b/src/main/starlark/builtins_bzl/common/builtin_exec_platforms.bzl @@ -209,18 +209,14 @@ bazel_fragments["ConfigFeatureFlagOptions"] = fragment( ) def _core_options(settings): - ans = { + return { "//command_line_option:compilation_mode": settings["//command_line_option:host_compilation_mode"], "//command_line_option:is exec configuration": True, "//command_line_option:cpu": settings["//command_line_option:host_cpu"], "//command_line_option:stamp": False, "//command_line_option:action_env": settings["//command_line_option:host_action_env"], + "//command_line_option:features": settings["//command_line_option:host_features"], } - if settings["//command_line_option:incompatible_use_host_features"]: - ans["//command_line_option:features"] = settings["//command_line_option:host_features"] - else: - ans["//command_line_option:features"] = settings["//command_line_option:features"] - return ans bazel_fragments["CoreOptions"] = fragment( propagate = [ @@ -247,7 +243,6 @@ bazel_fragments["CoreOptions"] = fragment( "//command_line_option:strict_filesets", "//command_line_option:check_visibility", "//command_line_option:check_licenses", - "//command_line_option:incompatible_use_host_features", "//command_line_option:host_features", "//command_line_option:host_action_env", "//command_line_option:archived_tree_artifact_mnemonics_filter", diff --git a/src/test/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetTest.java b/src/test/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetTest.java index 8d0b97abfb3519..43497d608cd47d 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetTest.java @@ -71,20 +71,6 @@ public void testHostFeatures() throws Exception { assertThat(features).contains("host_feature"); assertThat(features).doesNotContain("feature"); } - - @Test - public void testHostFeaturesIncompatibleDisabled() throws Exception { - useConfiguration( - "--features=feature", - "--host_features=host_feature", - "--incompatible_use_host_features=false"); - scratch.file("a/BUILD", "cc_library(name = 'a')"); - ImmutableSet features = - getRuleContext(getConfiguredTarget("//a", getExecConfiguration())).getFeatures(); - assertThat(features).contains("feature"); - assertThat(features).doesNotContain("host_feature"); - } - @Test public void testFeatureDisabledOnCommandLine() throws Exception { useConfiguration("--features=-feature");