diff options
Diffstat (limited to 'src/buildtool/execution_api/remote/bazel/bazel_response.hpp')
-rw-r--r-- | src/buildtool/execution_api/remote/bazel/bazel_response.hpp | 20 |
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(); } |