aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build
diff options
context:
space:
mode:
authorGravatar Greg Estren <gregce@google.com>2015-06-02 19:40:41 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-06-03 13:48:53 +0000
commit2ffc4fe76740e4d1b45de45af1293f80eb80be6f (patch)
treedc9cba1d92467f5f0914b7749cf0586ae444431e /src/main/java/com/google/devtools/build
parent7923559213e6d1a12bf66df85705ffd31d2f1e28 (diff)
Remove compatible_with / restricted_to attributes from rule
classes that are exempt from constraint checking. -- MOS_MIGRATED_REVID=95033646
Diffstat (limited to 'src/main/java/com/google/devtools/build')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/constraints/EnvironmentRule.java2
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/RuleClass.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/constraints/EnvironmentRule.java b/src/main/java/com/google/devtools/build/lib/analysis/constraints/EnvironmentRule.java
index 8330dba872..8853d50267 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/constraints/EnvironmentRule.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/constraints/EnvironmentRule.java
@@ -57,8 +57,6 @@ public final class EnvironmentRule implements RuleDefinition {
.allowedRuleClasses(EnvironmentRule.RULE_NAME)
.allowedFileTypes(FileTypeSet.NO_FILE)
.nonconfigurable("used for defining constraint models - this shouldn't be configured"))
- .removeAttribute(RuleClass.COMPATIBLE_ENVIRONMENT_ATTR)
- .removeAttribute(RuleClass.RESTRICTED_ENVIRONMENT_ATTR)
.exemptFromConstraintChecking("this rule *defines* a constraint")
.setUndocumented()
.build();
diff --git a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
index d841c2c991..d2c1f569cc 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
@@ -756,6 +756,8 @@ public final class RuleClass {
public <TYPE> Builder exemptFromConstraintChecking(String reason) {
Preconditions.checkState(this.supportsConstraintChecking);
this.supportsConstraintChecking = false;
+ attributes.remove(RuleClass.COMPATIBLE_ENVIRONMENT_ATTR);
+ attributes.remove(RuleClass.RESTRICTED_ENVIRONMENT_ATTR);
return this;
}