diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-20 14:42:52 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-25 13:59:48 +0200 |
commit | 5b3ee91c84d37fe2cd7d4ddd9d26370447564161 (patch) | |
tree | f702708f095ce8448a4dfb914269d494798a58c8 /src/buildtool/execution_api/local/local_api.hpp | |
parent | 702c9f4af93d66d97f01fcb496b3f699e3a83f6a (diff) | |
download | justbuild-5b3ee91c84d37fe2cd7d4ddd9d26370447564161.tar.gz |
Mark IExecutionApi's methods constant
Diffstat (limited to 'src/buildtool/execution_api/local/local_api.hpp')
-rw-r--r-- | src/buildtool/execution_api/local/local_api.hpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/buildtool/execution_api/local/local_api.hpp b/src/buildtool/execution_api/local/local_api.hpp index 035b14e9..fc64e842 100644 --- a/src/buildtool/execution_api/local/local_api.hpp +++ b/src/buildtool/execution_api/local/local_api.hpp @@ -57,13 +57,13 @@ class LocalApi final : public IExecutionApi { repo_config = std::nullopt) : repo_config_{std::move(repo_config)} {} - auto CreateAction( + [[nodiscard]] auto CreateAction( ArtifactDigest const& root_digest, std::vector<std::string> const& command, 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 final { return IExecutionAction::Ptr{new LocalAction{storage_, root_digest, @@ -79,7 +79,7 @@ class LocalApi final : public 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 final { + std::nullopt) const noexcept -> bool final { if (artifacts_info.size() != output_paths.size()) { Logger::Log(LogLevel::Error, "different number of digests and output paths."); @@ -143,7 +143,7 @@ class LocalApi final : public IExecutionApi { [[nodiscard]] auto RetrieveToFds( std::vector<Artifact::ObjectInfo> const& artifacts_info, std::vector<int> const& fds, - bool raw_tree) noexcept -> bool final { + bool raw_tree) const noexcept -> bool final { auto dumper = StreamDumper<LocalCasReader>{storage_->CAS()}; return CommonRetrieveToFds( artifacts_info, @@ -171,7 +171,7 @@ class LocalApi final : public IExecutionApi { // NOLINTNEXTLINE(misc-no-recursion) [[nodiscard]] auto RetrieveToCas( std::vector<Artifact::ObjectInfo> const& artifacts_info, - gsl::not_null<IExecutionApi*> const& api) noexcept -> bool final { + gsl::not_null<IExecutionApi*> const& api) const noexcept -> bool final { // Return immediately if target CAS is this CAS if (this == api) { @@ -249,7 +249,7 @@ class LocalApi final : public IExecutionApi { } [[nodiscard]] auto RetrieveToMemory( - Artifact::ObjectInfo const& artifact_info) noexcept + Artifact::ObjectInfo const& artifact_info) const noexcept -> std::optional<std::string> override { std::optional<std::filesystem::path> location{}; if (IsTreeObject(artifact_info.type)) { @@ -271,7 +271,7 @@ class LocalApi final : public IExecutionApi { } [[nodiscard]] auto Upload(ArtifactBlobContainer&& blobs, - bool /*skip_find_missing*/) noexcept + bool /*skip_find_missing*/) const noexcept -> bool final { for (auto const& blob : blobs.Blobs()) { auto const is_tree = NativeSupport::IsTree( @@ -288,8 +288,8 @@ class LocalApi final : public IExecutionApi { } [[nodiscard]] auto UploadTree( - std::vector<DependencyGraph::NamedArtifactNodePtr> const& - artifacts) noexcept -> std::optional<ArtifactDigest> final { + std::vector<DependencyGraph::NamedArtifactNodePtr> const& artifacts) + const noexcept -> std::optional<ArtifactDigest> final { auto build_root = DirectoryTree::FromNamedArtifacts(artifacts); if (not build_root) { Logger::Log(LogLevel::Debug, |