diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-22 16:44:49 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-23 10:24:39 +0200 |
commit | ec5e4b0290edff5d9589898493cd7d08f3fb5cd3 (patch) | |
tree | 23179bc88ee1fa5c6289e33869d88900d0be284a /src/other_tools/root_maps/content_git_map.cpp | |
parent | 9c9175b8658cade244272464ede3c21be34df172 (diff) | |
download | justbuild-ec5e4b0290edff5d9589898493cd7d08f3fb5cd3.tar.gz |
just-mr: Use progress instance in setup maps
...instead of using the singleton.
Diffstat (limited to 'src/other_tools/root_maps/content_git_map.cpp')
-rw-r--r-- | src/other_tools/root_maps/content_git_map.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/other_tools/root_maps/content_git_map.cpp b/src/other_tools/root_maps/content_git_map.cpp index e3f4c76d..652f4a25 100644 --- a/src/other_tools/root_maps/content_git_map.cpp +++ b/src/other_tools/root_maps/content_git_map.cpp @@ -21,8 +21,6 @@ #include "src/buildtool/multithreading/async_map_utils.hpp" #include "src/buildtool/multithreading/task_system.hpp" #include "src/buildtool/storage/fs_utils.hpp" -#include "src/other_tools/just_mr/progress_reporting/progress.hpp" -#include "src/other_tools/just_mr/progress_reporting/statistics.hpp" #include "src/other_tools/root_maps/root_utils.hpp" #include "src/other_tools/utils/content.hpp" #include "src/utils/archive/archive_ops.hpp" @@ -911,6 +909,7 @@ auto CreateContentGitMap( gsl::not_null<Storage const*> const& storage, IExecutionApi const* remote_api, bool fetch_absent, + gsl::not_null<JustMRProgress*> const& progress, std::size_t jobs) -> ContentGitMap { auto gitify_content = [content_cas_map, import_to_git_map, @@ -923,11 +922,12 @@ auto CreateContentGitMap( storage, storage_config, remote_api, - fetch_absent](auto ts, - auto setter, - auto logger, - auto /* unused */, - auto const& key) { + fetch_absent, + progress](auto ts, + auto setter, + auto logger, + auto /* unused */, + auto const& key) { auto archive_tree_id_file = StorageUtils::GetArchiveTreeIDFile( *storage_config, key.repo_type, key.archive.content); if (FileSystemManager::Exists(archive_tree_id_file)) { @@ -972,8 +972,7 @@ auto CreateContentGitMap( /*sync_tree = */ false); if (serve_result) { // set the workspace root as absent - JustMRProgress::Instance().TaskTracker().Stop( - key.archive.origin); + progress->TaskTracker().Stop(key.archive.origin); (*setter)(std::pair( nlohmann::json::array( {FileRoot::kGitTreeMarker, *serve_result}), @@ -1045,6 +1044,7 @@ auto CreateContentGitMap( storage, storage_config, remote_api, + progress, ts, setter, logger](auto const& values) { @@ -1118,8 +1118,7 @@ auto CreateContentGitMap( /*fatal=*/true); return; } - JustMRProgress::Instance().TaskTracker().Start( - key.archive.origin); + progress->TaskTracker().Start(key.archive.origin); // add distfile to CAS auto repo_distfile = (key.archive.distfile @@ -1132,8 +1131,7 @@ auto CreateContentGitMap( // check if content is in CAS now if (auto content_cas_path = cas.BlobPath(digest, /*is_executable=*/false)) { - JustMRProgress::Instance().TaskTracker().Stop( - key.archive.origin); + progress->TaskTracker().Stop(key.archive.origin); ExtractAndImportToGit(key, *content_cas_path, archive_tree_id_file, |