diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2025-01-29 09:46:58 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-07 14:58:04 +0100 |
commit | 95792fb717bd84d500037b62c77a4949274e670d (patch) | |
tree | 9bb1765a57e4d6d42941a33aff7e9721dec8068e /src/buildtool/execution_engine/executor/executor.hpp | |
parent | ea2291d24d531a1ea221f1035636303ac0da787d (diff) | |
download | justbuild-95792fb717bd84d500037b62c77a4949274e670d.tar.gz |
Replace ArtifactBlobContainer and BazelBlobContainer
...with explicit std::unordered_set.
Diffstat (limited to 'src/buildtool/execution_engine/executor/executor.hpp')
-rw-r--r-- | src/buildtool/execution_engine/executor/executor.hpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/buildtool/execution_engine/executor/executor.hpp b/src/buildtool/execution_engine/executor/executor.hpp index 308e59fc..32186764 100644 --- a/src/buildtool/execution_engine/executor/executor.hpp +++ b/src/buildtool/execution_engine/executor/executor.hpp @@ -28,6 +28,7 @@ #include <sstream> #include <string> #include <unordered_map> +#include <unordered_set> #include <utility> #include <vector> @@ -335,7 +336,7 @@ class ExecutorImpl { } // upload missing entries (blobs or trees) - ArtifactBlobContainer container; + std::unordered_set<ArtifactBlob> container; for (auto const& [digest, value] : missing_entries) { auto const entry = value->second; auto content = entry->RawData(); @@ -350,7 +351,7 @@ class ExecutorImpl { std::move(*content), IsExecutableObject(entry->Type())}, /*exception_is_fatal=*/true, - [&api](ArtifactBlobContainer&& blobs) { + [&api](std::unordered_set<ArtifactBlob>&& blobs) { return api.Upload(std::move(blobs), /*skip_find_missing=*/true); })) { @@ -400,10 +401,9 @@ class ExecutorImpl { return false; } - return api.Upload(ArtifactBlobContainer{{ArtifactBlob{ - info.digest, - std::move(*content), - IsExecutableObject(info.type)}}}, + return api.Upload({ArtifactBlob{info.digest, + std::move(*content), + IsExecutableObject(info.type)}}, /*skip_find_missing=*/true); } @@ -492,10 +492,9 @@ class ExecutorImpl { } auto digest = ArtifactDigestFactory::HashDataAs<ObjectType::File>( hash_function, *content); - if (not api.Upload(ArtifactBlobContainer{ - {ArtifactBlob{digest, - std::move(*content), - IsExecutableObject(*object_type)}}})) { + if (not api.Upload({ArtifactBlob{digest, + std::move(*content), + IsExecutableObject(*object_type)}})) { return std::nullopt; } return Artifact::ObjectInfo{.digest = std::move(digest), |