aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/google/devtools/build/lib/actions/Actions.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/Actions.java b/src/main/java/com/google/devtools/build/lib/actions/Actions.java
index 44397d8e97..b8bd981156 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/Actions.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/Actions.java
@@ -190,6 +190,19 @@ public final class Actions {
if (pathJ.startsWith(pathI)) { // prefix conflict.
Artifact artifactI = Preconditions.checkNotNull(artifactPathMap.get(pathI), pathI);
Artifact artifactJ = Preconditions.checkNotNull(artifactPathMap.get(pathJ), pathJ);
+
+ // We ignore the artifact prefix conflict between a TreeFileArtifact and its parent
+ // TreeArtifact.
+ // We can only have such a conflict here if:
+ // 1. The TreeArtifact is generated by an ActionTemplate. And the TreeFileArtifact is
+ // generated by an expanded action created at execution time from the ActionTemplate.
+ // 2. This is an incremental build with invalidated configured targets. In this case,
+ // the action graph contains expanded actions from previous builds and they will be
+ // checked for artifact conflicts.
+ if (artifactJ.hasParent() && artifactJ.getParent().equals(artifactI)) {
+ continue;
+ }
+
ActionAnalysisMetadata actionI =
Preconditions.checkNotNull(actionGraph.getGeneratingAction(artifactI), artifactI);
ActionAnalysisMetadata actionJ =