Skip to content

Commit

Permalink
Make constraint_setting / constraint_value non_configurable.
Browse files Browse the repository at this point in the history
The concept of allowing what is fundamentally a constant to vary by target we are building for is too much to reason about, let along get the code correct.

PiperOrigin-RevId: 483748098
Change-Id: I966b7d21ad8d38de9867c870a0669e2123063809
  • Loading branch information
aiuto authored and copybara-github committed Oct 25, 2022
1 parent 527308c commit b422719
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env)
constraint list (such as for a <code>config_setting</code>) that requires a particular value
for that setting.
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.add(attr(DEFAULT_CONSTRAINT_VALUE_ATTR, BuildType.NODEP_LABEL))
.add(
attr(DEFAULT_CONSTRAINT_VALUE_ATTR, BuildType.NODEP_LABEL)
.nonconfigurable("constants must be consistent across configurations"))
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env)
.mandatory()
.allowedRuleClasses(ConstraintSettingRule.RULE_NAME)
.allowedFileTypes(FileTypeSet.NO_FILE)
.mandatoryProviders(ConstraintSettingInfo.PROVIDER.id()))
.mandatoryProviders(ConstraintSettingInfo.PROVIDER.id())
.nonconfigurable("constants must be consistent across configurations"))
.build();
}

Expand Down

0 comments on commit b422719

Please sign in to comment.