diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2025-05-26 10:41:15 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2025-06-04 14:34:44 +0200 |
commit | 8d4f583d63c657397583f778096b8bcb6d96c12f (patch) | |
tree | 7bb05ba0b827974aae31226987f7565cfb380e60 /src/buildtool/storage/fs_utils.hpp | |
parent | 1258417cf03b3978005a637c3536873fef146c38 (diff) | |
download | justbuild-8d4f583d63c657397583f778096b8bcb6d96c12f.tar.gz |
Add utility methods for caching valid trees
...through marker files kept in storage under generation regime.
These can be used to allow valid source trees, i.e., those free of
upwards symlinks, to be cached in a persistent manner over multiple
builds.
Diffstat (limited to 'src/buildtool/storage/fs_utils.hpp')
-rw-r--r-- | src/buildtool/storage/fs_utils.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/buildtool/storage/fs_utils.hpp b/src/buildtool/storage/fs_utils.hpp index 8cc23b69..a03cc4dd 100644 --- a/src/buildtool/storage/fs_utils.hpp +++ b/src/buildtool/storage/fs_utils.hpp @@ -89,6 +89,12 @@ namespace StorageUtils { std::size_t generation = 0) noexcept -> std::filesystem::path; +/// \brief Get the path to the file marking a known valid Git tree. +[[nodiscard]] auto GetValidTreesMarkerFile(StorageConfig const& storage_config, + std::string const& tree_hash, + std::size_t generation = 0) noexcept + -> std::filesystem::path; + /// \brief Write a tree id to file. The parent folder of the file must exist! [[nodiscard]] auto WriteTreeIDFile(std::filesystem::path const& tree_id_file, std::string const& tree_id) noexcept -> bool; |