diff options
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.java | 49 |
1 files changed, 38 insertions, 11 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 98b5c3cd90..215e7f0904 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 @@ -677,8 +677,9 @@ public final class SkyframeActionExecutor { } catch (ActionExecutionException e) { throw processAndThrow( env.getListener(), - e, + actionExecutionContext, action, + e, actionExecutionContext.getFileOutErr(), ErrorTiming.BEFORE_EXECUTION); } @@ -766,7 +767,7 @@ public final class SkyframeActionExecutor { Preconditions.checkState(actionExecutionContext.getMetadataHandler() == metadataHandler, "%s %s", actionExecutionContext.getMetadataHandler(), metadataHandler); prepareScheduleExecuteAndCompleteAction( - eventHandler, action, actionExecutionContext, actionStartTime, actionLookupData); + eventHandler, actionExecutionContext, action, actionStartTime, actionLookupData); Preconditions.checkState( actionExecutionContext.getOutputSymlinks() == null || action instanceof SkyframeAwareAction, @@ -890,8 +891,8 @@ public final class SkyframeActionExecutor { */ private void prepareScheduleExecuteAndCompleteAction( ExtendedEventHandler eventHandler, - Action action, ActionExecutionContext context, + Action action, long actionStartTime, ActionLookupData actionLookupData) throws ActionExecutionException, InterruptedException { @@ -924,6 +925,7 @@ public final class SkyframeActionExecutor { boolean outputDumped = executeActionTask(eventHandler, action, context); completeAction( eventHandler, + context, action, context.getMetadataHandler(), context.getFileOutErr(), @@ -936,12 +938,14 @@ public final class SkyframeActionExecutor { private ActionExecutionException processAndThrow( ExtendedEventHandler eventHandler, - ActionExecutionException e, + ActionExecutionContext actionExecutionContext, Action action, + ActionExecutionException e, FileOutErr outErrBuffer, ErrorTiming errorTiming) - throws ActionExecutionException { - reportActionExecution(eventHandler, action, e, outErrBuffer, errorTiming); + throws ActionExecutionException { + reportActionExecution( + eventHandler, actionExecutionContext, action, e, outErrBuffer, errorTiming); boolean reported = reportErrorIfNotAbortingMode(e, outErrBuffer); ActionExecutionException toThrow = e; @@ -1005,17 +1009,25 @@ public final class SkyframeActionExecutor { } // Defer reporting action success until outputs are checked } catch (ActionExecutionException e) { - throw processAndThrow(eventHandler, e, action, outErrBuffer, ErrorTiming.AFTER_EXECUTION); + throw processAndThrow( + eventHandler, + actionExecutionContext, + action, + e, + outErrBuffer, + ErrorTiming.AFTER_EXECUTION); } return false; } private void completeAction( ExtendedEventHandler eventHandler, + ActionExecutionContext actionExecutionContext, Action action, MetadataHandler metadataHandler, FileOutErr fileOutErr, - boolean outputAlreadyDumped) throws ActionExecutionException { + boolean outputAlreadyDumped) + throws ActionExecutionException { try { Preconditions.checkState(action.inputsDiscovered(), "Action %s successfully executed, but inputs still not known", action); @@ -1035,16 +1047,23 @@ public final class SkyframeActionExecutor { } } - reportActionExecution(eventHandler, action, null, fileOutErr, ErrorTiming.NO_ERROR); + reportActionExecution( + eventHandler, actionExecutionContext, action, null, fileOutErr, ErrorTiming.NO_ERROR); } catch (ActionExecutionException actionException) { // Success in execution but failure in completion. reportActionExecution( - eventHandler, action, actionException, fileOutErr, ErrorTiming.AFTER_EXECUTION); + eventHandler, + actionExecutionContext, + action, + actionException, + fileOutErr, + ErrorTiming.AFTER_EXECUTION); throw actionException; } catch (IllegalStateException exception) { // More serious internal error, but failure still reported. reportActionExecution( eventHandler, + actionExecutionContext, action, new ActionExecutionException(exception, action, true), fileOutErr, @@ -1220,6 +1239,7 @@ public final class SkyframeActionExecutor { private void reportActionExecution( ExtendedEventHandler eventHandler, + ActionExecutionContext actionExecutionContext, Action action, ActionExecutionException exception, FileOutErr outErr, @@ -1233,7 +1253,14 @@ public final class SkyframeActionExecutor { if (outErr.hasRecordedStderr()) { stderr = outErr.getErrorPath(); } - eventHandler.post(new ActionExecutedEvent(action, exception, stdout, stderr, errorTiming)); + eventHandler.post( + new ActionExecutedEvent( + action, + exception, + actionExecutionContext.getInputPath(action.getPrimaryOutput()), + stdout, + stderr, + errorTiming)); } /** |