diff options
Diffstat (limited to 'src/buildtool/execution_api/common')
-rw-r--r-- | src/buildtool/execution_api/common/common_api.cpp | 10 | ||||
-rw-r--r-- | src/buildtool/execution_api/common/common_api.hpp | 8 | ||||
-rw-r--r-- | src/buildtool/execution_api/common/execution_api.hpp | 22 |
3 files changed, 20 insertions, 20 deletions
diff --git a/src/buildtool/execution_api/common/common_api.cpp b/src/buildtool/execution_api/common/common_api.cpp index be7fa53c..ce124a67 100644 --- a/src/buildtool/execution_api/common/common_api.cpp +++ b/src/buildtool/execution_api/common/common_api.cpp @@ -82,9 +82,9 @@ auto CommonRetrieveToFds( } /// NOLINTNEXTLINE(misc-no-recursion) -auto CommonUploadBlobTree(BlobTreePtr const& blob_tree, - gsl::not_null<IExecutionApi*> const& api) noexcept - -> bool { +auto CommonUploadBlobTree( + BlobTreePtr const& blob_tree, + gsl::not_null<const IExecutionApi*> const& api) noexcept -> bool { // Create digest list from blobs for batch availability check. auto missing_blobs_info = GetMissingArtifactsInfo<BlobTreePtr>( api, blob_tree->begin(), blob_tree->end(), [](BlobTreePtr const& node) { @@ -127,7 +127,7 @@ auto CommonUploadBlobTree(BlobTreePtr const& blob_tree, } auto CommonUploadTreeCompatible( - gsl::not_null<IExecutionApi*> const& api, + gsl::not_null<const IExecutionApi*> const& api, DirectoryTreePtr const& build_root, BazelMsgFactory::LinkDigestResolveFunc const& resolve_links) noexcept -> std::optional<ArtifactDigest> { @@ -163,7 +163,7 @@ auto CommonUploadTreeCompatible( return ArtifactDigest{*digest}; } -auto CommonUploadTreeNative(gsl::not_null<IExecutionApi*> const& api, +auto CommonUploadTreeNative(gsl::not_null<const IExecutionApi*> const& api, DirectoryTreePtr const& build_root) noexcept -> std::optional<ArtifactDigest> { auto blob_tree = BlobTree::FromDirectoryTree(build_root); diff --git a/src/buildtool/execution_api/common/common_api.hpp b/src/buildtool/execution_api/common/common_api.hpp index f657fee5..e35be206 100644 --- a/src/buildtool/execution_api/common/common_api.hpp +++ b/src/buildtool/execution_api/common/common_api.hpp @@ -61,7 +61,7 @@ struct MissingArtifactsInfo { /// original given type, or nullopt in case of exceptions. template <typename T> [[nodiscard]] auto GetMissingArtifactsInfo( - gsl::not_null<IExecutionApi*> const& api, + gsl::not_null<const IExecutionApi*> const& api, typename std::vector<T>::const_iterator const& begin, typename std::vector<T>::const_iterator const& end, typename std::function<ArtifactDigest(T const&)> const& converter) noexcept @@ -85,18 +85,18 @@ template <typename T> /// \brief Upload missing blobs from a given BlobTree. [[nodiscard]] auto CommonUploadBlobTree( BlobTreePtr const& blob_tree, - gsl::not_null<IExecutionApi*> const& api) noexcept -> bool; + gsl::not_null<const IExecutionApi*> const& api) noexcept -> bool; /// \brief Runs the compatible branch of local/bazel UploadTree API. [[nodiscard]] auto CommonUploadTreeCompatible( - gsl::not_null<IExecutionApi*> const& api, + gsl::not_null<const IExecutionApi*> const& api, DirectoryTreePtr const& build_root, BazelMsgFactory::LinkDigestResolveFunc const& resolve_links) noexcept -> std::optional<ArtifactDigest>; /// \brief Runs the native branch of local/bazel UploadTree API. [[nodiscard]] auto CommonUploadTreeNative( - gsl::not_null<IExecutionApi*> const& api, + gsl::not_null<const IExecutionApi*> const& api, DirectoryTreePtr const& build_root) noexcept -> std::optional<ArtifactDigest>; diff --git a/src/buildtool/execution_api/common/execution_api.hpp b/src/buildtool/execution_api/common/execution_api.hpp index a4892258..1a8ee578 100644 --- a/src/buildtool/execution_api/common/execution_api.hpp +++ b/src/buildtool/execution_api/common/execution_api.hpp @@ -57,7 +57,7 @@ class IExecutionApi { std::vector<std::string> const& output_files, std::vector<std::string> const& output_dirs, std::map<std::string, std::string> const& env_vars, - std::map<std::string, std::string> const& properties) noexcept + std::map<std::string, std::string> const& properties) const noexcept -> IExecutionAction::Ptr = 0; /// \brief Retrieve artifacts from CAS and store to specified paths. @@ -71,7 +71,7 @@ class IExecutionApi { std::vector<Artifact::ObjectInfo> const& artifacts_info, std::vector<std::filesystem::path> const& output_paths, std::optional<gsl::not_null<IExecutionApi*>> const& alternative = - std::nullopt) noexcept -> bool = 0; + std::nullopt) const noexcept -> bool = 0; /// \brief Retrieve artifacts from CAS and write to file descriptors. /// Tree artifacts are not resolved and instead the tree object will be @@ -81,14 +81,14 @@ class IExecutionApi { [[nodiscard]] virtual auto RetrieveToFds( std::vector<Artifact::ObjectInfo> const& artifacts_info, std::vector<int> const& fds, - bool raw_tree) noexcept -> bool = 0; + bool raw_tree) const noexcept -> bool = 0; /// \brief Synchronization of artifacts between two CASes. Retrieves /// artifacts from one CAS and writes to another CAS. Tree artifacts are /// resolved and its containing file artifacts are recursively retrieved. [[nodiscard]] virtual auto RetrieveToCas( std::vector<Artifact::ObjectInfo> const& artifacts_info, - gsl::not_null<IExecutionApi*> const& api) noexcept -> bool = 0; + gsl::not_null<IExecutionApi*> const& api) const noexcept -> bool = 0; /// \brief A variant of RetrieveToCas that is allowed to internally use /// the specified number of threads to carry out the task in parallel. @@ -100,14 +100,14 @@ class IExecutionApi { std::vector<Artifact::ObjectInfo> const& artifacts_info, gsl::not_null<IExecutionApi*> const& api, std::size_t /* jobs */, - bool /* use_blob_splitting */) noexcept -> bool { + bool /* use_blob_splitting */) const noexcept -> bool { return RetrieveToCas(artifacts_info, api); } /// \brief Retrieve one artifact from CAS and make it available for /// furter in-memory processing [[nodiscard]] virtual auto RetrieveToMemory( - Artifact::ObjectInfo const& artifact_info) noexcept + Artifact::ObjectInfo const& artifact_info) const noexcept -> std::optional<std::string> = 0; /// \brief Upload blobs to CAS. Uploads only the blobs that are not yet @@ -115,13 +115,13 @@ class IExecutionApi { /// \param blobs Container of blobs to upload. /// \param skip_find_missing Skip finding missing blobs, just upload all. /// NOLINTNEXTLINE(google-default-arguments) - [[nodiscard]] virtual auto Upload(ArtifactBlobContainer&& blobs, - bool skip_find_missing = false) noexcept - -> bool = 0; + [[nodiscard]] virtual auto Upload( + ArtifactBlobContainer&& blobs, + bool skip_find_missing = false) const noexcept -> bool = 0; [[nodiscard]] virtual auto UploadTree( - std::vector<DependencyGraph::NamedArtifactNodePtr> const& - artifacts) noexcept -> std::optional<ArtifactDigest> = 0; + std::vector<DependencyGraph::NamedArtifactNodePtr> const& artifacts) + const noexcept -> std::optional<ArtifactDigest> = 0; [[nodiscard]] virtual auto IsAvailable( ArtifactDigest const& digest) const noexcept -> bool = 0; |