From 5c8cd3df4b1b9aaf3ef05c304be75b5faea82366 Mon Sep 17 00:00:00 2001 From: Matt Mackay Date: Mon, 31 Jul 2023 13:26:50 -0700 Subject: [PATCH] feat: add option to exit early if analysis cache is discarded [ (cherry picked from commit af3591f4f7db51dfe3132311fb67dae04114fac7) --- .../build/lib/buildeventstream/proto/build_event_stream.proto | 3 +++ third_party/bazel/src/main/protobuf/failure_details.proto | 2 ++ 2 files changed, 5 insertions(+) diff --git a/third_party/bazel/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto b/third_party/bazel/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto index a34fb15bff4..c5f8a8fce6a 100644 --- a/third_party/bazel/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto +++ b/third_party/bazel/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto @@ -836,6 +836,9 @@ message BuildFinished { google.protobuf.Timestamp finish_time = 5; AnomalyReport anomaly_report = 4 [deprecated = true]; + + // Only populated if success = false, and sometimes not even then. + failure_details.FailureDetail failure_detail = 6; } message BuildMetrics { diff --git a/third_party/bazel/src/main/protobuf/failure_details.proto b/third_party/bazel/src/main/protobuf/failure_details.proto index 17d313bce84..ca793a22f2e 100644 --- a/third_party/bazel/src/main/protobuf/failure_details.proto +++ b/third_party/bazel/src/main/protobuf/failure_details.proto @@ -608,6 +608,7 @@ message BuildConfiguration { // possibilities in Bazel, so we go with the more straightforward // command-line error exit code 2. INVALID_OUTPUT_DIRECTORY_MNEMONIC = 11 [(metadata) = { exit_code: 2 }]; + CONFIGURATION_DISCARDED_ANALYSIS_CACHE = 12 [(metadata) = { exit_code: 2 }]; } Code code = 1; @@ -1197,6 +1198,7 @@ message Analysis { CONFIGURED_VALUE_CREATION_FAILED = 18 [(metadata) = { exit_code: 1 }]; INCOMPATIBLE_TARGET_REQUESTED = 19 [(metadata) = { exit_code: 1 }]; ANALYSIS_FAILURE_PROPAGATION_FAILED = 20 [(metadata) = { exit_code: 1 }]; + ANALYSIS_CACHE_DISCARDED = 21 [(metadata) = { exit_code: 1 }]; } Code code = 1;