diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2022-07-18 09:53:46 +0200 |
---|---|---|
committer | Sascha Roloff <sascha.roloff@huawei.com> | 2022-08-05 14:41:31 +0200 |
commit | a23aa232645364b2403f380c9e2bb50edf617cb0 (patch) | |
tree | 7b917f4fc085236b3f6fdc90a7737fd02b6bfca6 /src/buildtool/execution_api | |
parent | c0422f390f9f30b7cc470a814e209bedc7e87f1a (diff) | |
download | justbuild-a23aa232645364b2403f380c9e2bb50edf617cb0.tar.gz |
CLI: Add flag for dumping raw tree objects
Diffstat (limited to 'src/buildtool/execution_api')
4 files changed, 12 insertions, 6 deletions
diff --git a/src/buildtool/execution_api/common/execution_api.hpp b/src/buildtool/execution_api/common/execution_api.hpp index 816b5031..661ecbf3 100644 --- a/src/buildtool/execution_api/common/execution_api.hpp +++ b/src/buildtool/execution_api/common/execution_api.hpp @@ -52,11 +52,14 @@ class IExecutionApi { -> bool = 0; /// \brief Retrieve artifacts from CAS and write to file descriptors. - /// Tree artifacts are not resolved and instead the raw protobuf message - /// will be written to fd. + /// Tree artifacts are not resolved and instead the tree object will be + /// pretty-printed before writing to fd. If `raw_tree` is set, pretty + /// printing will be omitted and the raw tree object will be written + /// instead. [[nodiscard]] virtual auto RetrieveToFds( std::vector<Artifact::ObjectInfo> const& artifacts_info, - std::vector<int> const& fds) noexcept -> bool = 0; + std::vector<int> const& fds, + bool raw_tree) noexcept -> bool = 0; /// \brief Upload blobs to CAS. Uploads only the blobs that are not yet /// available in CAS, unless `skip_find_missing` is specified. diff --git a/src/buildtool/execution_api/local/local_api.hpp b/src/buildtool/execution_api/local/local_api.hpp index 72b7e28c..c1cb1c57 100644 --- a/src/buildtool/execution_api/local/local_api.hpp +++ b/src/buildtool/execution_api/local/local_api.hpp @@ -74,7 +74,8 @@ class LocalApi final : public IExecutionApi { [[nodiscard]] auto RetrieveToFds( std::vector<Artifact::ObjectInfo> const& artifacts_info, - std::vector<int> const& fds) noexcept -> bool final { + std::vector<int> const& fds, + bool /*raw_tree*/) noexcept -> bool final { if (artifacts_info.size() != fds.size()) { Logger::Log(LogLevel::Error, "different number of digests and file descriptors."); diff --git a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp index 51e85176..c2893917 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp @@ -115,7 +115,8 @@ auto BazelApi::CreateAction( [[nodiscard]] auto BazelApi::RetrieveToFds( std::vector<Artifact::ObjectInfo> const& artifacts_info, - std::vector<int> const& fds) noexcept -> bool { + std::vector<int> const& fds, + bool /*raw_tree*/) noexcept -> bool { if (artifacts_info.size() != fds.size()) { Logger::Log(LogLevel::Error, "different number of digests and file descriptors."); diff --git a/src/buildtool/execution_api/remote/bazel/bazel_api.hpp b/src/buildtool/execution_api/remote/bazel/bazel_api.hpp index f953618e..d9619d82 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_api.hpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_api.hpp @@ -45,7 +45,8 @@ class BazelApi final : public IExecutionApi { [[nodiscard]] auto RetrieveToFds( std::vector<Artifact::ObjectInfo> const& artifacts_info, - std::vector<int> const& fds) noexcept -> bool final; + std::vector<int> const& fds, + bool raw_tree) noexcept -> bool final; [[nodiscard]] auto Upload(BlobContainer const& blobs, bool skip_find_missing) noexcept -> bool final; |