Skip to content

Commit

Permalink
renamed 'incompatible_allow_tags_propagation' to 'experimental_allow_…
Browse files Browse the repository at this point in the history
…tags_propagation'

RELNOTES: use 'experimental_allow_tags_propagation' to propagate tags to actions from target or rules. Tags that can be propagated should have one of the following prefixed: 'no-', 'requires-', 'supports-', 'block-', 'disable-', 'cpu:'. See bazelbuild#8830 for details
  • Loading branch information
ishikhman committed Aug 19, 2019
1 parent d570771 commit eac9bea
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ private void registerStarlarkAction(
TargetUtils.getFilteredExecutionInfo(
executionRequirementsUnchecked,
ruleContext.getRule(),
starlarkSemantics.incompatibleAllowTagsPropagation());
starlarkSemantics.experimentalAllowTagsPropagation());
builder.setExecutionInfo(executionInfo);

if (inputManifestsUnchecked != Runtime.NONE) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,19 @@ public class StarlarkSemanticsOptions extends OptionsBase implements Serializabl
public boolean incompatibleBzlDisallowLoadAfterStatement;

@Option(
name = "incompatible_allow_tags_propagation",
name = "experimental_allow_tags_propagation",
oldName = "incompatible_allow_tags_propagation",
defaultValue = "false",
documentationCategory = OptionDocumentationCategory.STARLARK_SEMANTICS,
effectTags = {OptionEffectTag.BUILD_FILE_SEMANTICS},
metadataTags = {
OptionMetadataTag.INCOMPATIBLE_CHANGE,
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
OptionMetadataTag.EXPERIMENTAL,
},
help =
"If set to true, tags will be propagated from a target to the actions' execution"
+ " requirements; otherwise tags are not propagated. See"
+ " https://github.com/bazelbuild/bazel/issues/8830 for details.")
public boolean incompatibleAllowTagsPropagation;
public boolean experimentalAllowTagsPropagation;

@Option(
name = "incompatible_depset_union",
Expand Down Expand Up @@ -655,6 +655,7 @@ public StarlarkSemantics toSkylarkSemantics() {
// <== Add new options here in alphabetic order ==>
.experimentalAllowIncrementalRepositoryUpdates(
experimentalAllowIncrementalRepositoryUpdates)
.experimentalAllowTagsPropagation(experimentalAllowTagsPropagation)
.experimentalBuildSettingApi(experimentalBuildSettingApi)
.experimentalCcSkylarkApiEnabledPackages(experimentalCcSkylarkApiEnabledPackages)
.experimentalEnableAndroidMigrationApis(experimentalEnableAndroidMigrationApis)
Expand Down Expand Up @@ -700,7 +701,6 @@ public StarlarkSemantics toSkylarkSemantics() {
.incompatibleRestrictStringEscapes(incompatibleRestrictStringEscapes)
.incompatibleDisallowDictLookupUnhashableKeys(
incompatibleDisallowDictLookupUnhashableKeys)
.incompatibleAllowTagsPropagation(incompatibleAllowTagsPropagation)
.incompatibleDisallowHashingFrozenMutables(incompatibleDisallowHashingFrozenMutables)
.build();
return INTERNER.intern(semantics);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,12 @@ public static Map<String, String> getExecutionInfo(Rule rule) {
* {@code SkylarkDict<String, String>} type, null or {@link
* com.google.devtools.build.lib.syntax.Runtime#NONE}
* @param rule a rule instance to get tags from
* @param incompatibleAllowTagsPropagation if set to true, tags will be propagated from a target
* @param allowTagsPropagation if set to true, tags will be propagated from a target
* to the actions' execution requirements, for more details {@see
* SkylarkSematicOptions#incompatibleAllowTagsPropagation}
* SkylarkSematicOptions#experimentalAllowTagsPropagation}
*/
public static ImmutableMap<String, String> getFilteredExecutionInfo(
Object executionRequirementsUnchecked, Rule rule, boolean incompatibleAllowTagsPropagation)
Object executionRequirementsUnchecked, Rule rule, boolean allowTagsPropagation)
throws EvalException {
Map<String, String> checkedExecutionRequirements =
TargetUtils.filter(
Expand All @@ -262,7 +262,7 @@ public static ImmutableMap<String, String> getFilteredExecutionInfo(
// adding filtered execution requirements to the execution info map
executionInfoBuilder.putAll(checkedExecutionRequirements);

if (incompatibleAllowTagsPropagation) {
if (allowTagsPropagation) {
Map<String, String> checkedTags = getExecutionInfo(rule);
// merging filtered tags to the execution info map avoiding duplicates
checkedTags.forEach(executionInfoBuilder::putIfAbsent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public enum FlagIdentifier {
INCOMPATIBLE_OBJC_FRAMEWORK_CLEANUP(StarlarkSemantics::incompatibleObjcFrameworkCleanup),
INCOMPATIBLE_DISALLOW_RULE_EXECUTION_PLATFORM_CONSTRAINTS_ALLOWED(
StarlarkSemantics::incompatibleDisallowRuleExecutionPlatformConstraintsAllowed),
INCOMPATIBLE_ALLOW_TAGS_PROPAGATION(StarlarkSemantics::incompatibleAllowTagsPropagation),
INCOMPATIBLE_ALLOW_TAGS_PROPAGATION(StarlarkSemantics::experimentalAllowTagsPropagation),
NONE(null);

// Using a Function here makes the enum definitions far cleaner, and, since this is
Expand Down Expand Up @@ -207,7 +207,7 @@ public boolean flagValue(FlagIdentifier flagIdentifier) {

public abstract boolean incompatibleDisallowDictLookupUnhashableKeys();

public abstract boolean incompatibleAllowTagsPropagation();
public abstract boolean experimentalAllowTagsPropagation();

public abstract boolean incompatibleDisallowHashingFrozenMutables();

Expand Down Expand Up @@ -244,6 +244,7 @@ public static Builder builderWithDefaults() {
public static final StarlarkSemantics DEFAULT_SEMANTICS =
builder()
// <== Add new options here in alphabetic order ==>
.experimentalAllowTagsPropagation(false)
.experimentalBuildSettingApi(true)
.experimentalCcSkylarkApiEnabledPackages(ImmutableList.of())
.experimentalAllowIncrementalRepositoryUpdates(true)
Expand Down Expand Up @@ -286,7 +287,6 @@ public static Builder builderWithDefaults() {
.incompatibleDepsetForLibrariesToLinkGetter(true)
.incompatibleRestrictStringEscapes(false)
.incompatibleDisallowDictLookupUnhashableKeys(false)
.incompatibleAllowTagsPropagation(false)
.incompatibleDisallowHashingFrozenMutables(false)
.build();

Expand All @@ -311,7 +311,7 @@ public abstract static class Builder {

public abstract Builder experimentalStarlarkUnusedInputsList(boolean value);

public abstract Builder incompatibleAllowTagsPropagation(boolean value);
public abstract Builder experimentalAllowTagsPropagation(boolean value);

public abstract Builder incompatibleBzlDisallowLoadAfterStatement(boolean value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private static StarlarkSemantics buildRandomSemantics(Random rand) {
.experimentalPlatformsApi(rand.nextBoolean())
.experimentalStarlarkConfigTransitions(rand.nextBoolean())
.experimentalStarlarkUnusedInputsList(rand.nextBoolean())
.incompatibleAllowTagsPropagation(rand.nextBoolean())
.experimentalAllowTagsPropagation(rand.nextBoolean())
.incompatibleBzlDisallowLoadAfterStatement(rand.nextBoolean())
.incompatibleDepsetForLibrariesToLinkGetter(rand.nextBoolean())
.incompatibleDepsetIsNotIterable(rand.nextBoolean())
Expand Down

0 comments on commit eac9bea

Please sign in to comment.