summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/execution_service/execution_server.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-05-15 16:28:08 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-06-04 14:34:44 +0200
commitd5177881b4df769afcf18ca803f6c2f153285207 (patch)
tree3212598d7cebd8bf4f01616062920a746c22af06 /src/buildtool/execution_api/execution_service/execution_server.cpp
parent7365f35857e89913adbf42f09ce806f7b3183487 (diff)
downloadjustbuild-d5177881b4df769afcf18ca803f6c2f153285207.tar.gz
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.
Diffstat (limited to 'src/buildtool/execution_api/execution_service/execution_server.cpp')
-rw-r--r--src/buildtool/execution_api/execution_service/execution_server.cpp16
1 files changed, 1 insertions, 15 deletions
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;
}