Skip to content

Commit da9308c

Browse files
committed
Cleanup
1 parent acd23e8 commit da9308c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/main/java/com/google/devtools/build/lib/remote/RemoteImportantOutputHandler.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
import com.google.common.collect.ImmutableList;
1919
import com.google.common.util.concurrent.ListenableFuture;
2020
import com.google.devtools.build.lib.actions.ActionExecutionMetadata;
21-
import com.google.devtools.build.lib.actions.ActionInput;
2221
import com.google.devtools.build.lib.actions.ActionInputPrefetcher;
2322
import com.google.devtools.build.lib.actions.Actions;
2423
import com.google.devtools.build.lib.actions.Artifact;
2524
import com.google.devtools.build.lib.actions.Artifact.DerivedArtifact;
25+
import com.google.devtools.build.lib.actions.Artifact.TreeFileArtifact;
2626
import com.google.devtools.build.lib.actions.FileArtifactValue;
2727
import com.google.devtools.build.lib.actions.ImportantOutputHandler;
2828
import com.google.devtools.build.lib.actions.InputMetadataProvider;
@@ -152,7 +152,7 @@ private void downloadArtifact(
152152
return;
153153
}
154154

155-
var filesToDownload = new ArrayList<ActionInput>(treeArtifactValue.getChildren().size());
155+
var filesToDownload = new ArrayList<TreeFileArtifact>(treeArtifactValue.getChildren().size());
156156
for (var entry : treeArtifactValue.getChildValues().entrySet()) {
157157
if (remoteOutputChecker.shouldDownloadOutput(entry.getKey(), entry.getValue())) {
158158
filesToDownload.add(entry.getKey());
@@ -161,7 +161,9 @@ private void downloadArtifact(
161161
if (!filesToDownload.isEmpty()) {
162162
futures.add(
163163
actionInputPrefetcher.prefetchFiles(
164-
getGeneratingAction((DerivedArtifact) filesToDownload.getFirst()),
164+
// derivedArtifact's generating action may be an action template, which doesn't
165+
// implement the required ActionExecutionMetadata.
166+
getGeneratingAction(filesToDownload.getFirst()),
165167
filesToDownload,
166168
metadataProvider,
167169
ActionInputPrefetcher.Priority.LOW,
@@ -190,8 +192,9 @@ private ActionExecutionMetadata getGeneratingAction(DerivedArtifact artifact)
190192
var action = Actions.getGeneratingAction(graph, artifact);
191193
Preconditions.checkState(
192194
action instanceof ActionExecutionMetadata,
193-
"generating action for artifact %s is not an ActionExecutionMetadata",
194-
artifact);
195+
"generating action for artifact %s is not an ActionExecutionMetadata, but %s",
196+
artifact,
197+
action != null ? action.getClass() : null);
195198
return (ActionExecutionMetadata) action;
196199
}
197200
}

0 commit comments

Comments
 (0)