From d96d56340883ecad0767139638cd10872d867acc Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Thu, 4 Jul 2024 13:26:00 +0200 Subject: local action: copy input file on reaching symlink limit ... and continue with the newly created copy as target for the next hard links. In this way, we get rid of the restriction we used to have that the number of identical inputs be not greater than the hardlink limit. --- src/buildtool/execution_api/local/local_action.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 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 13f1e4c0..a6c69b29 100644 --- a/src/buildtool/execution_api/local/local_action.hpp +++ b/src/buildtool/execution_api/local/local_action.hpp @@ -19,6 +19,7 @@ #include #include #include +#include #include // std::move #include @@ -29,6 +30,7 @@ #include "src/buildtool/logging/logger.hpp" #include "src/buildtool/storage/config.hpp" #include "src/buildtool/storage/storage.hpp" +#include "src/utils/cpp/tmp_dir.hpp" class LocalApi; @@ -47,6 +49,8 @@ class LocalAction final : public IExecutionAction { using OutputDirOrSymlink = std::variant; + using FileCopies = std::unordered_map; + auto Execute(Logger const* logger) noexcept -> IExecutionResponse::Ptr final; @@ -111,7 +115,8 @@ class LocalAction final : public IExecutionAction { [[nodiscard]] auto StageInput( std::filesystem::path const& target_path, - Artifact::ObjectInfo const& info) const noexcept -> bool; + Artifact::ObjectInfo const& info, + gsl::not_null copies) const noexcept -> bool; /// \brief Stage input artifacts and leaf trees to the execution directory. /// Stage artifacts and their parent directory structure from CAS to the @@ -119,7 +124,8 @@ class LocalAction final : public IExecutionAction { /// \param[in] exec_path Absolute path to the execution directory. /// \returns Success indicator. [[nodiscard]] auto StageInputs( - std::filesystem::path const& exec_path) const noexcept -> bool; + std::filesystem::path const& exec_path, + gsl::not_null copies) const noexcept -> bool; [[nodiscard]] auto CreateDirectoryStructure( std::filesystem::path const& exec_path) const noexcept -> bool; -- cgit v1.2.3