aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2016-10-26 14:27:48 +0000
committerGravatar Laszlo Csomor <laszlocsomor@google.com>2016-10-27 09:24:43 +0000
commit8a8a7fce075db5fd633f01f65248defdeef4e041 (patch)
tree612178ae9da53978d063a8617cb75398bea7480d /src/main/java/com/google/devtools/build/lib/runtime
parent4db50640e3799c528b1c893c431227d5d5c192a3 (diff)
Report completion of a target together with failed actions
Report the completion of all targets together with the root causes on the build event stream. To do so, have TargetCompleteEvent and ActionExecutedEvent be instances of BuildEvent; however, ignore an ActionExecutedEvent in the BuildEventStreamer if the execution was successful. By this change we get, for the first time, a build event stream that is naturally closed, i.e., without Aborted events closing up lose ends. Add a test asserting this property. -- Change-Id: Ie90dd52ee80deb0fdabdce1da551935522880a1a Reviewed-on: https://bazel-review.googlesource.com/#/c/6279 MOS_MIGRATED_REVID=137273002
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java b/src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java
index 6329d41676..819e2f3c32 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java
@@ -16,6 +16,7 @@ package com.google.devtools.build.lib.runtime;
import com.google.common.collect.Sets;
import com.google.common.eventbus.Subscribe;
+import com.google.devtools.build.lib.actions.ActionExecutedEvent;
import com.google.devtools.build.lib.analysis.NoBuildEvent;
import com.google.devtools.build.lib.buildeventstream.AbortedEvent;
import com.google.devtools.build.lib.buildeventstream.BuildEvent;
@@ -146,6 +147,13 @@ public class BuildEventStreamer implements EventHandler {
@Subscribe
public void buildEvent(BuildEvent event) {
+ if (event instanceof ActionExecutedEvent) {
+ // We ignore events about action executions if the execution succeeded.
+ if (((ActionExecutedEvent) event).getException() == null) {
+ return;
+ }
+ }
+
post(event);
}
}