summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/local/local_action.hpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-07-04 13:26:00 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-07-05 15:22:36 +0200
commitd96d56340883ecad0767139638cd10872d867acc (patch)
tree8861ad9637ec356b18a4f8373ff06f177e3e526b /src/buildtool/execution_api/local/local_action.hpp
parentabe2c89fc0e4f41f00aca3510e9bb4902e52c9e7 (diff)
downloadjustbuild-d96d56340883ecad0767139638cd10872d867acc.tar.gz
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.
Diffstat (limited to 'src/buildtool/execution_api/local/local_action.hpp')
-rw-r--r--src/buildtool/execution_api/local/local_action.hpp10
1 files changed, 8 insertions, 2 deletions
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 <map>
#include <memory>
#include <string>
+#include <unordered_map>
#include <utility> // std::move
#include <vector>
@@ -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<bazel_re::OutputDirectory, bazel_re::OutputSymlink>;
+ using FileCopies = std::unordered_map<Artifact::ObjectInfo, TmpDirPtr>;
+
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<FileCopies*> 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<FileCopies*> copies) const noexcept -> bool;
[[nodiscard]] auto CreateDirectoryStructure(
std::filesystem::path const& exec_path) const noexcept -> bool;