File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,11 +176,12 @@ let
176176 if touch "/nix/var/cache/sccache/.test" 2>/dev/null && rm -f "/nix/var/cache/sccache/.test" 2>/dev/null; then
177177 echo "sccache: cache directory available and writable, enabling"
178178 ${ lib . optionalString stdenv . isDarwin ''
179- # Darwin: use /tmp for temp files (allowed by sandbox-defaults.sb)
180- export TMPDIR=/tmp
181- export TEMP=/tmp
182- export TEMPDIR=/tmp
183- export TMP=/tmp
179+ # Darwin: use build directory for temp files (nixbld user owns it with __noChroot)
180+ export TMPDIR="$NIX_BUILD_TOP/sccache-tmp"
181+ export TEMP="$NIX_BUILD_TOP/sccache-tmp"
182+ export TEMPDIR="$NIX_BUILD_TOP/sccache-tmp"
183+ export TMP="$NIX_BUILD_TOP/sccache-tmp"
184+ mkdir -p "$TMPDIR"
184185 '' }
185186 export RUSTC_WRAPPER="${ sccache } /bin/sccache"
186187 export SCCACHE_DIR="/nix/var/cache/sccache"
You can’t perform that action at this time.
0 commit comments