diff --git a/src/main/java/com/google/devtools/build/lib/remote/AbstractActionInputPrefetcher.java b/src/main/java/com/google/devtools/build/lib/remote/AbstractActionInputPrefetcher.java index 9590f2c57cfa5a..234172c0ecfd6a 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/AbstractActionInputPrefetcher.java +++ b/src/main/java/com/google/devtools/build/lib/remote/AbstractActionInputPrefetcher.java @@ -13,6 +13,7 @@ // limitations under the License. package com.google.devtools.build.lib.remote; +import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; import static com.google.common.util.concurrent.MoreExecutors.directExecutor; import static com.google.devtools.build.lib.remote.util.RxFutures.toCompletable; @@ -158,6 +159,8 @@ protected Completable onErrorResumeNext(Throwable error) { * Fetches remotely stored action outputs, that are inputs to this spawn, and stores them under * their path in the output base. * + *

The {@code inputs} may not contain any unexpanded directories. + * *

This method is safe to be called concurrently from spawn runners before running any local * spawn. * @@ -176,6 +179,9 @@ protected ListenableFuture prefetchFiles( Map> trees = new HashMap<>(); List files = new ArrayList<>(); for (ActionInput input : inputs) { + checkArgument(!input.isDirectory(), "cannot prefetch a directory"); + + // Source artifacts don't need to be fetched. if (input instanceof Artifact && ((Artifact) input).isSourceArtifact()) { continue; }