From 21897a7e77feb19558807d4e9ead8ad1d8cfa403 Mon Sep 17 00:00:00 2001 From: Alberto Sartori Date: Thu, 1 Sep 2022 15:39:22 +0200 Subject: fix the path of the local tree-cas for compatible mode in daca274041e31636f08927b0cebc56fd33c7bbdf it has been added a local tree-cas. This cas is populated only when just runs in native mode. However, even in compatible mode, a tree must be looked for in the tree-cas. This patch set the path of the tree-cas to be the same of file-cas while running in compatible mode. --- src/buildtool/execution_api/local/config.hpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/buildtool/execution_api/local/config.hpp b/src/buildtool/execution_api/local/config.hpp index 71a4941e..4c991264 100644 --- a/src/buildtool/execution_api/local/config.hpp +++ b/src/buildtool/execution_api/local/config.hpp @@ -98,13 +98,16 @@ class LocalExecutionConfig { } // CAS directory based on the type of the file. - // Specialized just for regular File or Exectuable - template > + template [[nodiscard]] static inline auto CASDir() noexcept -> std::filesystem::path { - static const std::string kSuffix = std::string{"cas"} + ToChar(kType); + char t = ToChar(kType); + if constexpr (kType == ObjectType::Tree) { + if (Compatibility::IsCompatible()) { + t = ToChar(ObjectType::File); + } + } + static const std::string kSuffix = std::string{"cas"} + t; return CacheRoot() / kSuffix; } -- cgit v1.2.3