Skip to content

Commit

Permalink
Remove --incompatible_use_host_features.
Browse files Browse the repository at this point in the history
This is long-since migrated.

Cleanup for #13839.

PiperOrigin-RevId: 611218897
Change-Id: I97b364533e7843da753fe4247be644e3c6169676
  • Loading branch information
gregestren authored and Copybara-Service committed Feb 28, 2024
1 parent 17a8ef0 commit 42c7057
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -708,18 +708,6 @@ public boolean useBaselineForOutputDirectoryNamingScheme() {
+ "Specifying -<feature> will disable the feature. "
+ "Negative features always override positive ones.")
public List<String> 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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> features =
getRuleContext(getConfiguredTarget("//a", getExecConfiguration())).getFeatures();
assertThat(features).contains("feature");
assertThat(features).doesNotContain("host_feature");
}

@Test
public void testFeatureDisabledOnCommandLine() throws Exception {
useConfiguration("--features=-feature");
Expand Down

0 comments on commit 42c7057

Please sign in to comment.