From 3865c8556bde5e614dc1e8c72f83fa1ed65abcd9 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Wed, 14 Jun 2023 16:40:48 +0200 Subject: bazel_msg_factory: Allow non-upwards symlinks in uploaded trees --- src/buildtool/execution_api/bazel_msg/bazel_blob.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 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 15845c08..ed82d92d 100644 --- a/src/buildtool/execution_api/bazel_msg/bazel_blob.hpp +++ b/src/buildtool/execution_api/bazel_msg/bazel_blob.hpp @@ -35,14 +35,15 @@ struct BazelBlob { bool is_exec{}; // optional: hint to put the blob in executable CAS }; -[[nodiscard]] static inline auto CreateBlobFromFile( - std::filesystem::path const& file_path) noexcept - -> std::optional { - auto const type = FileSystemManager::Type(file_path); +/// \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); if (not type) { return std::nullopt; } - auto const content = FileSystemManager::ReadFile(file_path, *type); + auto const content = FileSystemManager::ReadContentAtPath(fpath, *type); if (not content.has_value()) { return std::nullopt; } -- cgit v1.2.3