summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_engine/executor
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-05-27 14:57:15 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-05-28 16:19:19 +0200
commitfd8ad0f561dd253bf7399ce9a4594242e918ca25 (patch)
treed72aa981cafc03d0f1aded827cb621fabe541fff /src/buildtool/execution_engine/executor
parent9bdd30f307b83a3901250a51780f308f5c4a0065 (diff)
downloadjustbuild-fd8ad0f561dd253bf7399ce9a4594242e918ca25.tar.gz
Use ArtifactBlobContainer in IExecutionApi
...instead of BazelBlobContainer to not bring bazel_re::Digest to IExecutionApi.
Diffstat (limited to 'src/buildtool/execution_engine/executor')
-rw-r--r--src/buildtool/execution_engine/executor/executor.hpp29
1 files changed, 15 insertions, 14 deletions
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<ObjectType::File>(*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),