From d22ade3730bbb2e95df4ca2bee3760bf63c3d30c Mon Sep 17 00:00:00 2001 From: felly Date: Thu, 24 May 2018 08:24:53 -0700 Subject: With ActionFS, there is no need to delete previous output files. These should not exist. PiperOrigin-RevId: 197895718 --- .../build/lib/skyframe/SkyframeActionExecutor.java | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/skyframe') 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 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)); -- cgit v1.2.3