diff options
Diffstat (limited to 'src/buildtool/execution_api/common')
-rw-r--r-- | src/buildtool/execution_api/common/artifact_blob_container.hpp | 3 | ||||
-rw-r--r-- | src/buildtool/execution_api/common/common_api.cpp | 10 | ||||
-rw-r--r-- | src/buildtool/execution_api/common/execution_api.hpp | 2 |
3 files changed, 6 insertions, 9 deletions
diff --git a/src/buildtool/execution_api/common/artifact_blob_container.hpp b/src/buildtool/execution_api/common/artifact_blob_container.hpp index 76b0692e..7aea21ab 100644 --- a/src/buildtool/execution_api/common/artifact_blob_container.hpp +++ b/src/buildtool/execution_api/common/artifact_blob_container.hpp @@ -15,12 +15,9 @@ #ifndef INCLUDED_SRC_BUILDTOOL_EXECUTION_API_COMMON_ARTIFACT_BLOB_CONTAINER_HPP #define INCLUDED_SRC_BUILDTOOL_EXECUTION_API_COMMON_ARTIFACT_BLOB_CONTAINER_HPP -#include <unordered_set> - #include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/execution_api/common/content_blob_container.hpp" using ArtifactBlob = ContentBlob<ArtifactDigest>; -using ArtifactBlobContainer = std::unordered_set<ArtifactBlob>; #endif // INCLUDED_SRC_BUILDTOOL_EXECUTION_API_COMMON_ARTIFACT_BLOB_CONTAINER_HPP diff --git a/src/buildtool/execution_api/common/common_api.cpp b/src/buildtool/execution_api/common/common_api.cpp index 41f71a07..8bd8f0e0 100644 --- a/src/buildtool/execution_api/common/common_api.cpp +++ b/src/buildtool/execution_api/common/common_api.cpp @@ -110,7 +110,7 @@ auto CommonUploadBlobTree(BlobTreePtr const& blob_tree, } // Process missing blobs. - ArtifactBlobContainer container; + std::unordered_set<ArtifactBlob> container; for (auto const& digest : missing_blobs_info->digests) { if (auto it = missing_blobs_info->back_map.find(digest); it != missing_blobs_info->back_map.end()) { @@ -127,7 +127,7 @@ auto CommonUploadBlobTree(BlobTreePtr const& blob_tree, &container, node->Blob(), /*exception_is_fatal=*/false, - [&api](ArtifactBlobContainer&& blobs) -> bool { + [&api](std::unordered_set<ArtifactBlob>&& blobs) -> bool { return api.Upload(std::move(blobs), /*skip_find_missing=*/true); })) { @@ -144,7 +144,7 @@ auto CommonUploadTreeCompatible( DirectoryTreePtr const& build_root, BazelMsgFactory::LinkDigestResolveFunc const& resolve_links) noexcept -> std::optional<ArtifactDigest> { - ArtifactBlobContainer blobs{}; + std::unordered_set<ArtifactBlob> blobs{}; // Store and upload blobs, taking into account the maximum transfer size. auto digest = BazelMsgFactory::CreateDirectoryDigestFromTree( build_root, resolve_links, [&blobs, &api](ArtifactBlob&& blob) { @@ -152,7 +152,7 @@ auto CommonUploadTreeCompatible( &blobs, std::move(blob), /*exception_is_fatal=*/false, - [&api](ArtifactBlobContainer&& container) -> bool { + [&api](std::unordered_set<ArtifactBlob>&& container) -> bool { return api.Upload(std::move(container), /*skip_find_missing=*/false); }); @@ -193,7 +193,7 @@ auto CommonUploadTreeNative(IExecutionApi const& api, "failed to upload blob tree for build root."); return std::nullopt; } - if (not api.Upload(ArtifactBlobContainer{{tree_blob}}, + if (not api.Upload({tree_blob}, /*skip_find_missing=*/true)) { Logger::Log(LogLevel::Debug, "failed to upload tree blob for build root."); diff --git a/src/buildtool/execution_api/common/execution_api.hpp b/src/buildtool/execution_api/common/execution_api.hpp index f0ea0e4e..1d4f0d5d 100644 --- a/src/buildtool/execution_api/common/execution_api.hpp +++ b/src/buildtool/execution_api/common/execution_api.hpp @@ -119,7 +119,7 @@ class IExecutionApi { /// \param skip_find_missing Skip finding missing blobs, just upload all. /// NOLINTNEXTLINE(google-default-arguments) [[nodiscard]] virtual auto Upload( - ArtifactBlobContainer&& blobs, + std::unordered_set<ArtifactBlob>&& blobs, bool skip_find_missing = false) const noexcept -> bool = 0; [[nodiscard]] virtual auto UploadTree( |