From 8a8a7fce075db5fd633f01f65248defdeef4e041 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 26 Oct 2016 14:27:48 +0000 Subject: 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 --- .../com/google/devtools/build/lib/runtime/BuildEventStreamer.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/main/java/com/google/devtools/build/lib/runtime') 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); } } -- cgit v1.2.3