summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/bazel_msg/bazel_blob.hpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-06-14 16:40:48 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-06-26 17:57:29 +0200
commit3865c8556bde5e614dc1e8c72f83fa1ed65abcd9 (patch)
tree7c4f118c07fe35a89deadbc9f4aa09b2f5f64e87 /src/buildtool/execution_api/bazel_msg/bazel_blob.hpp
parentdb961e1e9fba6e0c439f69ac8342ef887d9d19a6 (diff)
downloadjustbuild-3865c8556bde5e614dc1e8c72f83fa1ed65abcd9.tar.gz
bazel_msg_factory: Allow non-upwards symlinks in uploaded trees
Diffstat (limited to 'src/buildtool/execution_api/bazel_msg/bazel_blob.hpp')
-rw-r--r--src/buildtool/execution_api/bazel_msg/bazel_blob.hpp11
1 files changed, 6 insertions, 5 deletions
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<BazelBlob> {
- 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<BazelBlob> {
+ 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;
}