diff options
Diffstat (limited to 'src/other_tools/root_maps')
-rw-r--r-- | src/other_tools/root_maps/commit_git_map.cpp | 50 | ||||
-rw-r--r-- | src/other_tools/root_maps/commit_git_map.hpp | 2 | ||||
-rw-r--r-- | src/other_tools/root_maps/content_git_map.cpp | 23 | ||||
-rw-r--r-- | src/other_tools/root_maps/content_git_map.hpp | 2 | ||||
-rw-r--r-- | src/other_tools/root_maps/distdir_git_map.cpp | 2 | ||||
-rw-r--r-- | src/other_tools/root_maps/distdir_git_map.hpp | 2 | ||||
-rw-r--r-- | src/other_tools/root_maps/fpath_git_map.cpp | 19 | ||||
-rw-r--r-- | src/other_tools/root_maps/fpath_git_map.hpp | 2 | ||||
-rw-r--r-- | src/other_tools/root_maps/root_utils.cpp | 13 | ||||
-rw-r--r-- | src/other_tools/root_maps/root_utils.hpp | 2 | ||||
-rw-r--r-- | src/other_tools/root_maps/tree_id_git_map.cpp | 2 | ||||
-rw-r--r-- | src/other_tools/root_maps/tree_id_git_map.hpp | 2 |
12 files changed, 58 insertions, 63 deletions
diff --git a/src/other_tools/root_maps/commit_git_map.cpp b/src/other_tools/root_maps/commit_git_map.cpp index a4681a6a..a4f2b8eb 100644 --- a/src/other_tools/root_maps/commit_git_map.cpp +++ b/src/other_tools/root_maps/commit_git_map.cpp @@ -58,14 +58,13 @@ namespace { /// root if it was marked absent. /// It guarantees the logger is called exactly once with fatal on failure, and /// the setter on success. -void EnsureRootAsAbsent( - std::string const& tree_id, - std::filesystem::path const& repo_root, - GitRepoInfo const& repo_info, - std::optional<ServeApi> const& serve, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, - CommitGitMap::SetterPtr const& ws_setter, - CommitGitMap::LoggerPtr const& logger) { +void EnsureRootAsAbsent(std::string const& tree_id, + std::filesystem::path const& repo_root, + GitRepoInfo const& repo_info, + std::optional<ServeApi> const& serve, + IExecutionApi::OptionalPtr const& remote_api, + CommitGitMap::SetterPtr const& ws_setter, + CommitGitMap::LoggerPtr const& logger) { // this is an absent root if (serve) { // check if the serve endpoint has this root @@ -401,23 +400,22 @@ void NetworkFetchAndSetPresentRoot( /// the root. /// It guarantees the logger is called exactly once with fatal on failure, and /// the setter on success. -void EnsureCommit( - GitRepoInfo const& repo_info, - std::filesystem::path const& repo_root, - std::string const& fetch_repo, - MirrorsPtr const& additional_mirrors, - GitCASPtr const& git_cas, - gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map, - gsl::not_null<ImportToGitMap*> const& import_to_git_map, - std::string const& git_bin, - std::vector<std::string> const& launcher, - std::optional<ServeApi> const& serve, - gsl::not_null<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, - bool fetch_absent, - gsl::not_null<TaskSystem*> const& ts, - CommitGitMap::SetterPtr const& ws_setter, - CommitGitMap::LoggerPtr const& logger) { +void EnsureCommit(GitRepoInfo const& repo_info, + std::filesystem::path const& repo_root, + std::string const& fetch_repo, + MirrorsPtr const& additional_mirrors, + GitCASPtr const& git_cas, + gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map, + gsl::not_null<ImportToGitMap*> const& import_to_git_map, + std::string const& git_bin, + std::vector<std::string> const& launcher, + std::optional<ServeApi> const& serve, + gsl::not_null<IExecutionApi const*> const& local_api, + IExecutionApi::OptionalPtr const& remote_api, + bool fetch_absent, + gsl::not_null<TaskSystem*> const& ts, + CommitGitMap::SetterPtr const& ws_setter, + CommitGitMap::LoggerPtr const& logger) { // link fake repo to odb auto git_repo = GitRepoRemote::Open(git_cas); if (not git_repo) { @@ -925,7 +923,7 @@ auto CreateCommitGitMap( std::vector<std::string> const& launcher, std::optional<ServeApi> const& serve, gsl::not_null<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, bool fetch_absent, std::size_t jobs) -> CommitGitMap { auto commit_to_git = [critical_git_op_map, diff --git a/src/other_tools/root_maps/commit_git_map.hpp b/src/other_tools/root_maps/commit_git_map.hpp index d9f1a941..b76c1888 100644 --- a/src/other_tools/root_maps/commit_git_map.hpp +++ b/src/other_tools/root_maps/commit_git_map.hpp @@ -83,7 +83,7 @@ using CommitGitMap = std::vector<std::string> const& launcher, std::optional<ServeApi> const& serve, gsl::not_null<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, bool fetch_absent, std::size_t jobs) -> CommitGitMap; diff --git a/src/other_tools/root_maps/content_git_map.cpp b/src/other_tools/root_maps/content_git_map.cpp index 4052b963..440593d0 100644 --- a/src/other_tools/root_maps/content_git_map.cpp +++ b/src/other_tools/root_maps/content_git_map.cpp @@ -52,14 +52,13 @@ namespace { /// root if it was marked absent. /// It guarantees the logger is called exactly once with fatal on failure, and /// the setter on success. -void EnsureRootAsAbsent( - std::string const& tree_id, - ArchiveRepoInfo const& key, - std::optional<ServeApi> const& serve, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, - bool is_cache_hit, - ContentGitMap::SetterPtr const& ws_setter, - ContentGitMap::LoggerPtr const& logger) { +void EnsureRootAsAbsent(std::string const& tree_id, + ArchiveRepoInfo const& key, + std::optional<ServeApi> const& serve, + IExecutionApi::OptionalPtr const& remote_api, + bool is_cache_hit, + ContentGitMap::SetterPtr const& ws_setter, + ContentGitMap::LoggerPtr const& logger) { // this is an absent root if (serve) { // check if the serve endpoint has this root @@ -176,7 +175,7 @@ void ResolveContentTree( bool is_cache_hit, bool is_absent, std::optional<ServeApi> const& serve, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map, gsl::not_null<ResolveSymlinksMap*> const& resolve_symlinks_map, gsl::not_null<TaskSystem*> const& ts, @@ -365,7 +364,7 @@ void WriteIdFileAndSetWSRoot( std::filesystem::path const& archive_tree_id_file, bool is_absent, std::optional<ServeApi> const& serve, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map, gsl::not_null<ResolveSymlinksMap*> const& resolve_symlinks_map, gsl::not_null<TaskSystem*> const& ts, @@ -426,7 +425,7 @@ void ExtractAndImportToGit( std::filesystem::path const& archive_tree_id_file, bool is_absent, std::optional<ServeApi> const& serve, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map, gsl::not_null<ImportToGitMap*> const& import_to_git_map, gsl::not_null<ResolveSymlinksMap*> const& resolve_symlinks_map, @@ -510,7 +509,7 @@ auto CreateContentGitMap( gsl::not_null<ResolveSymlinksMap*> const& resolve_symlinks_map, gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map, std::optional<ServeApi> const& serve, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, bool fetch_absent, std::size_t jobs) -> ContentGitMap { auto gitify_content = [content_cas_map, diff --git a/src/other_tools/root_maps/content_git_map.hpp b/src/other_tools/root_maps/content_git_map.hpp index d7f2c531..015895ec 100644 --- a/src/other_tools/root_maps/content_git_map.hpp +++ b/src/other_tools/root_maps/content_git_map.hpp @@ -44,7 +44,7 @@ using ContentGitMap = gsl::not_null<ResolveSymlinksMap*> const& resolve_symlinks_map, gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map, std::optional<ServeApi> const& serve, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, bool fetch_absent, std::size_t jobs) -> ContentGitMap; diff --git a/src/other_tools/root_maps/distdir_git_map.cpp b/src/other_tools/root_maps/distdir_git_map.cpp index 94f923c1..f21994ba 100644 --- a/src/other_tools/root_maps/distdir_git_map.cpp +++ b/src/other_tools/root_maps/distdir_git_map.cpp @@ -134,7 +134,7 @@ auto CreateDistdirGitMap( gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map, std::optional<ServeApi> const& serve, gsl::not_null<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, std::size_t jobs) -> DistdirGitMap { auto distdir_to_git = [content_cas_map, import_to_git_map, diff --git a/src/other_tools/root_maps/distdir_git_map.hpp b/src/other_tools/root_maps/distdir_git_map.hpp index 1a350394..94ddbf9d 100644 --- a/src/other_tools/root_maps/distdir_git_map.hpp +++ b/src/other_tools/root_maps/distdir_git_map.hpp @@ -56,7 +56,7 @@ using DistdirGitMap = gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map, std::optional<ServeApi> const& serve, gsl::not_null<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, std::size_t jobs) -> DistdirGitMap; namespace std { diff --git a/src/other_tools/root_maps/fpath_git_map.cpp b/src/other_tools/root_maps/fpath_git_map.cpp index 43cb0c24..3f941bf5 100644 --- a/src/other_tools/root_maps/fpath_git_map.cpp +++ b/src/other_tools/root_maps/fpath_git_map.cpp @@ -33,14 +33,13 @@ namespace { /// \brief Does the serve endpoint checks and sets the workspace root. /// It guarantees the logger is called exactly once with fatal on failure, and /// the setter on success. -void CheckServeAndSetRoot( - std::string const& tree_id, - std::string const& repo_root, - bool absent, - std::optional<ServeApi> const& serve, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, - FilePathGitMap::SetterPtr const& ws_setter, - FilePathGitMap::LoggerPtr const& logger) { +void CheckServeAndSetRoot(std::string const& tree_id, + std::string const& repo_root, + bool absent, + std::optional<ServeApi> const& serve, + IExecutionApi::OptionalPtr const& remote_api, + FilePathGitMap::SetterPtr const& ws_setter, + FilePathGitMap::LoggerPtr const& logger) { // if serve endpoint is given, try to ensure it has this tree available to // be able to build against it. If root is not absent, do not fail if we // don't have a suitable remote endpoint, but warn user nonetheless. @@ -102,7 +101,7 @@ void ResolveFilePathTree( gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map, gsl::not_null<ResolveSymlinksMap*> const& resolve_symlinks_map, std::optional<ServeApi> const& serve, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, gsl::not_null<TaskSystem*> const& ts, FilePathGitMap::SetterPtr const& ws_setter, FilePathGitMap::LoggerPtr const& logger) { @@ -256,7 +255,7 @@ auto CreateFilePathGitMap( gsl::not_null<ImportToGitMap*> const& import_to_git_map, gsl::not_null<ResolveSymlinksMap*> const& resolve_symlinks_map, std::optional<ServeApi> const& serve, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, std::size_t jobs, std::string multi_repo_tool_name, std::string build_tool_name) -> FilePathGitMap { diff --git a/src/other_tools/root_maps/fpath_git_map.hpp b/src/other_tools/root_maps/fpath_git_map.hpp index a84ec947..f66413c0 100644 --- a/src/other_tools/root_maps/fpath_git_map.hpp +++ b/src/other_tools/root_maps/fpath_git_map.hpp @@ -55,7 +55,7 @@ using FilePathGitMap = AsyncMapConsumer<FpathInfo, nlohmann::json>; gsl::not_null<ImportToGitMap*> const& import_to_git_map, gsl::not_null<ResolveSymlinksMap*> const& resolve_symlinks_map, std::optional<ServeApi> const& serve, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, std::size_t jobs, std::string multi_repo_tool_name, std::string build_tool_name) -> FilePathGitMap; diff --git a/src/other_tools/root_maps/root_utils.cpp b/src/other_tools/root_maps/root_utils.cpp index efc4b6e0..1b9de917 100644 --- a/src/other_tools/root_maps/root_utils.cpp +++ b/src/other_tools/root_maps/root_utils.cpp @@ -35,13 +35,12 @@ auto CheckServeHasAbsentRoot(ServeApi const& serve, return std::nullopt; } -auto EnsureAbsentRootOnServe( - ServeApi const& serve, - std::string const& tree_id, - std::filesystem::path const& repo_path, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, - AsyncMapConsumerLoggerPtr const& logger, - bool no_sync_is_fatal) -> bool { +auto EnsureAbsentRootOnServe(ServeApi const& serve, + std::string const& tree_id, + std::filesystem::path const& repo_path, + IExecutionApi::OptionalPtr const& remote_api, + AsyncMapConsumerLoggerPtr const& logger, + bool no_sync_is_fatal) -> bool { if (remote_api) { // upload tree to remote CAS auto repo = RepositoryConfig{}; diff --git a/src/other_tools/root_maps/root_utils.hpp b/src/other_tools/root_maps/root_utils.hpp index 7e47dc81..d444176c 100644 --- a/src/other_tools/root_maps/root_utils.hpp +++ b/src/other_tools/root_maps/root_utils.hpp @@ -58,7 +58,7 @@ ServeApi const& serve, std::string const& tree_id, std::filesystem::path const& repo_path, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, AsyncMapConsumerLoggerPtr const& logger, bool no_sync_is_fatal) -> bool; diff --git a/src/other_tools/root_maps/tree_id_git_map.cpp b/src/other_tools/root_maps/tree_id_git_map.cpp index 5366ee86..690f756e 100644 --- a/src/other_tools/root_maps/tree_id_git_map.cpp +++ b/src/other_tools/root_maps/tree_id_git_map.cpp @@ -150,7 +150,7 @@ auto CreateTreeIdGitMap( bool fetch_absent, std::optional<ServeApi> const& serve, gsl::not_null<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, std::size_t jobs) -> TreeIdGitMap { auto tree_to_git = [git_tree_fetch_map, critical_git_op_map, diff --git a/src/other_tools/root_maps/tree_id_git_map.hpp b/src/other_tools/root_maps/tree_id_git_map.hpp index d9b7c1e4..d2a1c776 100644 --- a/src/other_tools/root_maps/tree_id_git_map.hpp +++ b/src/other_tools/root_maps/tree_id_git_map.hpp @@ -71,7 +71,7 @@ using TreeIdGitMap = bool fetch_absent, std::optional<ServeApi> const& serve, gsl::not_null<IExecutionApi const*> const& local_api, - std::optional<gsl::not_null<IExecutionApi const*>> const& remote_api, + IExecutionApi::OptionalPtr const& remote_api, std::size_t jobs) -> TreeIdGitMap; #endif // INCLUDED_SRC_OTHER_TOOLS_ROOT_MAPS_TREE_ID_GIT_MAP_HPP |