summaryrefslogtreecommitdiff
path: root/src/buildtool/storage/target_cache.hpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-06-10 12:42:37 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-06-11 16:11:15 +0200
commit0bfe4e8c4d3f33a60143e804a0c91cb87e03625e (patch)
treed21a214eeb7ae4238dc368141098b7e8e50bfa98 /src/buildtool/storage/target_cache.hpp
parent4a212023247a9ed03bce90b2008f0317395c6501 (diff)
downloadjustbuild-0bfe4e8c4d3f33a60143e804a0c91cb87e03625e.tar.gz
Move creation of TargetCacheKey description to TargetCache
...to use corresponding Storage for storing auxiliary information.
Diffstat (limited to 'src/buildtool/storage/target_cache.hpp')
-rw-r--r--src/buildtool/storage/target_cache.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/buildtool/storage/target_cache.hpp b/src/buildtool/storage/target_cache.hpp
index e54c2e42..b20b71e3 100644
--- a/src/buildtool/storage/target_cache.hpp
+++ b/src/buildtool/storage/target_cache.hpp
@@ -22,6 +22,8 @@
#include "gsl/gsl"
#include "nlohmann/json.hpp"
+#include "src/buildtool/build_engine/base_maps/entity_name_data.hpp"
+#include "src/buildtool/build_engine/expression/configuration.hpp"
#include "src/buildtool/common/artifact.hpp"
#include "src/buildtool/file_system/file_storage.hpp"
#include "src/buildtool/file_system/object_type.hpp"
@@ -93,6 +95,15 @@ class TargetCache {
TargetCacheEntry const& value,
ArtifactDownloader const& downloader) const noexcept -> bool;
+ /// \brief Calculate TargetCacheKey based on auxiliary information.
+ /// Doesn't create a TargetCacheEntry in the TargetCache.
+ /// \return TargetCacheKey on success.
+ [[nodiscard]] auto ComputeKey(
+ std::string const& repo_key,
+ BuildMaps::Base::NamedTarget const& target_name,
+ Configuration const& effective_config) const noexcept
+ -> std::optional<TargetCacheKey>;
+
/// \brief Read existing entry and object info from the target cache.
/// \param key The target-cache key to read the entry from.
/// \param shard Optional explicit shard, if the default is not intended.