From c88df1f494e8f8ffc1cfbe21e926c3c614111133 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Thu, 15 Jun 2023 18:27:52 +0200 Subject: Allow non-upwards symlinks with Bazel API --- .../execution_api/remote/bazel/bazel_response.cpp | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/buildtool/execution_api/remote/bazel/bazel_response.cpp') diff --git a/src/buildtool/execution_api/remote/bazel/bazel_response.cpp b/src/buildtool/execution_api/remote/bazel/bazel_response.cpp index 05ff0c9a..5e4da3d6 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_response.cpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_response.cpp @@ -113,6 +113,32 @@ auto BazelResponse::Populate() noexcept -> bool { } } + // collect all symlinks and store them + for (auto const& link : action_result.output_file_symlinks()) { + try { + artifacts.emplace( + link.path(), + Artifact::ObjectInfo{ + .digest = + ArtifactDigest::Create(link.target()), + .type = ObjectType::Symlink}); + } catch (...) { + return false; + } + } + for (auto const& link : action_result.output_directory_symlinks()) { + try { + artifacts.emplace( + link.path(), + Artifact::ObjectInfo{ + .digest = + ArtifactDigest::Create(link.target()), + .type = ObjectType::Symlink}); + } catch (...) { + return false; + } + } + if (not Compatibility::IsCompatible()) { // in native mode: just collect and store tree digests for (auto const& tree : action_result.output_directories()) { -- cgit v1.2.3