summaryrefslogtreecommitdiff
path: root/src/buildtool/serve_api/remote/target_client.hpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-05-14 14:44:29 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-05-21 15:09:17 +0200
commit9e888fe80a835b084a28f7b9cb4b5759b4eaf47a (patch)
tree8cb0beaabdcaaef6e46bbb8d690c98a4295e9bdc /src/buildtool/serve_api/remote/target_client.hpp
parent87d4eac4664ff520890000d68ce43b493df171a3 (diff)
downloadjustbuild-9e888fe80a835b084a28f7b9cb4b5759b4eaf47a.tar.gz
serve target: Improve logic for local build failure triggers
If the serve endpoint reports an internal error, local builds should not continue and the error message should be provided. Similarly, if the serve endpoint promises the target cache value to be in remote CAS, but the client cannot find or process it as needed, then a local build again should not continue and the reason be provided as an error message. (cherry picked from ab0a06871391a84c9b904bc9f2cd74ee1e8903ea)
Diffstat (limited to 'src/buildtool/serve_api/remote/target_client.hpp')
-rw-r--r--src/buildtool/serve_api/remote/target_client.hpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/buildtool/serve_api/remote/target_client.hpp b/src/buildtool/serve_api/remote/target_client.hpp
index 948e9337..0d34ea2d 100644
--- a/src/buildtool/serve_api/remote/target_client.hpp
+++ b/src/buildtool/serve_api/remote/target_client.hpp
@@ -34,12 +34,17 @@
/// \brief Result union for the ServeTarget request.
/// Index 0 will contain the hash of the blob containing the logged
-/// analysis/build failure received from the endpoint, as a string.
-/// Index 1 will contain any other failure message, as a string.
-/// Index 2 will contain the target cache value information on success.
+/// analysis/build failure received from the endpoint, as a string; this should
+/// also trigger a local build fail.
+/// Index 1 will contain the message of any INTERNAL error on the endpoint, as
+/// a string; this should trigger a local build fail.
+/// Index 2 will contain any other failure message, as a string; local builds
+/// might be able to continue, but with a warning.
+/// Index 3 will contain the target cache value information on success.
using serve_target_result_t =
std::variant<std::string,
std::string,
+ std::string,
std::pair<TargetCacheEntry, Artifact::ObjectInfo>>;
/// Implements client side for Target service defined in: