aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
diff options
context:
space:
mode:
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.java27
1 files changed, 13 insertions, 14 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 5ddabcce58..5fd47c7460 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
@@ -81,7 +81,6 @@ import com.google.devtools.build.lib.profiler.SilentCloseable;
import com.google.devtools.build.lib.rules.cpp.IncludeScannable;
import com.google.devtools.build.lib.util.Pair;
import com.google.devtools.build.lib.util.io.FileOutErr;
-import com.google.devtools.build.lib.util.io.OutErr;
import com.google.devtools.build.lib.vfs.FileSystem;
import com.google.devtools.build.lib.vfs.OutputService;
import com.google.devtools.build.lib.vfs.Path;
@@ -1211,20 +1210,20 @@ public final class SkyframeActionExecutor {
* @param outErrBuffer The OutErr that recorded the actions output
*/
private void dumpRecordedOutErr(Event prefixEvent, FileOutErr outErrBuffer) {
- // Synchronize this on the reporter, so that the output from multiple
- // actions will not be interleaved.
- synchronized (reporter) {
- // Only print the output if we're not winding down.
- if (isBuilderAborting()) {
- return;
- }
+ // Only print the output if we're not winding down.
+ if (isBuilderAborting()) {
+ return;
+ }
+ if (outErrBuffer != null && outErrBuffer.hasRecordedOutput()) {
+ // Bind the output to the prefix event.
+ // Note: here we temporarily (until the event is handled by the UI) read all
+ // output into memory; as the output of regular actions (as opposed to test runs) usually is
+ // short, so this should not be a problem. If it does turn out to be a problem, we have to
+ // pass the outErrbuffer instead.
+ reporter.handle(
+ prefixEvent.withStdoutStderr(outErrBuffer.outAsLatin1(), outErrBuffer.errAsLatin1()));
+ } else {
reporter.handle(prefixEvent);
-
- if (outErrBuffer != null && outErrBuffer.hasRecordedOutput()) {
- OutErr outErr = this.reporter.getOutErr();
- outErrBuffer.dumpOutAsLatin1(outErr.getOutputStream());
- outErrBuffer.dumpErrAsLatin1(outErr.getErrorStream());
- }
}
}