diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-06-15 18:27:52 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-06-26 17:57:29 +0200 |
commit | c88df1f494e8f8ffc1cfbe21e926c3c614111133 (patch) | |
tree | f6132156735e6b088b3983595770a7c1de9d705b /src/buildtool/execution_api | |
parent | 1e8951d8cc1da1420c73dda2a3e913b13838de58 (diff) | |
download | justbuild-c88df1f494e8f8ffc1cfbe21e926c3c614111133.tar.gz |
Allow non-upwards symlinks with Bazel API
Diffstat (limited to 'src/buildtool/execution_api')
-rw-r--r-- | src/buildtool/execution_api/remote/bazel/bazel_response.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
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<ObjectType::File>(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<ObjectType::File>(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()) { |