diff options
Diffstat (limited to 'src/buildtool/execution_api')
4 files changed, 15 insertions, 9 deletions
diff --git a/src/buildtool/execution_api/common/execution_api.hpp b/src/buildtool/execution_api/common/execution_api.hpp index de1f89c0..ffa31483 100644 --- a/src/buildtool/execution_api/common/execution_api.hpp +++ b/src/buildtool/execution_api/common/execution_api.hpp @@ -60,10 +60,14 @@ class IExecutionApi { /// \brief Retrieve artifacts from CAS and store to specified paths. /// Tree artifacts are resolved its containing file artifacts are /// recursively retrieved. + /// If the alternative is provided, it can be assumed that this + /// alternative CAS is more close, but it might not contain all the + /// needed artifacts. + /// NOLINTNEXTLINE(google-default-arguments) [[nodiscard]] virtual auto RetrieveToPaths( std::vector<Artifact::ObjectInfo> const& artifacts_info, - std::vector<std::filesystem::path> const& output_paths) noexcept - -> bool = 0; + std::vector<std::filesystem::path> const& output_paths, + IExecutionApi* alternative = nullptr) noexcept -> bool = 0; /// \brief Retrieve artifacts from CAS and write to file descriptors. /// Tree artifacts are not resolved and instead the tree object will be diff --git a/src/buildtool/execution_api/local/local_api.hpp b/src/buildtool/execution_api/local/local_api.hpp index dbfb3504..05fbeeda 100644 --- a/src/buildtool/execution_api/local/local_api.hpp +++ b/src/buildtool/execution_api/local/local_api.hpp @@ -53,11 +53,11 @@ class LocalApi final : public IExecutionApi { properties}}; } - // NOLINTNEXTLINE(misc-no-recursion) + // NOLINTNEXTLINE(misc-no-recursion,google-default-arguments) [[nodiscard]] auto RetrieveToPaths( std::vector<Artifact::ObjectInfo> const& artifacts_info, - std::vector<std::filesystem::path> const& output_paths) noexcept - -> bool final { + std::vector<std::filesystem::path> const& output_paths, + IExecutionApi* /*alternative*/ = nullptr) noexcept -> bool final { if (artifacts_info.size() != output_paths.size()) { Logger::Log(LogLevel::Error, "different number of digests and output paths."); diff --git a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp index ce25c51c..e98b0b5e 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp @@ -69,10 +69,11 @@ auto BazelApi::CreateAction( properties}}; } -// NOLINTNEXTLINE(misc-no-recursion) +// NOLINTNEXTLINE(misc-no-recursion, google-default-arguments) [[nodiscard]] auto BazelApi::RetrieveToPaths( std::vector<Artifact::ObjectInfo> const& artifacts_info, - std::vector<std::filesystem::path> const& output_paths) noexcept -> bool { + std::vector<std::filesystem::path> const& output_paths, + IExecutionApi* /* alternative */) noexcept -> bool { if (artifacts_info.size() != output_paths.size()) { Logger::Log(LogLevel::Error, "different number of digests and output paths."); diff --git a/src/buildtool/execution_api/remote/bazel/bazel_api.hpp b/src/buildtool/execution_api/remote/bazel/bazel_api.hpp index a435824e..111a09cf 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_api.hpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_api.hpp @@ -53,10 +53,11 @@ class BazelApi final : public IExecutionApi { std::map<std::string, std::string> const& properties) noexcept -> IExecutionAction::Ptr final; + // NOLINTNEXTLINE(google-default-arguments) [[nodiscard]] auto RetrieveToPaths( std::vector<Artifact::ObjectInfo> const& artifacts_info, - std::vector<std::filesystem::path> const& output_paths) noexcept - -> bool final; + std::vector<std::filesystem::path> const& output_paths, + IExecutionApi* alternative = nullptr) noexcept -> bool final; [[nodiscard]] auto RetrieveToFds( std::vector<Artifact::ObjectInfo> const& artifacts_info, |