summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/remote/bazel/bazel_response.hpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2025-03-17 14:31:58 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2025-03-17 17:19:55 +0100
commitb1ccb71a4bdbacd44843abfa9497576016962ed8 (patch)
tree8067a825669baf7ca2dfd98f43da9d6c70c3e23f /src/buildtool/execution_api/remote/bazel/bazel_response.hpp
parentdd02daeb0ce20780ed96c4ab2738a7f2b8b986e5 (diff)
downloadjustbuild-b1ccb71a4bdbacd44843abfa9497576016962ed8.tar.gz
execution_api: support reading off stdout/stderr digests
Diffstat (limited to 'src/buildtool/execution_api/remote/bazel/bazel_response.hpp')
-rw-r--r--src/buildtool/execution_api/remote/bazel/bazel_response.hpp20
1 files changed, 20 insertions, 0 deletions
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<ArtifactDigest> 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<ArtifactDigest> 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();
}