Skip to content

Commit

Permalink
Do not assert that all TreeFileArtifacts have RegularFileValues.
Browse files Browse the repository at this point in the history
This apparently happens for the root directory of TreeArtifacts on OS X for some odd reason.

Fixes #9054.

RELNOTES: None.
PiperOrigin-RevId: 261295961
  • Loading branch information
lberki authored and Copybara-Service committed Aug 2, 2019
1 parent 5f2b552 commit 6c5ef53
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ private ActionExecutionValue(
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());
Preconditions.checkArgument(
file.getValue().getDigest() != null,
"missing digest for file %s in tree artifact %s",
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",
file.getKey(),
tree.getKey());
}
}
}

Expand Down

0 comments on commit 6c5ef53

Please sign in to comment.