summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/local/local_action.hpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-08-01 10:26:13 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-08-01 19:00:47 +0200
commit03f948f4b10e916052a2234448b6658b80ee9143 (patch)
tree8eb0e2c26a31fd83fa0691b0d8fde55a15942a9d /src/buildtool/execution_api/local/local_action.hpp
parented71beee3e3a2bbfcba24281ad9e28a0f6df4054 (diff)
downloadjustbuild-03f948f4b10e916052a2234448b6658b80ee9143.tar.gz
Execution API: support cwd
... following the remote-execution standard that all output paths (but none of the input paths) are relative to the working directory. Therefore, the executor has to do the path translation. For our implementation of the API interface - the local API now handles cwd correctly, - the remote API forwards cwd correctly, and - the git API continues to report actions as not implemented.
Diffstat (limited to 'src/buildtool/execution_api/local/local_action.hpp')
-rw-r--r--src/buildtool/execution_api/local/local_action.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/buildtool/execution_api/local/local_action.hpp b/src/buildtool/execution_api/local/local_action.hpp
index b2016ed7..4d256302 100644
--- a/src/buildtool/execution_api/local/local_action.hpp
+++ b/src/buildtool/execution_api/local/local_action.hpp
@@ -65,6 +65,7 @@ class LocalAction final : public IExecutionAction {
LocalContext const& local_context_;
ArtifactDigest const root_digest_{};
std::vector<std::string> const cmdline_{};
+ std::string const cwd_{};
std::vector<std::string> output_files_{};
std::vector<std::string> output_dirs_{};
std::map<std::string, std::string> const env_vars_{};
@@ -76,6 +77,7 @@ class LocalAction final : public IExecutionAction {
gsl::not_null<LocalContext const*> local_context,
ArtifactDigest root_digest,
std::vector<std::string> command,
+ std::string cwd,
std::vector<std::string> output_files,
std::vector<std::string> output_dirs,
std::map<std::string, std::string> env_vars,
@@ -83,6 +85,7 @@ class LocalAction final : public IExecutionAction {
: local_context_{*local_context},
root_digest_{std::move(root_digest)},
cmdline_{std::move(command)},
+ cwd_{std::move(cwd)},
output_files_{std::move(output_files)},
output_dirs_{std::move(output_dirs)},
env_vars_{std::move(env_vars)},
@@ -100,6 +103,7 @@ class LocalAction final : public IExecutionAction {
BazelMsgFactory::ActionDigestRequest request{
.command_line = &cmdline_,
+ .cwd = &cwd_,
.output_files = &output_files_,
.output_dirs = &output_dirs_,
.env_vars = &env_vars,