aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/pkgcache/SrcTargetUtil.java
diff options
context:
space:
mode:
authorGravatar Greg Estren <gregce@google.com>2015-04-22 18:39:33 +0000
committerGravatar Laszlo Csomor <laszlocsomor@google.com>2015-04-23 09:18:03 +0000
commit0ef0634ae4d99677b9d891f849e8678d798a1b02 (patch)
tree4302bb110baf0de037970699efa470ef3e7d88c4 /src/main/java/com/google/devtools/build/lib/pkgcache/SrcTargetUtil.java
parentcbe694de412cb2c8ac64fdf11152acc5a54e91bd (diff)
Make --compile_one_dependency more "configurable attribute"-friendly:
rather than skip *all* rules with configurable attributes, just skip those with configurable "srcs". This is a more precise model of the rules we can't reliably figure out source ownership for in the loading phase. -- MOS_MIGRATED_REVID=91807972
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/pkgcache/SrcTargetUtil.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/pkgcache/SrcTargetUtil.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/pkgcache/SrcTargetUtil.java b/src/main/java/com/google/devtools/build/lib/pkgcache/SrcTargetUtil.java
index 89969f6773..242bcc38ea 100644
--- a/src/main/java/com/google/devtools/build/lib/pkgcache/SrcTargetUtil.java
+++ b/src/main/java/com/google/devtools/build/lib/pkgcache/SrcTargetUtil.java
@@ -13,7 +13,6 @@
// limitations under the License.
package com.google.devtools.build.lib.pkgcache;
-import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
@@ -107,11 +106,13 @@ public final class SrcTargetUtil {
Set<Rule> visitedRules,
TargetProvider targetProvider)
throws NoSuchTargetException, NoSuchPackageException, InterruptedException {
- Preconditions.checkState(!rule.hasConfigurableAttributes()); // Not currently supported.
List<Label> srcLabels = Lists.newArrayList();
AttributeMap attributeMap = RawAttributeMapper.of(rule);
for (String attrName : attributes) {
- if (rule.isAttrDefined(attrName, Type.LABEL_LIST)) {
+ if (rule.isConfigurableAttribute(attrName)) {
+ // We don't know which path to follow for configurable attributes. So skip them.
+ continue;
+ } else if (rule.isAttrDefined(attrName, Type.LABEL_LIST)) {
srcLabels.addAll(attributeMap.get(attrName, Type.LABEL_LIST));
} else if (rule.isAttrDefined(attrName, Type.LABEL)) {
Label srcLabel = attributeMap.get(attrName, Type.LABEL);