From 149fe52517653a3a5c2ef5f2be2ab09415eedba4 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Fri, 7 Oct 2022 16:26:51 +0200 Subject: Fix upload of known source trees When a tree is taken from a git root, it is not necessarily known on the remote site. So, as any missing artifact it has to be uploaded, recursively uploading the parts to keep the tree invariant. The function RetrieveToCas was doing the correct recursiv pattern, however inspecting trees incorrectly using the function ReadTreeInfos; the latter function, however, was obtaining all the leafs of the tree as is needed for a compatible action-input description. Add and use a function that reads the direct contents of a tree. --- src/buildtool/execution_api/remote/bazel/bazel_api.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/buildtool/execution_api/remote/bazel/bazel_api.cpp') diff --git a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp index d1de9a68..34cb129e 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp @@ -170,8 +170,8 @@ auto BazelApi::CreateAction( std::vector blob_digests{}; for (auto const& info : missing_artifacts_info) { if (IsTreeObject(info.type)) { - auto const infos = - network_->ReadTreeInfos(info.digest, std::filesystem::path{}); + auto const infos = network_->ReadTreeInfosDirect( + info.digest, std::filesystem::path{}); if (not infos or not RetrieveToCas(infos->second, api)) { return false; } -- cgit v1.2.3