diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-11-29 15:38:05 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-11-30 14:50:41 +0100 |
commit | 4a8fcca9a387cdf9811ddaeadccd3239e48c427a (patch) | |
tree | 057de8bf439a919586dbbc9e55c716ebe614b063 /src/buildtool/execution_api/common/execution_api.hpp | |
parent | d51e7da74e902cbd5931b3429632be6feca29327 (diff) | |
download | justbuild-4a8fcca9a387cdf9811ddaeadccd3239e48c427a.tar.gz |
remote API: support uploading files from the file system
Allow implementations to have a specialized way of uploading a file
owned by the build process to the applicable cas, both as file, as
well as as tree object (in native mode).
If no implementation is provided, the default is to read the file
into memory and use the Upload method.
Diffstat (limited to 'src/buildtool/execution_api/common/execution_api.hpp')
-rw-r--r-- | src/buildtool/execution_api/common/execution_api.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/buildtool/execution_api/common/execution_api.hpp b/src/buildtool/execution_api/common/execution_api.hpp index 37abd5ea..d6ec49fb 100644 --- a/src/buildtool/execution_api/common/execution_api.hpp +++ b/src/buildtool/execution_api/common/execution_api.hpp @@ -15,6 +15,7 @@ #ifndef INCLUDED_SRC_BUILDTOOL_EXECUTION_API_COMMON_EXECUTION_APIHPP #define INCLUDED_SRC_BUILDTOOL_EXECUTION_API_COMMON_EXECUTION_APIHPP +#include <filesystem> #include <map> #include <memory> #include <optional> @@ -27,6 +28,7 @@ #include "src/buildtool/execution_api/bazel_msg/bazel_blob_container.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp" #include "src/buildtool/execution_api/common/execution_action.hpp" +#include "src/buildtool/file_system/object_type.hpp" /// \brief Abstract remote execution API /// Can be used to create actions. @@ -116,6 +118,12 @@ class IExecutionApi { bool skip_find_missing = false) noexcept -> bool = 0; + /// \brief Upload a file to CAS as an object of the specified type. + /// It may be assumed that the file is owned entirely by the build process. + [[nodiscard]] virtual auto UploadFile( + std::filesystem::path const& file_path, + ObjectType type) noexcept -> bool; + [[nodiscard]] virtual auto UploadTree( std::vector<DependencyGraph::NamedArtifactNodePtr> const& artifacts) noexcept -> std::optional<ArtifactDigest> = 0; |