diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-06-14 16:40:48 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-06-26 17:57:29 +0200 |
commit | 3865c8556bde5e614dc1e8c72f83fa1ed65abcd9 (patch) | |
tree | 7c4f118c07fe35a89deadbc9f4aa09b2f5f64e87 /src/buildtool/execution_api/local/local_api.hpp | |
parent | db961e1e9fba6e0c439f69ac8342ef887d9d19a6 (diff) | |
download | justbuild-3865c8556bde5e614dc1e8c72f83fa1ed65abcd9.tar.gz |
bazel_msg_factory: Allow non-upwards symlinks in uploaded trees
Diffstat (limited to 'src/buildtool/execution_api/local/local_api.hpp')
-rw-r--r-- | src/buildtool/execution_api/local/local_api.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/buildtool/execution_api/local/local_api.hpp b/src/buildtool/execution_api/local/local_api.hpp index 577d771b..87296414 100644 --- a/src/buildtool/execution_api/local/local_api.hpp +++ b/src/buildtool/execution_api/local/local_api.hpp @@ -309,8 +309,18 @@ class LocalApi final : public IExecutionApi { if (Compatibility::IsCompatible()) { BlobContainer blobs{}; + auto const& cas = storage_->CAS(); auto digest = BazelMsgFactory::CreateDirectoryDigestFromTree( *build_root, + [&cas](std::vector<bazel_re::Digest> const& digests, + std::vector<std::string>* targets) { + targets->reserve(digests.size()); + for (auto const& digest : digests) { + auto p = cas.BlobPath(digest, /*is_executable=*/false); + auto content = FileSystemManager::ReadFile(*p); + targets->emplace_back(*content); + } + }, [&blobs](BazelBlob&& blob) { blobs.Emplace(std::move(blob)); }); if (not digest) { Logger::Log(LogLevel::Debug, |