From 5b3ee91c84d37fe2cd7d4ddd9d26370447564161 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Thu, 20 Jun 2024 14:42:52 +0200 Subject: Mark IExecutionApi's methods constant --- .../execution_api/remote/bazel/bazel_api.cpp | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'src/buildtool/execution_api/remote/bazel/bazel_api.cpp') diff --git a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp index 96acd065..04cae278 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp @@ -51,7 +51,7 @@ namespace { [[nodiscard]] auto RetrieveToCas( std::vector const& digests, - gsl::not_null const& api, + gsl::not_null const& api, std::shared_ptr const& network, std::unordered_map const& info_map) noexcept -> bool { @@ -98,8 +98,8 @@ namespace { [[nodiscard]] auto RetrieveToCasSplitted( Artifact::ObjectInfo const& artifact_info, - gsl::not_null const& this_api, - gsl::not_null const& other_api, + gsl::not_null const& this_api, + gsl::not_null const& other_api, std::shared_ptr const& network, std::unordered_map const& info_map) noexcept -> bool { @@ -206,7 +206,7 @@ auto BazelApi::CreateAction( std::vector const& output_files, std::vector const& output_dirs, std::map const& env_vars, - std::map const& properties) noexcept + std::map const& properties) const noexcept -> IExecutionAction::Ptr { return std::unique_ptr{new BazelAction{network_, root_digest, @@ -221,8 +221,8 @@ auto BazelApi::CreateAction( [[nodiscard]] auto BazelApi::RetrieveToPaths( std::vector const& artifacts_info, std::vector const& output_paths, - std::optional> const& alternative) noexcept - -> bool { + std::optional> const& alternative) + const noexcept -> bool { if (artifacts_info.size() != output_paths.size()) { Logger::Log(LogLevel::Warning, "different number of digests and output paths."); @@ -299,7 +299,7 @@ auto BazelApi::CreateAction( [[nodiscard]] auto BazelApi::RetrieveToFds( std::vector const& artifacts_info, std::vector const& fds, - bool raw_tree) noexcept -> bool { + bool raw_tree) const noexcept -> bool { auto dumper = StreamDumper{network_->CreateReader()}; return CommonRetrieveToFds( artifacts_info, @@ -315,7 +315,7 @@ auto BazelApi::CreateAction( // NOLINTNEXTLINE(misc-no-recursion) [[nodiscard]] auto BazelApi::RetrieveToCas( std::vector const& artifacts_info, - gsl::not_null const& api) noexcept -> bool { + gsl::not_null const& api) const noexcept -> bool { // Return immediately if target CAS is this CAS if (this == api) { @@ -363,7 +363,7 @@ auto BazelApi::CreateAction( std::vector const& artifacts_info, gsl::not_null const& api, std::size_t jobs, - bool use_blob_splitting) noexcept -> bool { + bool use_blob_splitting) const noexcept -> bool { // Return immediately if target CAS is this CAS if (this == api) { @@ -431,7 +431,7 @@ auto BazelApi::CreateAction( } [[nodiscard]] auto BazelApi::RetrieveToMemory( - Artifact::ObjectInfo const& artifact_info) noexcept + Artifact::ObjectInfo const& artifact_info) const noexcept -> std::optional { auto reader = network_->CreateReader(); if (auto blob = reader.ReadSingleBlob(artifact_info.digest)) { @@ -441,7 +441,8 @@ auto BazelApi::CreateAction( } [[nodiscard]] auto BazelApi::Upload(ArtifactBlobContainer&& blobs, - bool skip_find_missing) noexcept -> bool { + bool skip_find_missing) const noexcept + -> bool { auto bazel_blobs = ConvertToBazelBlobContainer(std::move(blobs)); return bazel_blobs ? network_->UploadBlobs(std::move(*bazel_blobs), skip_find_missing) @@ -449,8 +450,8 @@ auto BazelApi::CreateAction( } [[nodiscard]] auto BazelApi::UploadTree( - std::vector const& - artifacts) noexcept -> std::optional { + std::vector const& artifacts) + const noexcept -> std::optional { auto build_root = DirectoryTree::FromNamedArtifacts(artifacts); if (not build_root) { Logger::Log(LogLevel::Debug, -- cgit v1.2.3