diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/other_tools/just_mr/setup.cpp | 21 | ||||
-rw-r--r-- | src/other_tools/root_maps/distdir_git_map.cpp | 43 | ||||
-rw-r--r-- | src/other_tools/root_maps/distdir_git_map.hpp | 1 |
3 files changed, 28 insertions, 37 deletions
diff --git a/src/other_tools/just_mr/setup.cpp b/src/other_tools/just_mr/setup.cpp index 0f2b928a..07f74620 100644 --- a/src/other_tools/just_mr/setup.cpp +++ b/src/other_tools/just_mr/setup.cpp @@ -386,17 +386,16 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config, common_args.just_path ? common_args.just_path->string() : kDefaultJustPath); - auto distdir_git_map = CreateDistdirGitMap( - &content_cas_map, - &import_to_git_map, - &critical_git_op_map, - serve ? &*serve : nullptr, - &native_storage_config, - compat_storage_config != nullptr ? &*compat_storage_config : nullptr, - &native_storage, - &(*apis.local), - has_remote_api ? &*apis.remote : nullptr, - common_args.jobs); + auto distdir_git_map = + CreateDistdirGitMap(&content_cas_map, + &import_to_git_map, + &critical_git_op_map, + serve ? &*serve : nullptr, + &native_storage_config, + &native_storage, + &(*apis.local), + has_remote_api ? &*apis.remote : nullptr, + common_args.jobs); auto tree_id_git_map = CreateTreeIdGitMap( &git_tree_fetch_map, diff --git a/src/other_tools/root_maps/distdir_git_map.cpp b/src/other_tools/root_maps/distdir_git_map.cpp index 49329908..213b4f94 100644 --- a/src/other_tools/root_maps/distdir_git_map.cpp +++ b/src/other_tools/root_maps/distdir_git_map.cpp @@ -147,7 +147,6 @@ auto CreateDistdirGitMap( gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map, ServeApi const* serve, gsl::not_null<StorageConfig const*> const& native_storage_config, - StorageConfig const* compat_storage_config, gsl::not_null<Storage const*> const& native_storage, gsl::not_null<IExecutionApi const*> const& local_api, IExecutionApi const* remote_api, @@ -157,7 +156,6 @@ auto CreateDistdirGitMap( critical_git_op_map, serve, native_storage_config, - compat_storage_config, native_storage, local_api, remote_api](auto ts, @@ -197,9 +195,6 @@ auto CreateDistdirGitMap( key, serve, native_storage_config, - compat_storage_config, - local_api, - remote_api, setter, logger](auto const& values) { GitOpValue op_result = *values[0]; @@ -255,31 +250,29 @@ auto CreateDistdirGitMap( /*fatal=*/true); return; } - if (remote_api == nullptr) { - (*logger)( - fmt::format( - "Missing or incompatible " - "remote-execution endpoint " - "needed to sync workspace root " - "{} with the serve endpoint.", - distdir_tree_id), - /*fatal=*/true); + + auto digest = ArtifactDigestFactory::Create( + HashFunction::Type::GitSHA1, + distdir_tree_id, + /*size_unknown=*/0, + /*is_tree=*/true); + if (not digest.has_value()) { + (*logger)(std::move(digest).error(), + /*fatal=*/true); return; } + // the tree is known locally, so we upload // it to remote CAS for the serve endpoint // to retrieve it and set up the root - if (not EnsureAbsentRootOnServe( - *serve, - distdir_tree_id, - native_storage_config - ->GitRoot(), /*repo_root*/ - native_storage_config, - compat_storage_config, - &*local_api, - remote_api, - logger, - true /*no_sync_is_fatal*/)) { + auto uploaded = serve->UploadTree( + *digest, + native_storage_config->GitRoot()); + if (not uploaded.has_value()) { + (*logger)(std::move(uploaded) + .error() + .Message(), + /*fatal=*/true); return; } } diff --git a/src/other_tools/root_maps/distdir_git_map.hpp b/src/other_tools/root_maps/distdir_git_map.hpp index 7bd82ca0..98c466c6 100644 --- a/src/other_tools/root_maps/distdir_git_map.hpp +++ b/src/other_tools/root_maps/distdir_git_map.hpp @@ -62,7 +62,6 @@ using DistdirGitMap = gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map, ServeApi const* serve, gsl::not_null<StorageConfig const*> const& native_storage_config, - StorageConfig const* compat_storage_config, gsl::not_null<Storage const*> const& native_storage, gsl::not_null<IExecutionApi const*> const& local_api, IExecutionApi const* remote_api, |