Skip to content

Commit

Permalink
fix: remove usage of XDG_RUNTIME_DIR for TMP
Browse files Browse the repository at this point in the history
  • Loading branch information
tomberek committed Jun 10, 2024
1 parent 12355e7 commit 1363f51
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 1363f51

Please sign in to comment.