From b1ccb71a4bdbacd44843abfa9497576016962ed8 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Mon, 17 Mar 2025 14:31:58 +0100 Subject: execution_api: support reading off stdout/stderr digests --- .../execution_api/remote/bazel/bazel_response.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/buildtool/execution_api/remote/bazel/bazel_response.hpp') diff --git a/src/buildtool/execution_api/remote/bazel/bazel_response.hpp b/src/buildtool/execution_api/remote/bazel/bazel_response.hpp index b24763e0..df652141 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_response.hpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_response.hpp @@ -25,7 +25,9 @@ #include "gsl/gsl" #include "src/buildtool/common/artifact_digest.hpp" +#include "src/buildtool/common/artifact_digest_factory.hpp" #include "src/buildtool/common/bazel_types.hpp" +#include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/execution_api/common/execution_response.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_execution_client.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_network.hpp" @@ -52,6 +54,24 @@ class BazelResponse final : public IExecutionResponse { auto StdOut() noexcept -> std::string final { return ReadStringBlob(output_.action_result.stdout_digest()); } + auto StdErrDigest() noexcept -> std::optional final { + auto digest = ArtifactDigestFactory::FromBazel( + network_->GetHashFunction().GetType(), + output_.action_result.stderr_digest()); + if (digest) { + return *digest; + } + return std::nullopt; + } + auto StdOutDigest() noexcept -> std::optional final { + auto digest = ArtifactDigestFactory::FromBazel( + network_->GetHashFunction().GetType(), + output_.action_result.stdout_digest()); + if (digest) { + return *digest; + } + return std::nullopt; + } auto ExitCode() const noexcept -> int final { return output_.action_result.exit_code(); } -- cgit v1.2.3