summaryrefslogtreecommitdiff
path: root/src/buildtool/serve_api/remote/target_client.cpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2025-01-17 12:51:04 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2025-01-22 10:34:26 +0100
commit70393c8717c7b3b192928e652e103f12ff89a483 (patch)
treec4f5435f43211c3ee1085fa9a82eb97cbad58de9 /src/buildtool/serve_api/remote/target_client.cpp
parent00e8ed202907cbbd73172230e3829f80f0b04e6c (diff)
downloadjustbuild-70393c8717c7b3b192928e652e103f12ff89a483.tar.gz
serve client: support keep_artifact_root
Diffstat (limited to 'src/buildtool/serve_api/remote/target_client.cpp')
-rw-r--r--src/buildtool/serve_api/remote/target_client.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/buildtool/serve_api/remote/target_client.cpp b/src/buildtool/serve_api/remote/target_client.cpp
index d083b8fc..2490887c 100644
--- a/src/buildtool/serve_api/remote/target_client.cpp
+++ b/src/buildtool/serve_api/remote/target_client.cpp
@@ -65,7 +65,8 @@ TargetClient::TargetClient(
}
auto TargetClient::ServeTarget(const TargetCacheKey& key,
- const ArtifactDigest& repo_key) const noexcept
+ const ArtifactDigest& repo_key,
+ bool keep_artifact_root) const noexcept
-> std::optional<serve_target_result_t> {
// make sure the blob containing the key is in the remote cas
if (not apis_.local->RetrieveToCas({key.Id()}, *apis_.remote)) {
@@ -90,6 +91,8 @@ auto TargetClient::ServeTarget(const TargetCacheKey& key,
*request.mutable_target_cache_key_id() =
ArtifactDigestFactory::ToBazel(key.Id().digest);
+ request.set_keep_artifact_root(keep_artifact_root);
+
// add execution properties to request
for (auto const& [k, v] : exec_config_.platform_properties) {
auto* prop = request.add_execution_properties();