diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/execution_api/remote/TARGETS | 1 | ||||
-rw-r--r-- | src/buildtool/execution_api/remote/bazel/bazel_response.cpp | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/buildtool/execution_api/remote/TARGETS b/src/buildtool/execution_api/remote/TARGETS index b05404ed..492bd0de 100644 --- a/src/buildtool/execution_api/remote/TARGETS +++ b/src/buildtool/execution_api/remote/TARGETS @@ -24,6 +24,7 @@ , ["src/buildtool/logging", "logging"] , ["src/buildtool/file_system", "file_system_manager"] , ["src/buildtool/file_system", "object_type"] + , ["src/buildtool/compatibility", "compatibility"] , ["src/buildtool/execution_api/common", "common"] , ["src/buildtool/execution_api/bazel_msg", "bazel_msg_factory"] , ["@", "grpc", "", "grpc++"] diff --git a/src/buildtool/execution_api/remote/bazel/bazel_response.cpp b/src/buildtool/execution_api/remote/bazel/bazel_response.cpp index 2dbb7653..395fd08e 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_response.cpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_response.cpp @@ -1,6 +1,7 @@ #include "src/buildtool/execution_api/remote/bazel/bazel_response.hpp" #include "gsl-lite/gsl-lite.hpp" +#include "src/buildtool/compatibility/native_support.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp" #include "src/buildtool/logging/logger.hpp" @@ -34,6 +35,22 @@ auto BazelResponse::Artifacts() const noexcept -> ArtifactInfos { } } + if (not Compatibility::IsCompatible()) { + // in native mode: just collect and store tree digests + for (auto const& tree : action_result.output_directories()) { + gsl_ExpectsAudit(NativeSupport::IsTree(tree.tree_digest().hash())); + try { + artifacts.emplace( + tree.path(), + Artifact::ObjectInfo{ArtifactDigest{tree.tree_digest()}, + ObjectType::Tree}); + } catch (...) { + return {}; + } + } + return artifacts; + } + // obtain tree digests for output directories std::vector<bazel_re::Digest> tree_digests{}; tree_digests.reserve( |