From d5177881b4df769afcf18ca803f6c2f153285207 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Thu, 15 May 2025 16:28:08 +0200 Subject: Execution server: Let the underlying API handle invalid entries The execution server itself should not consider anything special in setting the response message to the client, instead let the underlying API fail or not during collection. --- .../execution_api/execution_service/execution_server.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'src/buildtool/execution_api/execution_service/execution_server.cpp') diff --git a/src/buildtool/execution_api/execution_service/execution_server.cpp b/src/buildtool/execution_api/execution_service/execution_server.cpp index 91c13d94..6f309021 100644 --- a/src/buildtool/execution_api/execution_service/execution_server.cpp +++ b/src/buildtool/execution_api/execution_service/execution_server.cpp @@ -44,7 +44,6 @@ #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/storage/garbage_collector.hpp" #include "src/utils/cpp/hex_string.hpp" -#include "src/utils/cpp/path.hpp" namespace { void SetTimeStamp( @@ -320,13 +319,7 @@ namespace { LocalCasReader reader(&storage.CAS()); if (ProtocolTraits::IsNative(storage.GetHashFunction().GetType())) { - // In native mode: Check validity of tree entries, otherwise set the - // digest directly. - if (not reader.ReadGitTree(digest)) { - auto const error = fmt::format( - "Found invalid entry in the Git Tree {}", digest.hash()); - return unexpected{error}; - } + // In native mode: set the digest directly. (*out_dir.mutable_tree_digest()) = ArtifactDigestFactory::ToBazel(digest); } @@ -373,13 +366,6 @@ namespace { "Failed to read the symlink content for {}", digest.hash())}; } - // in native mode, check that we do not pass invalid symlinks - if (ProtocolTraits::IsNative(storage.GetHashFunction().GetType()) and - not PathIsNonUpwards(*content)) { - auto const error = fmt::format("Invalid symlink for {}", digest.hash()); - return unexpected{error}; - } - *(out_link.mutable_target()) = *std::move(content); return out_link; } -- cgit v1.2.3