summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2022-03-14 11:29:28 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2022-03-14 14:48:51 +0100
commita1b4820fdc1fff16be87bcb7ca5e54456011d204 (patch)
tree84ec5ffc579d66292c52638f1ac387eca3fa2c2b /src
parentd3eb02b9cb29dcda33bcd2a25fc005d24079aa00 (diff)
downloadjustbuild-a1b4820fdc1fff16be87bcb7ca5e54456011d204.tar.gz
BazelApi: Fix missing entries in cached trees from tree map
... as wrongfully only sub-tree entries were added to locally cached trees, although they should also store entries for files and executables.
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/execution_api/remote/bazel/bazel_network.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/buildtool/execution_api/remote/bazel/bazel_network.cpp b/src/buildtool/execution_api/remote/bazel/bazel_network.cpp
index ad160d0c..ea502480 100644
--- a/src/buildtool/execution_api/remote/bazel/bazel_network.cpp
+++ b/src/buildtool/execution_api/remote/bazel/bazel_network.cpp
@@ -280,15 +280,16 @@ auto BazelNetwork::ReadObjectInfosRecursively(
dir_map->at(digest),
[this, &dir_map, &store_info, &parent, &tree](
auto path, auto info) {
- return IsTreeObject(info.type)
- ? (not tree or
- tree->AddInfo(path, info)) and
- ReadObjectInfosRecursively(
- dir_map,
- store_info,
- parent / path,
- info.digest)
- : store_info(parent / path, info);
+ return (not tree or tree->AddInfo(path, info)) and
+ (IsTreeObject(info.type)
+ ? (not tree or
+ tree->AddInfo(path, info)) and
+ ReadObjectInfosRecursively(
+ dir_map,
+ store_info,
+ parent / path,
+ info.digest)
+ : store_info(parent / path, info));
}) and
(not tree_map_ or
tree_map_->AddTree(digest, std::move(*tree)));
@@ -305,14 +306,13 @@ auto BazelNetwork::ReadObjectInfosRecursively(
*dir,
[this, &dir_map, &store_info, &parent, &tree](auto path,
auto info) {
- return IsTreeObject(info.type)
- ? (not tree or tree->AddInfo(path, info)) and
- ReadObjectInfosRecursively(
- dir_map,
- store_info,
- parent / path,
- info.digest)
- : store_info(parent / path, info);
+ return (not tree or tree->AddInfo(path, info)) and
+ (IsTreeObject(info.type)
+ ? ReadObjectInfosRecursively(dir_map,
+ store_info,
+ parent / path,
+ info.digest)
+ : store_info(parent / path, info));
}) and
(not tree_map_ or tree_map_->AddTree(digest, std::move(*tree)));
}