summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/local/config.hpp
diff options
context:
space:
mode:
authorAlberto Sartori <alberto.sartori@huawei.com>2022-09-01 15:39:22 +0200
committerSascha Roloff <sascha.roloff@huawei.com>2022-09-12 14:45:34 +0200
commit21897a7e77feb19558807d4e9ead8ad1d8cfa403 (patch)
tree0cc5c55c39df68a4b4f6a9da0de0fa575f956d61 /src/buildtool/execution_api/local/config.hpp
parentb877561106e0913de7200836d3c5d167d06e3243 (diff)
downloadjustbuild-21897a7e77feb19558807d4e9ead8ad1d8cfa403.tar.gz
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.
Diffstat (limited to 'src/buildtool/execution_api/local/config.hpp')
-rw-r--r--src/buildtool/execution_api/local/config.hpp13
1 files changed, 8 insertions, 5 deletions
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 <ObjectType kType,
- typename = std::enable_if<kType == ObjectType::File or
- kType == ObjectType::Executable>>
+ template <ObjectType kType>
[[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;
}