diff options
author | 2017-07-20 13:57:02 +0200 | |
---|---|---|
committer | 2017-07-20 14:48:56 +0200 | |
commit | d81b16c0d349deb5b194e321488ff7b1b8674a62 (patch) | |
tree | 76ae5ee4793e1fabf5b65adb8873d0b07fb7a632 | |
parent | 36cd45b90b493287715922caaf2dd4ffa4b0a7ad (diff) |
Turn off checking for filegroup "data" attributes.
Evidently the blanket disabling for all "data" attributes doesn't apply there.
PiperOrigin-RevId: 162602015
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/bazel/rules/common/BazelFilegroupRule.java | 6 | ||||
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/analysis/constraints/ConstraintsTest.java | 12 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/common/BazelFilegroupRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/common/BazelFilegroupRule.java index d2c1588a59..e301b0f186 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/common/BazelFilegroupRule.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/common/BazelFilegroupRule.java @@ -67,7 +67,11 @@ public final class BazelFilegroupRule implements RuleDefinition { <code>data</code></a> for more information about how to depend on and use data files. </p> <!-- #END_BLAZE_RULE.ATTRIBUTE -->*/ - .add(attr("data", LABEL_LIST).cfg(DATA).allowedFileTypes(FileTypeSet.ANY_FILE)) + .add( + attr("data", LABEL_LIST) + .cfg(DATA) + .allowedFileTypes(FileTypeSet.ANY_FILE) + .dontCheckConstraints()) .add(attr("output_licenses", LICENSE)) /*<!-- #BLAZE_RULE(filegroup).ATTRIBUTE(path) --> An optional string to set a path to the files in the group, relative to the package path. diff --git a/src/test/java/com/google/devtools/build/lib/analysis/constraints/ConstraintsTest.java b/src/test/java/com/google/devtools/build/lib/analysis/constraints/ConstraintsTest.java index 1bf3b0f27a..0786f3a300 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/constraints/ConstraintsTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/constraints/ConstraintsTest.java @@ -819,6 +819,18 @@ public class ConstraintsTest extends AbstractConstraintsTest { } @Test + public void filegroupDataAttributesSkipped() throws Exception { + new EnvironmentGroupMaker("buildenv/foo").setEnvironments("a", "b").setDefaults("a").make(); + scratch.file("hello/BUILD", + "filegroup(", + " name = 'hi',", + " data = ['//helpers:default'],", + " compatible_with = ['//buildenv/foo:b'])"); + assertThat(getConfiguredTarget("//hello:hi")).isNotNull(); + assertNoEvents(); + } + + @Test public void outputFilesAreChecked() throws Exception { new EnvironmentGroupMaker("buildenv/foo").setEnvironments("a", "b").setDefaults().make(); scratch.file("hello/BUILD", |