From 1394c3d9016373ef727feac9d1aed514e1f89f53 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Wed, 21 Feb 2024 12:08:34 +0100 Subject: just-mr: Correct handling of remotes with respect to compatibility mode In order to set up roots, just-mr is able to interrogate, if given, serve and/or remote-execution endpoints. However, just-mr operates only with Git hashes, i.e., with a native mode CAS. This commit ensures the correct interactions occur between just-mr and the provided endpoints not only in native mode, but also in comaptible mode, where a serve endpoint might be present even if one cannot make use of its associated remote-exection endpoint. The user always gets informed if any incompatibilities are detected. --- src/other_tools/root_maps/commit_git_map.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/other_tools/root_maps/commit_git_map.cpp') diff --git a/src/other_tools/root_maps/commit_git_map.cpp b/src/other_tools/root_maps/commit_git_map.cpp index 04f14023..d97f33be 100644 --- a/src/other_tools/root_maps/commit_git_map.cpp +++ b/src/other_tools/root_maps/commit_git_map.cpp @@ -108,6 +108,15 @@ void EnsureRootAsAbsent( /*fatal=*/true); return; } + if (not remote_api) { + (*logger)( + fmt::format("Missing or incompatible remote-execution " + "endpoint needed to sync workspace root {} " + "with the serve endpoint.", + tree_id), + /*fatal=*/true); + return; + } // the tree is known locally, so we can upload it to remote CAS // for the serve endpoint to retrieve it and set up the root if (not EnsureAbsentRootOnServe(tree_id, -- cgit v1.2.3