Skip to content

Commit

Permalink
Merge pull request #10883 from tomberek/tomberek.remove_xdg_tmp
Browse files Browse the repository at this point in the history
fix: remove usage of XDG_RUNTIME_DIR for TMP
  • Loading branch information
roberth authored Jun 10, 2024
2 parents 12355e7 + 1363f51 commit e943ee3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/nix-build/nix-build.cc
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,7 @@ static void main_nix_build(int argc, char * * argv)
// Set the environment.
auto env = getEnv();

auto tmp = getEnvNonEmpty("TMPDIR");
if (!tmp)
tmp = getEnvNonEmpty("XDG_RUNTIME_DIR").value_or("/tmp");
auto tmp = getEnvNonEmpty("TMPDIR").value_or("/tmp");

if (pure) {
decltype(env) newEnv;
Expand All @@ -491,7 +489,7 @@ static void main_nix_build(int argc, char * * argv)
env["__ETC_PROFILE_SOURCED"] = "1";
}

env["NIX_BUILD_TOP"] = env["TMPDIR"] = env["TEMPDIR"] = env["TMP"] = env["TEMP"] = *tmp;
env["NIX_BUILD_TOP"] = env["TMPDIR"] = env["TEMPDIR"] = env["TMP"] = env["TEMP"] = tmp;
env["NIX_STORE"] = store->storeDir;
env["NIX_BUILD_CORES"] = std::to_string(settings.buildCores);

Expand Down

0 comments on commit e943ee3

Please sign in to comment.