diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2025-06-23 14:56:04 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2025-06-24 14:56:58 +0200 |
commit | bbcc5977f49646941ac35060bb74a27eda5fbd76 (patch) | |
tree | 4e11ded4722ea740fbeea12510efd34fe698c04b /src/buildtool/execution_api/local/local_api.cpp | |
parent | c498bf564fa5d781c176f65c7a9a2d43376a81f1 (diff) | |
download | justbuild-bbcc5977f49646941ac35060bb74a27eda5fbd76.tar.gz |
ExecutionAPI: Support output_paths in requests
... and prepare local execution for clients
using only RBEv2.1 (setting only output_paths).
Diffstat (limited to 'src/buildtool/execution_api/local/local_api.cpp')
-rw-r--r-- | src/buildtool/execution_api/local/local_api.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/buildtool/execution_api/local/local_api.cpp b/src/buildtool/execution_api/local/local_api.cpp index 3eede672..c0a3a30e 100644 --- a/src/buildtool/execution_api/local/local_api.cpp +++ b/src/buildtool/execution_api/local/local_api.cpp @@ -59,6 +59,7 @@ LocalApi::LocalApi(gsl::not_null<LocalContext const*> const& local_context, : local_context_{*local_context}, git_api_{CreateFallbackApi(*local_context->storage, repo_config)} {} +// NOLINTNEXTLINE(google-default-arguments) auto LocalApi::CreateAction( ArtifactDigest const& root_digest, std::vector<std::string> const& command, @@ -66,8 +67,13 @@ auto LocalApi::CreateAction( std::vector<std::string> const& output_files, std::vector<std::string> const& output_dirs, std::map<std::string, std::string> const& env_vars, - std::map<std::string, std::string> const& properties) const noexcept - -> IExecutionAction::Ptr { + std::map<std::string, std::string> const& properties, + bool force_legacy) const noexcept -> IExecutionAction::Ptr { + if (ProtocolTraits::IsNative(GetHashType())) { + // fall back to legacy for native + force_legacy = true; + } + bool best_effort = not force_legacy; return IExecutionAction::Ptr{new (std::nothrow) LocalAction{&local_context_, root_digest, command, @@ -75,6 +81,24 @@ auto LocalApi::CreateAction( output_files, output_dirs, env_vars, + properties, + best_effort}}; +} + +auto LocalApi::CreateAction( + ArtifactDigest const& root_digest, + std::vector<std::string> const& command, + std::string const& cwd, + std::vector<std::string> const& output_paths, + std::map<std::string, std::string> const& env_vars, + std::map<std::string, std::string> const& properties) const noexcept + -> IExecutionAction::Ptr { + return IExecutionAction::Ptr{new (std::nothrow) LocalAction{&local_context_, + root_digest, + command, + cwd, + output_paths, + env_vars, properties}}; } |