@@ -1011,26 +1011,28 @@ public InMemoryOutput downloadOutputs(RemoteAction action, RemoteActionResult re
1011
1011
metadata = parseActionResultMetadata (action , result );
1012
1012
}
1013
1013
1014
- // Check that all mandatory outputs are created.
1015
- for (ActionInput output : action .spawn .getOutputFiles ()) {
1016
- if (action .spawn .isMandatoryOutput (output )) {
1017
- // Don't check output that is tree artifact since spawn could generate nothing under that
1018
- // directory. Remote server typically doesn't create directory ahead of time resulting in
1019
- // empty tree artifact missing from action cache entry.
1020
- if (output instanceof Artifact && ((Artifact ) output ).isTreeArtifact ()) {
1021
- continue ;
1022
- }
1014
+ if (result .success ()) {
1015
+ // Check that all mandatory outputs are created.
1016
+ for (ActionInput output : action .spawn .getOutputFiles ()) {
1017
+ if (action .spawn .isMandatoryOutput (output )) {
1018
+ // Don't check output that is tree artifact since spawn could generate nothing under that
1019
+ // directory. Remote server typically doesn't create directory ahead of time resulting in
1020
+ // empty tree artifact missing from action cache entry.
1021
+ if (output instanceof Artifact && ((Artifact ) output ).isTreeArtifact ()) {
1022
+ continue ;
1023
+ }
1023
1024
1024
- Path localPath = execRoot .getRelative (output .getExecPath ());
1025
- if (!metadata .files .containsKey (localPath )
1026
- && !metadata .directories .containsKey (localPath )
1027
- && !metadata .symlinks .containsKey (localPath )) {
1028
- throw new IOException (
1029
- "Invalid action cache entry "
1030
- + action .actionKey .getDigest ().getHash ()
1031
- + ": expected output "
1032
- + prettyPrint (output )
1033
- + " does not exist." );
1025
+ Path localPath = execRoot .getRelative (output .getExecPath ());
1026
+ if (!metadata .files .containsKey (localPath )
1027
+ && !metadata .directories .containsKey (localPath )
1028
+ && !metadata .symlinks .containsKey (localPath )) {
1029
+ throw new IOException (
1030
+ "Invalid action cache entry "
1031
+ + action .actionKey .getDigest ().getHash ()
1032
+ + ": expected output "
1033
+ + prettyPrint (output )
1034
+ + " does not exist." );
1035
+ }
1034
1036
}
1035
1037
}
1036
1038
}
0 commit comments