nix: don't use /tmp for the tests on darwin

Unlike on linux these are not namespaced per user so this will cause
build failures if /tmp/nix-test was not removed by a previous build if
the nixbld user id doesn't match by accident. Nix already creates a
unique tempdir for builds so we can use that instead.

Fixes #44172
This commit is contained in:
Daiderd Jordan 2018-07-28 15:52:36 +02:00
parent 13c693ed95
commit 77a9745d7a
No known key found for this signature in database
GPG Key ID: D02435D05B810C96

View File

@ -71,7 +71,9 @@ let
doInstallCheck = true; # not cross
# socket path becomes too long otherwise
preInstallCheck = lib.optional stdenv.isDarwin "export TMPDIR=/tmp";
preInstallCheck = lib.optional stdenv.isDarwin ''
export TMPDIR=$NIX_BUILD_TOP
'';
separateDebugInfo = stdenv.isLinux;