aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
diff options
context:
space:
mode:
authorGravatar felly <felly@google.com>2018-05-24 08:24:53 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-05-24 08:25:52 -0700
commitd22ade3730bbb2e95df4ca2bee3760bf63c3d30c (patch)
tree6280e312eba171b5046b287e8f7a8e1b125fb5a3 /src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
parentd17b9aef01dd1e8a8b19da2e383c45db954db63a (diff)
With ActionFS, there is no need to delete previous output files. These should not exist.
PiperOrigin-RevId: 197895718
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
index eb94421924..20fca212a5 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
@@ -766,11 +766,6 @@ public final class SkyframeActionExecutor {
}
private void createOutputDirectories(Action action) throws ActionExecutionException {
- if (usesActionFileSystem()) {
- // ActionFileSystem constructs directories implicitly.
- return;
- }
-
try {
Set<Path> done = new HashSet<>(); // avoid redundant calls for the same directory.
for (Artifact outputFile : action.getOutputs()) {
@@ -877,13 +872,17 @@ public final class SkyframeActionExecutor {
long actionStartTime,
ActionLookupData actionLookupData)
throws ActionExecutionException, InterruptedException {
- // Delete the outputs before executing the action, just to ensure that
- // the action really does produce the outputs.
- try {
- action.prepare(context.getFileSystem(), context.getExecRoot());
- createOutputDirectories(action);
- } catch (IOException e) {
- reportError("failed to delete output files before executing action", e, action, null);
+ // ActionFileSystem constructs directories implicitly, so no need to delete the old outputs
+ // and ensure directories exist in this case.
+ if (!usesActionFileSystem()) {
+ // Delete the outputs before executing the action, just to ensure that
+ // the action really does produce the outputs.
+ try {
+ action.prepare(context.getFileSystem(), context.getExecRoot());
+ createOutputDirectories(action);
+ } catch (IOException e) {
+ reportError("failed to delete output files before executing action", e, action, null);
+ }
}
eventHandler.post(new ActionStartedEvent(action, actionStartTime));