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/buildtool/file_system/git_repo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/buildtool/file_system/git_repo.cpp') diff --git a/src/buildtool/file_system/git_repo.cpp b/src/buildtool/file_system/git_repo.cpp index 2022d0b1..eceb5a1d 100644 --- a/src/buildtool/file_system/git_repo.cpp +++ b/src/buildtool/file_system/git_repo.cpp @@ -20,10 +20,10 @@ #include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/logging/logger.hpp" +#include "src/buildtool/storage/config.hpp" #include "src/utils/cpp/gsl.hpp" #include "src/utils/cpp/hex_string.hpp" #include "src/utils/cpp/path.hpp" -#include "src/utils/cpp/tmp_dir.hpp" extern "C" { #include @@ -1555,7 +1555,7 @@ auto GitRepo::LocalFetchViaTmpRepo(std::string const& repo_path, Logger::Log(LogLevel::Debug, "Branch local fetch called on a real repository"); } - auto tmp_dir = TmpDir::Create("local_fetch"); + auto tmp_dir = StorageConfig::CreateTypedTmpDir("local_fetch"); if (not tmp_dir) { (*logger)("Failed to create temp dir for Git repository", /*fatal=*/true); -- cgit v1.2.3