Do not assert that all TreeFileArtifacts have RegularFileValues.
This apparently happens for the root directory of TreeArtifacts on OS X for some odd reason.
Fixes
RELNOTES: None.
@@ -85,11 +85,10 @@ public class ActionExecutionValue implements SkyValue {
for (Map.Entry<Artifact, TreeArtifactValue> tree : treeArtifactData.entrySet()) {
for (Map.Entry<TreeFileArtifact, FileArtifactValue> file :
tree.getValue().getChildValues().entrySet()) {
- Preconditions.checkArgument(
- file.getValue().getType() == FileStateType.REGULAR_FILE,
- "file %s in tree artifact %s is not a regular file",
- file.getKey(),
- tree.getKey());
+ // We should only have RegularFileValue instances in here, but apparently tree artifacts
+ // sometimes store their own root directory in here. Sad.
+ // https://github.com/bazelbuild/bazel/issues/9058
+ if (file.getValue().getType() == FileStateType.REGULAR_FILE) {
Preconditions.checkArgument(
file.getValue().getDigest() != null,
"missing digest for file %s in tree artifact %s",
@@ -97,6 +96,7 @@ public class ActionExecutionValue implements SkyValue {
tree.getKey());
}
}
+ }
this.artifactData = ImmutableMap.copyOf(artifactData);
this.treeArtifactData = ImmutableMap.copyOf(treeArtifactData);
