From a1b4820fdc1fff16be87bcb7ca5e54456011d204 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Mon, 14 Mar 2022 11:29:28 +0100 Subject: 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. --- .../execution_api/remote/bazel/bazel_network.cpp | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src') 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))); } -- cgit v1.2.3