Avoid checking visibility and other constraints for the lipo dependency.
The lipo dependency is artificial; it's an artifact of how LIPO is implemented
in Bazel. Running these checks doesn't make sense; they unnecessarily
disallow perfectly valid scenarios.
--
MOS_MIGRATED_REVID=102550286
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Attribute.java b/src/main/java/com/google/devtools/build/lib/packages/Attribute.java
index 391a1da..c181a7e 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/Attribute.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/Attribute.java
@@ -201,6 +201,11 @@
* its value based on properties of the build configuration.
*/
NONCONFIGURABLE,
+
+ /**
+ * Whether we should skip constraints checks for licenses, visibility, etc.
+ */
+ SKIP_CONSTRAINTS_CHECKS,
}
// TODO(bazel-team): modify this interface to extend Predicate and have an extra error
@@ -521,6 +526,13 @@
}
/**
+ * Disables constraints and visibility checks.
+ */
+ public Builder<TYPE> skipConstraintsCheck() {
+ return setPropertyFlag(PropertyFlag.SKIP_CONSTRAINTS_CHECKS, "skip_constraints_checks");
+ }
+
+ /**
* If this is a label or label-list attribute, then this sets the allowed
* rule types for the labels occurring in the attribute. If the attribute
* contains Labels of any other rule type, then an error is produced during
@@ -1238,6 +1250,10 @@
return getPropertyFlag(PropertyFlag.CHECK_ALLOWED_VALUES);
}
+ public boolean performConstraintsCheck() {
+ return !getPropertyFlag(PropertyFlag.SKIP_CONSTRAINTS_CHECKS);
+ }
+
/**
* Returns true if this attribute's value can be influenced by the build configuration.
*/