From 59677e140ed064813660641d8e841e0fcc4af0ea Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Wed, 14 Jun 2023 16:53:33 +0200 Subject: Allow non-upwards symlinks with local API --- src/buildtool/execution_api/local/local_action.hpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/buildtool/execution_api/local/local_action.hpp') diff --git a/src/buildtool/execution_api/local/local_action.hpp b/src/buildtool/execution_api/local/local_action.hpp index a49060e4..95f95ff4 100644 --- a/src/buildtool/execution_api/local/local_action.hpp +++ b/src/buildtool/execution_api/local/local_action.hpp @@ -38,6 +38,11 @@ class LocalAction final : public IExecutionAction { bool is_cached{}; }; + using OutputFileOrSymlink = + std::variant; + using OutputDirOrSymlink = + std::variant; + auto Execute(Logger const* logger) noexcept -> IExecutionResponse::Ptr final; @@ -112,13 +117,15 @@ class LocalAction final : public IExecutionAction { [[nodiscard]] auto CreateDirectoryStructure( std::filesystem::path const& exec_path) const noexcept -> bool; - [[nodiscard]] auto CollectOutputFile(std::filesystem::path const& exec_path, - std::string const& local_path) - const noexcept -> std::optional; + [[nodiscard]] auto CollectOutputFileOrSymlink( + std::filesystem::path const& exec_path, + std::string const& local_path) const noexcept + -> std::optional; - [[nodiscard]] auto CollectOutputDir(std::filesystem::path const& exec_path, - std::string const& local_path) - const noexcept -> std::optional; + [[nodiscard]] auto CollectOutputDirOrSymlink( + std::filesystem::path const& exec_path, + std::string const& local_path) const noexcept + -> std::optional; [[nodiscard]] auto CollectAndStoreOutputs( bazel_re::ActionResult* result, -- cgit v1.2.3