diff options
Diffstat (limited to 'src')
3 files changed, 20 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/NoBuildEvent.java b/src/main/java/com/google/devtools/build/lib/analysis/NoBuildEvent.java index 3e3192e1c5..044053b671 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/NoBuildEvent.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/NoBuildEvent.java @@ -25,21 +25,27 @@ import java.util.Collection; /** This event raised to indicate that no build will be happening for the given command. */ public final class NoBuildEvent implements BuildEvent { + private final String id; private final String command; private final Long startTimeMillis; private final boolean separateFinishedEvent; private final boolean showProgress; public NoBuildEvent( - String command, Long startTimeMillis, boolean separateFinishedEvent, boolean showProgress) { + String command, + Long startTimeMillis, + boolean separateFinishedEvent, + boolean showProgress, + String id) { this.command = command; this.startTimeMillis = startTimeMillis; this.separateFinishedEvent = separateFinishedEvent; this.showProgress = showProgress; + this.id = id; } public NoBuildEvent(String command, Long startTimeMillis, boolean separateFinishedEvent) { - this(command, startTimeMillis, separateFinishedEvent, false); + this(command, startTimeMillis, separateFinishedEvent, false, null); } public NoBuildEvent() { @@ -71,6 +77,9 @@ public final class NoBuildEvent implements BuildEvent { if (startTimeMillis != null) { started.setStartTimeMillis(startTimeMillis); } + if (id != null) { + started.setUuid(id); + } return GenericBuildEvent.protoChaining(this).setStarted(started.build()).build(); } diff --git a/src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java b/src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java index 833642b80a..f7cd063717 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java @@ -112,7 +112,13 @@ public final class FetchCommand implements BlazeCommand { } env.getReporter() - .post(new NoBuildEvent(env.getCommandName(), env.getCommandStartTime(), true, true)); + .post( + new NoBuildEvent( + env.getCommandName(), + env.getCommandStartTime(), + true, + true, + env.getCommandId().toString())); // 2. Evaluate expression: try { diff --git a/src/test/shell/bazel/bazel_build_event_stream_test.sh b/src/test/shell/bazel/bazel_build_event_stream_test.sh index 821e27be3e..909586f637 100755 --- a/src/test/shell/bazel/bazel_build_event_stream_test.sh +++ b/src/test/shell/bazel/bazel_build_event_stream_test.sh @@ -56,6 +56,7 @@ function test_fetch_test() { expect_log '^started' expect_log '^finished' expect_log 'name: "SUCCESS"' + expect_log 'uuid: "' expect_log '^fetch' # on second attempt, the fetched file should already be cached. bazel shutdown @@ -67,6 +68,7 @@ function test_fetch_test() { expect_log '^started' expect_log '^finished' expect_log 'name: "SUCCESS"' + expect_log 'uuid: "' expect_not_log '^fetch' } |