From 4a9d15ec0340516b5a017540d1d5f0eb9a95dbaa Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 12 Mar 2024 18:04:22 +0100 Subject: Fix tmpdir location Commit 2ebf355989eb92ac9967eceee0af14d39477afe0 moved the tmpdir creation for various tasks into the task itself. In doing so, TmpDir was called with a relative path; that was, however, is interpreted relative to the working directory, violating the property that our tool never write anything outside the local build root unless explicitly asked to do so (by specifying the output path in an install or install-cas invocation). Fix this, by calling the the tmp-dir function that is storage-layout aware. --- src/other_tools/git_operations/git_repo_remote.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/other_tools/git_operations/git_repo_remote.cpp') diff --git a/src/other_tools/git_operations/git_repo_remote.cpp b/src/other_tools/git_operations/git_repo_remote.cpp index a64a6de5..5b1a9750 100644 --- a/src/other_tools/git_operations/git_repo_remote.cpp +++ b/src/other_tools/git_operations/git_repo_remote.cpp @@ -18,9 +18,9 @@ #include "nlohmann/json.hpp" #include "src/buildtool/file_system/git_utils.hpp" #include "src/buildtool/logging/logger.hpp" +#include "src/buildtool/storage/config.hpp" #include "src/buildtool/system/system_command.hpp" #include "src/other_tools/git_operations/git_config_settings.hpp" -#include "src/utils/cpp/tmp_dir.hpp" extern "C" { #include @@ -401,7 +401,7 @@ auto GitRepoRemote::UpdateCommitViaTmpRepo( anon_logger_ptr const& logger) const noexcept -> std::optional { try { - auto tmp_dir = TmpDir::Create("update"); + auto tmp_dir = StorageConfig::CreateTypedTmpDir("update"); if (not tmp_dir) { (*logger)("Failed to create temp dir for running 'git ls-remote'", /*fatal=*/true); @@ -536,7 +536,7 @@ auto GitRepoRemote::FetchViaTmpRepo(std::string const& repo_url, anon_logger_ptr const& logger) noexcept -> bool { try { - auto tmp_dir = TmpDir::Create("fetch"); + auto tmp_dir = StorageConfig::CreateTypedTmpDir("fetch"); if (not tmp_dir) { (*logger)("Failed to create temp dir for running 'git fetch'", /*fatal=*/true); -- cgit v1.2.3