diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2022-07-14 13:41:31 +0200 |
---|---|---|
committer | Sascha Roloff <sascha.roloff@huawei.com> | 2022-08-05 14:41:31 +0200 |
commit | 087d73496115c2a04d5cd40b6b0205f0562f81dc (patch) | |
tree | 5a3bad002fbcee485a6e9affbe8d5c356e404f63 /src/buildtool/execution_api/remote/bazel/bazel_response.cpp | |
parent | daca274041e31636f08927b0cebc56fd33c7bbdf (diff) | |
download | justbuild-087d73496115c2a04d5cd40b6b0205f0562f81dc.tar.gz |
BazelResponse: Support collecting output dirs in native mode
Diffstat (limited to 'src/buildtool/execution_api/remote/bazel/bazel_response.cpp')
-rw-r--r-- | src/buildtool/execution_api/remote/bazel/bazel_response.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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( |