diff options
author | Alberto Sartori <alberto.sartori@huawei.com> | 2023-02-10 11:59:11 +0100 |
---|---|---|
committer | Alberto Sartori <alberto.sartori@huawei.com> | 2023-02-10 14:37:17 +0100 |
commit | 4d0846a90e38697d32205cbd0f8024621fd0ba6b (patch) | |
tree | f412b00ea81fd90ccb33f5464d59f5fe2fa92015 /src/buildtool/execution_api/execution_service/execution_server.cpp | |
parent | 8564721ed7136763fd1c2319dbae9134cfa8e30e (diff) | |
download | justbuild-4d0846a90e38697d32205cbd0f8024621fd0ba6b.tar.gz |
just execute: bugfix: honor do_not_cache boolean
Diffstat (limited to 'src/buildtool/execution_api/execution_service/execution_server.cpp')
-rw-r--r-- | src/buildtool/execution_api/execution_service/execution_server.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/buildtool/execution_api/execution_service/execution_server.cpp b/src/buildtool/execution_api/execution_service/execution_server.cpp index 774128a2..3e86ca5d 100644 --- a/src/buildtool/execution_api/execution_service/execution_server.cpp +++ b/src/buildtool/execution_api/execution_service/execution_server.cpp @@ -89,6 +89,10 @@ auto ExecutionServiceImpl::Execute( {c.output_directories().begin(), c.output_directories().end()}, env_vars, {}); + action->SetCacheFlag(a.do_not_cache() + ? IExecutionAction::CacheFlag::DoNotCacheOutput + : IExecutionAction::CacheFlag::CacheOutput); + logger_.Emit(LogLevel::Info, "Execute {}", request->action_digest().hash()); auto tmp = action->Execute(&logger_); ::build::bazel::remote::execution::v2::ExecuteResponse response{}; @@ -129,7 +133,7 @@ auto ExecutionServiceImpl::Execute( op.mutable_response()->PackFrom(response); writer->Write(op); - if (tmp->ExitCode() == 0 && + if (tmp->ExitCode() == 0 && !a.do_not_cache() && !storage_.StoreActionResult(request->action_digest(), response.result())) { auto str = fmt::format("Could not store action result for action {}", |