summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/local/local_action.cpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2023-08-24 11:43:05 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2023-08-24 12:29:21 +0200
commit7a503a1c875e4c9ac4b014036da77983af5272bc (patch)
tree32ae2f851ce87243b0c98781eb0591177168bb3d /src/buildtool/execution_api/local/local_action.cpp
parentff62463cc2ead9c153305fbb7bbce3d18c90ddf9 (diff)
downloadjustbuild-7a503a1c875e4c9ac4b014036da77983af5272bc.tar.gz
Execution: only take complete actions from cache
... which are only actions that, besides giving exit code 0 also created all the outputs they promised to.
Diffstat (limited to 'src/buildtool/execution_api/local/local_action.cpp')
-rw-r--r--src/buildtool/execution_api/local/local_action.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/buildtool/execution_api/local/local_action.cpp b/src/buildtool/execution_api/local/local_action.cpp
index 3fcd8fe7..badc62e5 100644
--- a/src/buildtool/execution_api/local/local_action.cpp
+++ b/src/buildtool/execution_api/local/local_action.cpp
@@ -22,6 +22,7 @@
#include "src/buildtool/compatibility/native_support.hpp"
#include "src/buildtool/execution_api/local/config.hpp"
#include "src/buildtool/execution_api/local/local_response.hpp"
+#include "src/buildtool/execution_api/utils/outputscheck.hpp"
#include "src/buildtool/file_system/file_system_manager.hpp"
#include "src/buildtool/file_system/object_type.hpp"
#include "src/buildtool/storage/config.hpp"
@@ -89,7 +90,9 @@ auto LocalAction::Execute(Logger const* logger) noexcept
if (do_cache) {
if (auto result = storage_->ActionCache().CachedResult(action)) {
- if (result->exit_code() == 0) {
+ if (result->exit_code() == 0 and
+ ActionResultContainsExpectedOutputs(
+ *result, output_files_, output_dirs_)) {
return IExecutionResponse::Ptr{
new LocalResponse{action.hash(),
{std::move(*result), /*is_cached=*/true},