diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-03-12 18:23:35 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-03-13 12:14:53 +0100 |
commit | 2bd069cdecb5371d906f8df9f5fb36f308d6296f (patch) | |
tree | 3db2cee634411639d520b2dee796b8a97b7342f6 /src/other_tools/root_maps | |
parent | f487f592fdc85fbdb95856abb7f4281dd4353da9 (diff) | |
download | justbuild-2bd069cdecb5371d906f8df9f5fb36f308d6296f.tar.gz |
Move storage-aware tmpdir creation to config
... as the fs_utils have a lot more dependencies making them usable
in less places. Moreover, this function also serves to shape the
layout of the local build root and hence is more appropriately
placed in the config anyway.
Diffstat (limited to 'src/other_tools/root_maps')
-rw-r--r-- | src/other_tools/root_maps/TARGETS | 2 | ||||
-rw-r--r-- | src/other_tools/root_maps/commit_git_map.cpp | 2 | ||||
-rw-r--r-- | src/other_tools/root_maps/content_git_map.cpp | 2 | ||||
-rw-r--r-- | src/other_tools/root_maps/distdir_git_map.cpp | 2 | ||||
-rw-r--r-- | src/other_tools/root_maps/foreign_file_git_map.cpp | 3 | ||||
-rw-r--r-- | src/other_tools/root_maps/fpath_git_map.cpp | 2 | ||||
-rw-r--r-- | src/other_tools/root_maps/tree_id_git_map.cpp | 3 |
7 files changed, 8 insertions, 8 deletions
diff --git a/src/other_tools/root_maps/TARGETS b/src/other_tools/root_maps/TARGETS index 42739b92..671a1d40 100644 --- a/src/other_tools/root_maps/TARGETS +++ b/src/other_tools/root_maps/TARGETS @@ -148,6 +148,7 @@ , ["src/buildtool/file_system", "file_root"] , ["src/buildtool/logging", "log_level"] , ["src/buildtool/serve_api/remote", "serve_api"] + , ["src/buildtool/storage", "config"] , ["src/buildtool/storage", "fs_utils"] , ["src/buildtool/storage", "storage"] , ["src/utils/cpp", "tmp_dir"] @@ -177,7 +178,6 @@ , ["src/buildtool/execution_api/git", "git"] , ["src/buildtool/file_system", "file_root"] , ["src/buildtool/storage", "config"] - , ["src/buildtool/storage", "fs_utils"] , ["src/buildtool/storage", "storage"] ] } diff --git a/src/other_tools/root_maps/commit_git_map.cpp b/src/other_tools/root_maps/commit_git_map.cpp index 8bd18cc9..f9da1300 100644 --- a/src/other_tools/root_maps/commit_git_map.cpp +++ b/src/other_tools/root_maps/commit_git_map.cpp @@ -727,7 +727,7 @@ void EnsureCommit( JustMRProgress::Instance().TaskTracker().Stop( repo_info.origin); // Move tree from local CAS to local Git storage - auto tmp_dir = StorageUtils::CreateTypedTmpDir( + auto tmp_dir = StorageConfig::CreateTypedTmpDir( "fetch-absent-root"); if (not tmp_dir) { (*logger)( diff --git a/src/other_tools/root_maps/content_git_map.cpp b/src/other_tools/root_maps/content_git_map.cpp index 67e61606..3bbc21c5 100644 --- a/src/other_tools/root_maps/content_git_map.cpp +++ b/src/other_tools/root_maps/content_git_map.cpp @@ -359,7 +359,7 @@ void ExtractAndImportToGit( ContentGitMap::SetterPtr const& setter, ContentGitMap::LoggerPtr const& logger) { // extract archive - auto tmp_dir = StorageUtils::CreateTypedTmpDir(key.repo_type); + auto tmp_dir = StorageConfig::CreateTypedTmpDir(key.repo_type); if (not tmp_dir) { (*logger)(fmt::format("Failed to create tmp path for {} target {}", key.repo_type, diff --git a/src/other_tools/root_maps/distdir_git_map.cpp b/src/other_tools/root_maps/distdir_git_map.cpp index cc44c05c..e003e000 100644 --- a/src/other_tools/root_maps/distdir_git_map.cpp +++ b/src/other_tools/root_maps/distdir_git_map.cpp @@ -71,7 +71,7 @@ void ImportFromCASAndSetRoot( DistdirGitMap::SetterPtr const& setter, DistdirGitMap::LoggerPtr const& logger) { // create the links to CAS - auto tmp_dir = StorageUtils::CreateTypedTmpDir("distdir"); + auto tmp_dir = StorageConfig::CreateTypedTmpDir("distdir"); if (not tmp_dir) { (*logger)(fmt::format("Failed to create tmp path for " "distdir target {}", diff --git a/src/other_tools/root_maps/foreign_file_git_map.cpp b/src/other_tools/root_maps/foreign_file_git_map.cpp index c2d06786..5e08a18a 100644 --- a/src/other_tools/root_maps/foreign_file_git_map.cpp +++ b/src/other_tools/root_maps/foreign_file_git_map.cpp @@ -19,6 +19,7 @@ #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/serve_api/remote/serve_api.hpp" +#include "src/buildtool/storage/config.hpp" #include "src/buildtool/storage/fs_utils.hpp" #include "src/buildtool/storage/storage.hpp" #include "src/other_tools/root_maps/root_utils.hpp" @@ -55,7 +56,7 @@ void WithFetchedFile(ForeignFileInfo const& key, gsl::not_null<TaskSystem*> const& ts, ForeignFileGitMap::SetterPtr const& setter, ForeignFileGitMap::LoggerPtr const& logger) { - auto tmp_dir = StorageUtils::CreateTypedTmpDir("foreign-file"); + auto tmp_dir = StorageConfig::CreateTypedTmpDir("foreign-file"); auto const& cas = Storage::Instance().CAS(); auto digest = ArtifactDigest(key.archive.content, 0, key.executable); auto content_cas_path = cas.BlobPath(digest, key.executable); diff --git a/src/other_tools/root_maps/fpath_git_map.cpp b/src/other_tools/root_maps/fpath_git_map.cpp index 9fb6858d..4c398612 100644 --- a/src/other_tools/root_maps/fpath_git_map.cpp +++ b/src/other_tools/root_maps/fpath_git_map.cpp @@ -346,7 +346,7 @@ auto CreateFilePathGitMap( /*fatal=*/false); } // it's not a git repo, so import it to git cache - auto tmp_dir = StorageUtils::CreateTypedTmpDir("file"); + auto tmp_dir = StorageConfig::CreateTypedTmpDir("file"); if (not tmp_dir) { (*logger)("Failed to create import-to-git tmp directory!", /*fatal=*/true); diff --git a/src/other_tools/root_maps/tree_id_git_map.cpp b/src/other_tools/root_maps/tree_id_git_map.cpp index e0456f12..9e8b1360 100644 --- a/src/other_tools/root_maps/tree_id_git_map.cpp +++ b/src/other_tools/root_maps/tree_id_git_map.cpp @@ -19,7 +19,6 @@ #include "src/buildtool/execution_api/git/git_api.hpp" #include "src/buildtool/file_system/file_root.hpp" #include "src/buildtool/storage/config.hpp" -#include "src/buildtool/storage/fs_utils.hpp" #include "src/buildtool/storage/storage.hpp" #include "src/other_tools/root_maps/root_utils.hpp" @@ -84,7 +83,7 @@ void MoveCASTreeToGitAndProcess( TreeIdGitMap::SetterPtr const& setter, TreeIdGitMap::LoggerPtr const& logger) { // Move tree from CAS to local Git storage - auto tmp_dir = StorageUtils::CreateTypedTmpDir("fetch-remote-git-tree"); + auto tmp_dir = StorageConfig::CreateTypedTmpDir("fetch-remote-git-tree"); if (not tmp_dir) { (*logger)(fmt::format("Failed to create tmp directory for copying " "git-tree {} from remote CAS", |