diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-28 12:02:14 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-05 13:32:39 +0200 |
commit | 849671f3d4ea482d208da4b5adf5c2c3556e25e4 (patch) | |
tree | c4464ebd7bd88a3785c6337c2788d6e8b449fa22 /src/other_tools/ops_maps/archive_fetch_map.cpp | |
parent | 3c7f2481918289e8d47922df1c87a7ae77357749 (diff) | |
download | justbuild-849671f3d4ea482d208da4b5adf5c2c3556e25e4.tar.gz |
Pass StorageConfig and Storage to just-mr maps
Diffstat (limited to 'src/other_tools/ops_maps/archive_fetch_map.cpp')
-rw-r--r-- | src/other_tools/ops_maps/archive_fetch_map.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/other_tools/ops_maps/archive_fetch_map.cpp b/src/other_tools/ops_maps/archive_fetch_map.cpp index e035b128..f04d43f4 100644 --- a/src/other_tools/ops_maps/archive_fetch_map.cpp +++ b/src/other_tools/ops_maps/archive_fetch_map.cpp @@ -19,7 +19,6 @@ #include "fmt/core.h" #include "src/buildtool/file_system/file_storage.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" -#include "src/buildtool/storage/storage.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/just_mr/utils.hpp" @@ -69,15 +68,19 @@ void ProcessContent(std::filesystem::path const& content_path, auto CreateArchiveFetchMap(gsl::not_null<ContentCASMap*> const& content_cas_map, std::filesystem::path const& fetch_dir, + gsl::not_null<Storage const*> const& storage, gsl::not_null<IExecutionApi const*> const& local_api, IExecutionApi const* remote_api, std::size_t jobs) -> ArchiveFetchMap { - auto fetch_archive = [content_cas_map, fetch_dir, local_api, remote_api]( - auto ts, - auto setter, - auto logger, - auto /* unused */, - auto const& key) { + auto fetch_archive = [content_cas_map, + fetch_dir, + storage, + local_api, + remote_api](auto ts, + auto setter, + auto logger, + auto /* unused */, + auto const& key) { // get corresponding distfile auto distfile = (key.distfile @@ -89,13 +92,14 @@ auto CreateArchiveFetchMap(gsl::not_null<ContentCASMap*> const& content_cas_map, ts, {key}, [target_name, + storage, local_api, remote_api, content = key.content, setter, logger]([[maybe_unused]] auto const& values) { // content is in local CAS now - auto const& cas = Storage::Instance().CAS(); + auto const& cas = storage->CAS(); auto content_path = cas.BlobPath(ArtifactDigest{content, 0, /*is_tree=*/false}, /*is_executable=*/false) |