diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-11-18 16:36:30 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-12-04 18:03:44 +0100 |
commit | a8112042b57b7a1be8b37cce46d279fd0ff9e861 (patch) | |
tree | 8d6cd5607b70a9471ae22425e224c0fef5df18d6 /src/buildtool/execution_api | |
parent | 8c15fbdd149fd34ddc024f2ba93e650dab81098b (diff) | |
download | justbuild-a8112042b57b7a1be8b37cce46d279fd0ff9e861.tar.gz |
Rename MRApiUtils to RehashUtils
Diffstat (limited to 'src/buildtool/execution_api')
-rw-r--r-- | src/buildtool/execution_api/serve/TARGETS | 29 | ||||
-rw-r--r-- | src/buildtool/execution_api/serve/mr_git_api.cpp | 16 | ||||
-rw-r--r-- | src/buildtool/execution_api/serve/mr_local_api.cpp | 14 | ||||
-rw-r--r-- | src/buildtool/execution_api/utils/TARGETS | 19 | ||||
-rw-r--r-- | src/buildtool/execution_api/utils/rehash_utils.cpp (renamed from src/buildtool/execution_api/serve/utils.cpp) | 6 | ||||
-rw-r--r-- | src/buildtool/execution_api/utils/rehash_utils.hpp (renamed from src/buildtool/execution_api/serve/utils.hpp) | 10 |
6 files changed, 47 insertions, 47 deletions
diff --git a/src/buildtool/execution_api/serve/TARGETS b/src/buildtool/execution_api/serve/TARGETS index f4d999b2..cfc23515 100644 --- a/src/buildtool/execution_api/serve/TARGETS +++ b/src/buildtool/execution_api/serve/TARGETS @@ -1,23 +1,4 @@ -{ "utils": - { "type": ["@", "rules", "CC", "library"] - , "name": ["utils"] - , "hdrs": ["utils.hpp"] - , "srcs": ["utils.cpp"] - , "deps": - [ ["src/buildtool/common", "common"] - , ["src/buildtool/file_system", "object_type"] - , ["src/buildtool/storage", "config"] - , ["src/utils/cpp", "expected"] - ] - , "stage": ["src", "buildtool", "execution_api", "serve"] - , "private-deps": - [ ["@", "fmt", "", "fmt"] - , ["src/buildtool/crypto", "hash_function"] - , ["src/buildtool/file_system", "file_system_manager"] - , ["src/buildtool/storage", "fs_utils"] - ] - } -, "mr_git_api": +{ "mr_git_api": { "type": ["@", "rules", "CC", "library"] , "name": ["mr_git_api"] , "hdrs": ["mr_git_api.hpp"] @@ -34,9 +15,9 @@ ] , "stage": ["src", "buildtool", "execution_api", "serve"] , "private-deps": - [ "utils" - , ["src/buildtool/execution_api/bazel_msg", "bazel_msg_factory"] + [ ["src/buildtool/execution_api/bazel_msg", "bazel_msg_factory"] , ["src/buildtool/execution_api/git", "git"] + , ["src/buildtool/execution_api/utils", "rehash_utils"] , ["src/buildtool/file_system", "object_type"] , ["src/buildtool/logging", "log_level"] , ["src/buildtool/logging", "logging"] @@ -58,9 +39,9 @@ ] , "stage": ["src", "buildtool", "execution_api", "serve"] , "private-deps": - [ "utils" - , ["src/buildtool/common", "protocol_traits"] + [ ["src/buildtool/common", "protocol_traits"] , ["src/buildtool/execution_api/bazel_msg", "bazel_msg_factory"] + , ["src/buildtool/execution_api/utils", "rehash_utils"] , ["src/buildtool/file_system", "object_type"] , ["src/buildtool/logging", "log_level"] , ["src/buildtool/logging", "logging"] diff --git a/src/buildtool/execution_api/serve/mr_git_api.cpp b/src/buildtool/execution_api/serve/mr_git_api.cpp index 46bc4c83..6630e891 100644 --- a/src/buildtool/execution_api/serve/mr_git_api.cpp +++ b/src/buildtool/execution_api/serve/mr_git_api.cpp @@ -19,7 +19,7 @@ #include "src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp" #include "src/buildtool/execution_api/git/git_api.hpp" -#include "src/buildtool/execution_api/serve/utils.hpp" +#include "src/buildtool/execution_api/utils/rehash_utils.hpp" #include "src/buildtool/file_system/object_type.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/logger.hpp" @@ -56,7 +56,7 @@ auto MRGitApi::RetrieveToCas( [native_sc = native_storage_config_, compat_sc = compat_storage_config_](ArtifactDigest const& digest) -> expected<std::optional<Artifact::ObjectInfo>, std::string> { - return MRApiUtils::ReadRehashedDigest( + return RehashUtils::ReadRehashedDigest( digest, *native_sc, *compat_sc, /*from_git=*/true); }; auto store_rehashed = @@ -65,12 +65,12 @@ auto MRGitApi::RetrieveToCas( ArtifactDigest const& source_digest, ArtifactDigest const& target_digest, ObjectType obj_type) -> std::optional<std::string> { - return MRApiUtils::StoreRehashedDigest(source_digest, - target_digest, - obj_type, - *native_sc, - *compat_sc, - /*from_git=*/true); + return RehashUtils::StoreRehashedDigest(source_digest, + target_digest, + obj_type, + *native_sc, + *compat_sc, + /*from_git=*/true); }; // collect the native blobs and rehash them as compatible to be able to diff --git a/src/buildtool/execution_api/serve/mr_local_api.cpp b/src/buildtool/execution_api/serve/mr_local_api.cpp index 7a8eb61a..55dddafc 100644 --- a/src/buildtool/execution_api/serve/mr_local_api.cpp +++ b/src/buildtool/execution_api/serve/mr_local_api.cpp @@ -19,7 +19,7 @@ #include "src/buildtool/common/protocol_traits.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp" -#include "src/buildtool/execution_api/serve/utils.hpp" +#include "src/buildtool/execution_api/utils/rehash_utils.hpp" #include "src/buildtool/file_system/object_type.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/logger.hpp" @@ -89,7 +89,7 @@ auto MRLocalApi::RetrieveToCas( compat_storage = compat_context_->storage_config]( ArtifactDigest const& digest) -> expected<std::optional<Artifact::ObjectInfo>, std::string> { - return MRApiUtils::ReadRehashedDigest( + return RehashUtils::ReadRehashedDigest( digest, *native_storage, *compat_storage); }; auto store_rehashed = @@ -98,11 +98,11 @@ auto MRLocalApi::RetrieveToCas( ArtifactDigest const& source_digest, ArtifactDigest const& target_digest, ObjectType obj_type) -> std::optional<std::string> { - return MRApiUtils::StoreRehashedDigest(source_digest, - target_digest, - obj_type, - *native_storage, - *compat_storage); + return RehashUtils::StoreRehashedDigest(source_digest, + target_digest, + obj_type, + *native_storage, + *compat_storage); }; // collect the native blobs and rehash them as compatible to be able to diff --git a/src/buildtool/execution_api/utils/TARGETS b/src/buildtool/execution_api/utils/TARGETS index bff656ec..afaabeb0 100644 --- a/src/buildtool/execution_api/utils/TARGETS +++ b/src/buildtool/execution_api/utils/TARGETS @@ -31,4 +31,23 @@ ] , "stage": ["src", "buildtool", "execution_api", "utils"] } +, "rehash_utils": + { "type": ["@", "rules", "CC", "library"] + , "name": ["utils"] + , "hdrs": ["rehash_utils.hpp"] + , "srcs": ["rehash_utils.cpp"] + , "deps": + [ ["src/buildtool/common", "common"] + , ["src/buildtool/file_system", "object_type"] + , ["src/buildtool/storage", "config"] + , ["src/utils/cpp", "expected"] + ] + , "stage": ["src", "buildtool", "execution_api", "utils"] + , "private-deps": + [ ["@", "fmt", "", "fmt"] + , ["src/buildtool/crypto", "hash_function"] + , ["src/buildtool/file_system", "file_system_manager"] + , ["src/buildtool/storage", "fs_utils"] + ] + } } diff --git a/src/buildtool/execution_api/serve/utils.cpp b/src/buildtool/execution_api/utils/rehash_utils.cpp index 39c4f7d3..660d8cec 100644 --- a/src/buildtool/execution_api/serve/utils.cpp +++ b/src/buildtool/execution_api/utils/rehash_utils.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "src/buildtool/execution_api/serve/utils.hpp" +#include "src/buildtool/execution_api/utils/rehash_utils.hpp" #include <cstddef> // std::size_t #include <filesystem> @@ -24,7 +24,7 @@ #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/storage/fs_utils.hpp" -namespace MRApiUtils { +namespace RehashUtils { auto ReadRehashedDigest(ArtifactDigest const& digest, StorageConfig const& source_config, @@ -115,4 +115,4 @@ auto StoreRehashedDigest(ArtifactDigest const& source_digest, return std::nullopt; // a-ok } -} // namespace MRApiUtils +} // namespace RehashUtils diff --git a/src/buildtool/execution_api/serve/utils.hpp b/src/buildtool/execution_api/utils/rehash_utils.hpp index 3b588cf3..7ed7cb11 100644 --- a/src/buildtool/execution_api/serve/utils.hpp +++ b/src/buildtool/execution_api/utils/rehash_utils.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef INCLUDED_SRC_BUILDTOOL_EXECUTION_API_SERVE_UTILS_HPP -#define INCLUDED_SRC_BUILDTOOL_EXECUTION_API_SERVE_UTILS_HPP +#ifndef INCLUDED_SRC_BUILDTOOL_EXECUTION_API_UTILS_REHASH_UTILS_HPP +#define INCLUDED_SRC_BUILDTOOL_EXECUTION_API_UTILS_REHASH_UTILS_HPP #include <optional> #include <string> @@ -24,7 +24,7 @@ #include "src/buildtool/storage/config.hpp" #include "src/utils/cpp/expected.hpp" -namespace MRApiUtils { +namespace RehashUtils { /// \brief Get a corresponding known object from a different local CAS, as /// stored in a mapping file, if exists. @@ -59,6 +59,6 @@ namespace MRApiUtils { bool from_git = false) noexcept -> std::optional<std::string>; -} // namespace MRApiUtils +} // namespace RehashUtils -#endif // INCLUDED_SRC_BUILDTOOL_EXECUTION_API_SERVE_UTILS_HPP +#endif // INCLUDED_SRC_BUILDTOOL_EXECUTION_API_UTILS_REHASH_UTILS_HPP |