From aef304900c79493112c9c3951fcfc00e4f3a58bf Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 16 Apr 2024 14:32:35 +0200 Subject: Compactification: Obtain generation cache directories for compatibility modes. --- src/buildtool/storage/config.hpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/buildtool/storage/config.hpp b/src/buildtool/storage/config.hpp index f0a13e96..c1151c3f 100644 --- a/src/buildtool/storage/config.hpp +++ b/src/buildtool/storage/config.hpp @@ -126,9 +126,12 @@ class StorageConfig { } /// \brief Storage directory of specific generation and protocol type. - [[nodiscard]] static auto GenerationCacheDir(std::size_t index) noexcept + [[nodiscard]] static auto GenerationCacheDir( + std::size_t index, + bool is_compatible = Compatibility::IsCompatible()) noexcept -> std::filesystem::path { - return UpdatePathForCompatibility(GenerationCacheRoot(index)); + return UpdatePathForCompatibility(GenerationCacheRoot(index), + is_compatible); } /// \brief String representation of the used execution backend. @@ -203,9 +206,9 @@ class StorageConfig { // different folder for different caching protocol [[nodiscard]] static auto UpdatePathForCompatibility( - std::filesystem::path const& dir) -> std::filesystem::path { - return dir / (Compatibility::IsCompatible() ? "compatible-sha256" - : "git-sha1"); + std::filesystem::path const& dir, + bool is_compatible) -> std::filesystem::path { + return dir / (is_compatible ? "compatible-sha256" : "git-sha1"); } }; -- cgit v1.2.3