From 4d0846a90e38697d32205cbd0f8024621fd0ba6b Mon Sep 17 00:00:00 2001 From: Alberto Sartori Date: Fri, 10 Feb 2023 11:59:11 +0100 Subject: just execute: bugfix: honor do_not_cache boolean --- src/buildtool/execution_api/execution_service/execution_server.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/buildtool/execution_api/execution_service/execution_server.cpp') 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 {}", -- cgit v1.2.3