summaryrefslogtreecommitdiff
path: root/src/other_tools/just_mr/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/other_tools/just_mr/main.cpp')
-rw-r--r--src/other_tools/just_mr/main.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/other_tools/just_mr/main.cpp b/src/other_tools/just_mr/main.cpp
index f104e730..698a6ccb 100644
--- a/src/other_tools/just_mr/main.cpp
+++ b/src/other_tools/just_mr/main.cpp
@@ -28,6 +28,7 @@
#include "src/buildtool/build_engine/expression/configuration.hpp"
#include "src/buildtool/common/retry_cli.hpp"
#include "src/buildtool/compatibility/compatibility.hpp"
+#include "src/buildtool/crypto/hash_function.hpp"
#include "src/buildtool/file_system/git_context.hpp"
#include "src/buildtool/logging/log_config.hpp"
#include "src/buildtool/logging/log_level.hpp"
@@ -206,13 +207,16 @@ void SetupLogging(MultiRepoLogArguments const& clargs) {
}
}
-[[nodiscard]] auto CreateStorageConfig(
- MultiRepoCommonArguments const& args) noexcept
+[[nodiscard]] auto CreateStorageConfig(MultiRepoCommonArguments const& args,
+ bool is_compatible) noexcept
-> std::optional<StorageConfig> {
StorageConfig::Builder builder;
if (args.just_mr_paths->root.has_value()) {
builder.SetBuildRoot(*args.just_mr_paths->root);
}
+ builder.SetHashType(is_compatible ? HashFunction::JustHash::Compatible
+ : HashFunction::JustHash::Native);
+
// As just-mr does not require the TargetCache, we do not need to set any of
// the remote execution fields for the backend description.
auto config = builder.Build();
@@ -314,7 +318,8 @@ auto main(int argc, char* argv[]) -> int {
// Setup LocalStorageConfig to store the local_build_root properly
// and make the cas and git cache roots available
- auto storage_config = CreateStorageConfig(arguments.common);
+ auto storage_config = CreateStorageConfig(
+ arguments.common, Compatibility::IsCompatible());
if (not storage_config) {
Logger::Log(LogLevel::Error,
"Failed to configure local build root.");