1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-06 00:51:00 +01:00

Merge pull request #7918 from zimbatm/fix-empty-nix-store-env

treat empty NIX_STORE_DIR env vars as unset
This commit is contained in:
Eelco Dolstra 2023-03-03 13:49:56 +01:00 committed by GitHub
commit 0507462c06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 8 deletions

View file

@ -2062,7 +2062,7 @@ void LocalDerivationGoal::runChild()
/* The tmpDir in scope points at the temporary build directory for our derivation. Some packages try different mechanisms
to find temporary directories, so we want to open up a broader place for them to dump their files, if needed. */
Path globalTmpDir = canonPath(getEnv("TMPDIR").value_or("/tmp"), true);
Path globalTmpDir = canonPath(getEnvNonEmpty("TMPDIR").value_or("/tmp"), true);
/* They don't like trailing slashes on subpath directives */
if (globalTmpDir.back() == '/') globalTmpDir.pop_back();