From a8cbdab9f795999cf99458e63343e13322402739 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 28 May 2024 11:24:46 +0200 Subject: Move CreateBlobFromPath since it is only used in tests. --- .../execution_api/bazel_msg/bazel_blob.hpp | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'src/buildtool/execution_api/bazel_msg/bazel_blob.hpp') diff --git a/src/buildtool/execution_api/bazel_msg/bazel_blob.hpp b/src/buildtool/execution_api/bazel_msg/bazel_blob.hpp index 75ceb97f..75f174b5 100644 --- a/src/buildtool/execution_api/bazel_msg/bazel_blob.hpp +++ b/src/buildtool/execution_api/bazel_msg/bazel_blob.hpp @@ -15,15 +15,10 @@ #ifndef INCLUDED_SRC_BUILDTOOL_EXECUTION_API_BAZEL_MSG_BAZEL_BLOB_HPP #define INCLUDED_SRC_BUILDTOOL_EXECUTION_API_BAZEL_MSG_BAZEL_BLOB_HPP -#include -#include -#include #include #include // std::move -#include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/common/bazel_types.hpp" -#include "src/buildtool/file_system/file_system_manager.hpp" struct BazelBlob { BazelBlob(bazel_re::Digest mydigest, std::string mydata, bool is_exec) @@ -36,21 +31,4 @@ struct BazelBlob { bool is_exec{}; // optional: hint to put the blob in executable CAS }; -/// \brief Create a blob from the content found in file or symlink pointed to by -/// given path. -[[nodiscard]] static inline auto CreateBlobFromPath( - std::filesystem::path const& fpath) noexcept -> std::optional { - auto const type = FileSystemManager::Type(fpath, /*allow_upwards=*/true); - if (not type) { - return std::nullopt; - } - auto const content = FileSystemManager::ReadContentAtPath(fpath, *type); - if (not content.has_value()) { - return std::nullopt; - } - return BazelBlob{ArtifactDigest::Create(*content), - *content, - IsExecutableObject(*type)}; -} - #endif // INCLUDED_SRC_BUILDTOOL_EXECUTION_API_BAZEL_MSG_BAZEL_BLOB_HPP -- cgit v1.2.3