diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-12 15:57:30 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-13 14:41:00 +0200 |
commit | 46c4205a5fe8fa598c49c1f217d399157930f2f4 (patch) | |
tree | 5f3623851730572c55d7b7f3193e15a153d5beee /src/buildtool/common/cli.hpp | |
parent | a551a69765db23d9a60d58a763af700cf9fae4ed (diff) | |
download | justbuild-46c4205a5fe8fa598c49c1f217d399157930f2f4.tar.gz |
Remove Compatibility flag from just
Diffstat (limited to 'src/buildtool/common/cli.hpp')
-rw-r--r-- | src/buildtool/common/cli.hpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/buildtool/common/cli.hpp b/src/buildtool/common/cli.hpp index c388879e..520b8ff3 100644 --- a/src/buildtool/common/cli.hpp +++ b/src/buildtool/common/cli.hpp @@ -32,8 +32,8 @@ #include "nlohmann/json.hpp" #include "src/buildtool/build_engine/expression/evaluator.hpp" #include "src/buildtool/common/clidefaults.hpp" -#include "src/buildtool/common/protocol_traits.hpp" #include "src/buildtool/common/retry_cli.hpp" +#include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/main/build_utils.hpp" #include "src/utils/cpp/path.hpp" @@ -192,6 +192,10 @@ struct ToAddArguments { bool follow_symlinks{}; }; +struct ProtocolArguments final { + HashFunction::Type hash_type = HashFunction::Type::GitSHA1; +}; + static inline auto SetupCommonArguments( gsl::not_null<CLI::App*> const& app, gsl::not_null<CommonArguments*> const& clargs) { @@ -682,11 +686,14 @@ static inline auto SetupGraphArguments( "missing KNOWN artifacts."); } -static inline auto SetupCompatibilityArguments( - gsl::not_null<CLI::App*> const& app) { +static inline auto SetupProtocolArguments( + gsl::not_null<CLI::App*> const& app, + gsl::not_null<ProtocolArguments*> const& protocol) { app->add_flag_function( "--compatible", - [](auto /*unused*/) { ProtocolTraits::Instance().SetCompatible(); }, + [protocol](auto /*unused*/) { + protocol->hash_type = HashFunction::Type::PlainSHA256; + }, "At increased computational effort, be compatible with the original " "remote build execution protocol. As the change affects identifiers, " "the flag must be used consistently for all related invocations."); |