From fd8ad0f561dd253bf7399ce9a4594242e918ca25 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Mon, 27 May 2024 14:57:15 +0200 Subject: Use ArtifactBlobContainer in IExecutionApi ...instead of BazelBlobContainer to not bring bazel_re::Digest to IExecutionApi. --- .../execution_engine/executor/executor.hpp | 29 +++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'src/buildtool/execution_engine/executor/executor.hpp') diff --git a/src/buildtool/execution_engine/executor/executor.hpp b/src/buildtool/execution_engine/executor/executor.hpp index 7f931cbd..2f14446a 100644 --- a/src/buildtool/execution_engine/executor/executor.hpp +++ b/src/buildtool/execution_engine/executor/executor.hpp @@ -295,7 +295,7 @@ class ExecutorImpl { } // upload missing entries (blobs or trees) - BazelBlobContainer container; + ArtifactBlobContainer container; for (auto const& digest : missing_digests) { if (auto it = entry_map.find(digest); it != entry_map.end()) { auto const& entry = it->second; @@ -304,10 +304,10 @@ class ExecutorImpl { return false; } try { - container.Emplace(std::move( - BazelBlob{digest, - std::move(*content), - IsExecutableObject(entry->Type())})); + container.Emplace( + ArtifactBlob{digest, + std::move(*content), + IsExecutableObject(entry->Type())}); } catch (std::exception const& ex) { Logger::Log(LogLevel::Error, "failed to create blob with: ", @@ -317,7 +317,7 @@ class ExecutorImpl { } } - return api->Upload(container, /*skip_find_missing=*/true); + return api->Upload(std::move(container), /*skip_find_missing=*/true); } /// \brief Lookup blob via digest in local git repositories and upload. @@ -360,10 +360,11 @@ class ExecutorImpl { return false; } - // upload artifact content - auto container = BazelBlobContainer{{BazelBlob{ - info.digest, std::move(*content), IsExecutableObject(info.type)}}}; - return api->Upload(container, /*skip_find_missing=*/true); + return api->Upload(ArtifactBlobContainer{{ArtifactBlob{ + info.digest, + std::move(*content), + IsExecutableObject(info.type)}}}, + /*skip_find_missing=*/true); } [[nodiscard]] static auto ReadGitBlob( @@ -447,10 +448,10 @@ class ExecutorImpl { return std::nullopt; } auto digest = ArtifactDigest::Create(*content); - if (not api->Upload(BazelBlobContainer{ - {BazelBlob{digest, - std::move(*content), - IsExecutableObject(*object_type)}}})) { + if (not api->Upload(ArtifactBlobContainer{ + {ArtifactBlob{digest, + std::move(*content), + IsExecutableObject(*object_type)}}})) { return std::nullopt; } return Artifact::ObjectInfo{.digest = std::move(digest), -- cgit v1.2.3