summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/remote/bazel/bazel_api.cpp
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2022-10-06 12:18:25 +0200
committerOliver Reiche <oliver.reiche@huawei.com>2022-10-07 13:30:06 +0200
commit51f8b186803292f111011d04d5291deb374dc34c (patch)
tree818606bb46be19cc56618f1d56eb5e3f309f4fae /src/buildtool/execution_api/remote/bazel/bazel_api.cpp
parent64b8da270611ebb997c3801f09bd06878aee026a (diff)
downloadjustbuild-51f8b186803292f111011d04d5291deb374dc34c.tar.gz
LocalTreeMap: Prevent tree objects from being stored
... to align with the original idea of caching a flat list of blob objects, without the need to recursively traverse any trees. Consequently, we cannot create any map entry in places where we do not have all sub-tree entries at hand (e.g., LocalAPI, BazelAPI, BazelResponse).
Diffstat (limited to 'src/buildtool/execution_api/remote/bazel/bazel_api.cpp')
-rw-r--r--src/buildtool/execution_api/remote/bazel/bazel_api.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp
index a8846325..d1de9a68 100644
--- a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp
+++ b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp
@@ -24,9 +24,8 @@ BazelApi::BazelApi(std::string const& instance_name,
std::string const& host,
Port port,
ExecutionConfiguration const& exec_config) noexcept {
- tree_map_ = std::make_shared<LocalTreeMap>();
- network_ = std::make_shared<BazelNetwork>(
- instance_name, host, port, exec_config, tree_map_);
+ network_ =
+ std::make_shared<BazelNetwork>(instance_name, host, port, exec_config);
}
// implement move constructor in cpp, where all members are complete types
@@ -44,7 +43,6 @@ auto BazelApi::CreateAction(
std::map<std::string, std::string> const& properties) noexcept
-> IExecutionAction::Ptr {
return std::unique_ptr<BazelAction>{new BazelAction{network_,
- tree_map_,
root_digest,
command,
output_files,
@@ -227,11 +225,9 @@ auto BazelApi::CreateAction(
std::vector<DependencyGraph::NamedArtifactNodePtr> const&
artifacts) noexcept -> std::optional<ArtifactDigest> {
BlobContainer blobs{};
- auto tree = tree_map_->CreateTree();
auto digest = BazelMsgFactory::CreateDirectoryDigestFromTree(
artifacts,
- [&blobs](BazelBlob&& blob) { blobs.Emplace(std::move(blob)); },
- [&tree](auto path, auto info) { return tree.AddInfo(path, info); });
+ [&blobs](BazelBlob&& blob) { blobs.Emplace(std::move(blob)); });
if (not digest) {
Logger::Log(LogLevel::Debug, "failed to create digest for tree.");
return std::nullopt;
@@ -248,10 +244,8 @@ auto BazelApi::CreateAction(
Logger::Log(LogLevel::Debug, "failed to upload blobs for tree.");
return std::nullopt;
}
- if (tree_map_->AddTree(*digest, std::move(tree))) {
- return ArtifactDigest{*digest};
- }
- return std::nullopt;
+
+ return ArtifactDigest{*digest};
}
[[nodiscard]] auto BazelApi::IsAvailable(