aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
diff options
context:
space:
mode:
authorGravatar tomlu <tomlu@google.com>2018-08-01 13:20:41 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-08-01 13:22:16 -0700
commitd56a80610a10c7f7d8f47525fe5561bc032926db (patch)
tree1a71352e225cc3b3c95d6bcd9c9fd1055b9abb2f /src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
parent731900fd714593472f62cb871abab13fd7f3355b (diff)
Pass a path to ActionExecutedEvent that is resolved via ActionExecutionContext.
If the output artifact is backed by a different file system then we need to use that file system later. RELNOTES: None PiperOrigin-RevId: 206981369
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.java49
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));
}
/**