aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/actions
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/actions
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/actions')
-rw-r--r--src/main/java/com/google/devtools/build/lib/actions/ActionExecutedEvent.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionExecutedEvent.java b/src/main/java/com/google/devtools/build/lib/actions/ActionExecutedEvent.java
index f903503bf6..9c038131dc 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ActionExecutedEvent.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ActionExecutedEvent.java
@@ -41,6 +41,7 @@ public class ActionExecutedEvent implements BuildEventWithConfiguration, Progres
private final Action action;
private final ActionExecutionException exception;
+ private final Path primaryOutput;
private final Path stdout;
private final Path stderr;
private final ErrorTiming timing;
@@ -48,11 +49,13 @@ public class ActionExecutedEvent implements BuildEventWithConfiguration, Progres
public ActionExecutedEvent(
Action action,
ActionExecutionException exception,
+ Path primaryOutput,
Path stdout,
Path stderr,
ErrorTiming timing) {
this.action = action;
this.exception = exception;
+ this.primaryOutput = primaryOutput;
this.stdout = stdout;
this.stderr = stderr;
this.timing = timing;
@@ -90,10 +93,10 @@ public class ActionExecutedEvent implements BuildEventWithConfiguration, Progres
@Override
public BuildEventId getEventId() {
if (action.getOwner() == null) {
- return BuildEventId.actionCompleted(action.getPrimaryOutput().getPath());
+ return BuildEventId.actionCompleted(primaryOutput);
} else {
return BuildEventId.actionCompleted(
- action.getPrimaryOutput().getPath(),
+ primaryOutput,
action.getOwner().getLabel(),
action.getOwner().getConfigurationChecksum());
}
@@ -127,7 +130,7 @@ public class ActionExecutedEvent implements BuildEventWithConfiguration, Progres
localFiles.add(new LocalFile(stderr, LocalFileType.STDERR));
}
if (exception == null) {
- localFiles.add(new LocalFile(action.getPrimaryOutput().getPath(), LocalFileType.OUTPUT));
+ localFiles.add(new LocalFile(primaryOutput, LocalFileType.OUTPUT));
}
return localFiles.build();
}
@@ -168,7 +171,7 @@ public class ActionExecutedEvent implements BuildEventWithConfiguration, Progres
actionBuilder.setConfiguration(configuration.getEventId().asStreamProto().getConfiguration());
}
if (exception == null) {
- String uri = pathConverter.apply(action.getPrimaryOutput().getPath());
+ String uri = pathConverter.apply(primaryOutput);
if (uri != null) {
actionBuilder.setPrimaryOutput(
BuildEventStreamProtos.File.newBuilder().setUri(uri).build());