diff options
author | 2017-06-14 12:33:35 +0200 | |
---|---|---|
committer | 2017-06-14 13:17:24 +0200 | |
commit | 746655f21f2f555606db84183e5f90cee9cb3dd5 (patch) | |
tree | 90f2b7803b9ede82699a9258d52f6a20d5058b2f /src/main/java/com/google/devtools | |
parent | 45820abe0e4da93b8f1ce97d4296e7d42f0d617e (diff) |
Fix local execution to not throw an exception
The SpawnInputExpander returns null for empty files, but the
ActionInputPrefetcher does not expect null values, and implementations may
throw NPE.
PiperOrigin-RevId: 158960425
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java b/src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java index 418646b1cd..acbb578cdd 100644 --- a/src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java +++ b/src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java @@ -18,6 +18,8 @@ import static java.util.logging.Level.INFO; import static java.util.logging.Level.SEVERE; import com.google.common.base.Joiner; +import com.google.common.base.Predicates; +import com.google.common.collect.Iterables; import com.google.common.io.ByteStreams; import com.google.devtools.build.lib.actions.ActionExecutionMetadata; import com.google.devtools.build.lib.actions.ResourceManager; @@ -214,7 +216,8 @@ public final class LocalSpawnRunner implements SpawnRunner { if (Spawns.shouldPrefetchInputsForLocalExecution(spawn)) { stepLog(INFO, "prefetching inputs for local execution"); setState(State.PREFETCHING_LOCAL_INPUTS); - actionInputPrefetcher.prefetchFiles(policy.getInputMapping().values()); + actionInputPrefetcher.prefetchFiles( + Iterables.filter(policy.getInputMapping().values(), Predicates.notNull())); } stepLog(INFO, "running locally"); |