diff options
author | 2017-03-01 17:12:09 +0000 | |
---|---|---|
committer | 2017-03-01 17:21:29 +0000 | |
commit | 105db844833c016550817662791e5c04efb91445 (patch) | |
tree | 1c936fc141a2db3f7772d2f5db7cb10fa770a3bb /src/main/java/com/google/devtools/build/lib/buildeventstream | |
parent | 5bd448c47e2714be229154d42157c7390e4583a1 (diff) |
BEP: Report pattern expansion failures
If expanding a pattern fails, report this on the build event protocol;
also include details of what happened.
--
Change-Id: I2bc9caf7c085911b80551d7892cc34f5e9961c7b
Reviewed-on: https://cr.bazel.build/8795
PiperOrigin-RevId: 148894326
MOS_MIGRATED_REVID=148894326
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/buildeventstream')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/buildeventstream/BuildEventId.java | 21 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto | 12 |
2 files changed, 30 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildeventstream/BuildEventId.java b/src/main/java/com/google/devtools/build/lib/buildeventstream/BuildEventId.java index 467d6f2b20..3a89fa5aeb 100644 --- a/src/main/java/com/google/devtools/build/lib/buildeventstream/BuildEventId.java +++ b/src/main/java/com/google/devtools/build/lib/buildeventstream/BuildEventId.java @@ -84,15 +84,30 @@ public final class BuildEventId implements Serializable { BuildEventStreamProtos.BuildEventId.newBuilder().setStarted(startedId).build()); } - public static BuildEventId targetPatternExpanded(List<String> targetPattern) { + private static BuildEventId targetPatternExpanded(List<String> targetPattern, boolean skipped) { BuildEventStreamProtos.BuildEventId.PatternExpandedId patternId = BuildEventStreamProtos.BuildEventId.PatternExpandedId.newBuilder() .addAllPattern(targetPattern) .build(); - return new BuildEventId( - BuildEventStreamProtos.BuildEventId.newBuilder().setPattern(patternId).build()); + BuildEventStreamProtos.BuildEventId.Builder builder = + BuildEventStreamProtos.BuildEventId.newBuilder(); + if (skipped) { + builder.setPatternSkipped(patternId); + } else { + builder.setPattern(patternId); + } + return new BuildEventId(builder.build()); } + public static BuildEventId targetPatternExpanded(List<String> targetPattern) { + return targetPatternExpanded(targetPattern, false); + } + + public static BuildEventId targetPatternSkipped(List<String> targetPattern) { + return targetPatternExpanded(targetPattern, true); + } + + public static BuildEventId targetCompleted(Label target) { BuildEventStreamProtos.BuildEventId.TargetCompletedId targetId = BuildEventStreamProtos.BuildEventId.TargetCompletedId.newBuilder() diff --git a/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto b/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto index 1ff9d6a021..9d6af941f8 100644 --- a/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto +++ b/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto @@ -51,6 +51,10 @@ message BuildEventId { // Identifier of an event indicating that a target pattern has been expanded // further. + // Messages of this shape are also used to describe parts of a pattern that + // have been skipped for some reason, if the actual expasion was still carried + // out (e.g., if keep_going is set). In this case, the pattern_skipped choice + // in the id field is to be made. message PatternExpandedId { repeated string pattern = 1; } @@ -94,6 +98,7 @@ message BuildEventId { ProgressId progress = 2; BuildStartedId started = 3; PatternExpandedId pattern = 4; + PatternExpandedId pattern_skipped = 10; TargetCompletedId target_completed = 5; ActionCompletedId action_completed = 6; TestResultId test_result = 8; @@ -135,6 +140,12 @@ message Aborted { string description = 2; } +// Payload of an event indicating that an expected event will not come, as +// something went wrong when attempting to load the corresponding package. +message LoadingFailure { + string details = 1; +} + // Payload of an event indicating the beginning of a new build. Usually, events // of those type start a new build-event stream. The target pattern requested // to be build is contained in one of the announced child events; it is an @@ -273,6 +284,7 @@ message BuildEvent { oneof payload { Progress progress = 3; Aborted aborted = 4; + LoadingFailure loading_failed = 11; BuildStarted started = 5; PatternExpanded expanded = 6; ActionExecuted action = 7; |