From 1f4edf773b98ad04cc24f281b8cfb64255f72fb1 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Fri, 9 Sep 2022 10:46:47 +0200 Subject: Just-MR: Add repos-to-setup map Contains the logic for the checkout of all supported repositories. --- src/other_tools/just_mr/utils.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/other_tools/just_mr/utils.hpp') diff --git a/src/other_tools/just_mr/utils.hpp b/src/other_tools/just_mr/utils.hpp index 2da0155a..dffed7c1 100644 --- a/src/other_tools/just_mr/utils.hpp +++ b/src/other_tools/just_mr/utils.hpp @@ -18,6 +18,7 @@ #include #include "nlohmann/json.hpp" +#include "src/buildtool/build_engine/expression/configuration.hpp" #include "src/buildtool/execution_api/local/config.hpp" #include "src/buildtool/main/constants.hpp" #include "src/utils/cpp/tmp_dir.hpp" @@ -152,6 +153,21 @@ namespace Utils { void AddDistfileToCAS(std::filesystem::path const& distfile, JustMR::PathsPtr const& just_mr_paths) noexcept; +/// \brief Recursive part of the ResolveRepo function. +/// Keeps track of repository names to detect any cyclic dependencies. +auto ResolveRepo(ExpressionPtr const& repo_desc, + ExpressionPtr const& repos, + gsl::not_null*> const& seen) + -> std::optional; + +/// \brief Resolves any cyclic dependency issues and follows the repository +/// dependencies until the one containing the WS root is found. +/// Returns a repository entry as an ExpressionPtr, or nullopt if cyclic +/// dependency found. +auto ResolveRepo(ExpressionPtr const& repo_desc, + ExpressionPtr const& repos) noexcept + -> std::optional; + } // namespace Utils } // namespace JustMR -- cgit v1.2.3