diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-02 17:55:35 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-09 13:07:13 +0200 |
commit | 56f91aac0c25e6e80dbaae087227502312accee6 (patch) | |
tree | 98996ba1159a492d2ec7e0a0d8116722215e36f1 /src/buildtool/execution_api/local/local_action.cpp | |
parent | e8d9f711ab3bc67c2ee64fae427b45b63dc47284 (diff) | |
download | justbuild-56f91aac0c25e6e80dbaae087227502312accee6.tar.gz |
Return ArtifactDigest from CreateActionDigestFromCommandLine
Diffstat (limited to 'src/buildtool/execution_api/local/local_action.cpp')
-rw-r--r-- | src/buildtool/execution_api/local/local_action.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/buildtool/execution_api/local/local_action.cpp b/src/buildtool/execution_api/local/local_action.cpp index 4a2dcfbc..2c79b32e 100644 --- a/src/buildtool/execution_api/local/local_action.cpp +++ b/src/buildtool/execution_api/local/local_action.cpp @@ -21,8 +21,6 @@ #include <system_error> #include <utility> -#include "src/buildtool/common/artifact_digest.hpp" -#include "src/buildtool/common/bazel_types.hpp" #include "src/buildtool/compatibility/native_support.hpp" #include "src/buildtool/execution_api/common/tree_reader.hpp" #include "src/buildtool/execution_api/local/local_cas_reader.hpp" @@ -85,7 +83,7 @@ auto LocalAction::Execute(Logger const* logger) noexcept -> IExecutionResponse::Ptr { auto do_cache = CacheEnabled(cache_flag_); - auto action = CreateActionDigest(root_digest_, not do_cache); + auto const action = CreateActionDigest(root_digest_, not do_cache); if (not action) { if (logger != nullptr) { logger->Emit(LogLevel::Error, @@ -101,13 +99,12 @@ auto LocalAction::Execute(Logger const* logger) noexcept " - exec_dir digest: {}\n" " - action digest: {}", root_digest_.hash(), - NativeSupport::Unprefix(action->hash())); + action->hash()); } if (do_cache) { - ArtifactDigest const a_digest{*action}; if (auto result = - local_context_.storage->ActionCache().CachedResult(a_digest)) { + local_context_.storage->ActionCache().CachedResult(*action)) { if (result->exit_code() == 0 and ActionResultContainsExpectedOutputs( *result, output_files_, output_dirs_)) { @@ -120,10 +117,11 @@ auto LocalAction::Execute(Logger const* logger) noexcept } if (ExecutionEnabled(cache_flag_)) { - if (auto output = Run(*action)) { + if (auto output = Run(static_cast<bazel_re::Digest>(*action))) { if (cache_flag_ == CacheFlag::PretendCached) { // ensure the same id is created as if caching were enabled - auto action_cached = CreateActionDigest(root_digest_, false); + auto const action_cached = + CreateActionDigest(root_digest_, false); if (not action_cached) { if (logger != nullptr) { logger->Emit( |