Skip to content

Commit db27d57

Browse files
committed
fix(sccache): set TMPDIR within sccache cache directory
Configure sccache to use /nix/var/cache/sccache/tmp for temporary compilation artifacts. This ensures temp files are created within the sandbox-accessible path rather than in isolated build directories, preventing permission errors on Darwin while maintaining shared cache across builds.
1 parent 846c792 commit db27d57

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

nix/cargo-pgrx/buildPgrxExtension.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ let
172172
export RUSTC_WRAPPER="${sccache}/bin/sccache"
173173
export SCCACHE_DIR="/nix/var/cache/sccache"
174174
export SCCACHE_CACHE_SIZE="50G"
175+
# Create temp directory for sccache within the cache directory
176+
export TMPDIR="/nix/var/cache/sccache/tmp"
177+
mkdir -p "$TMPDIR"
175178
else
176179
echo "sccache: cache directory not accessible in sandbox (needs extra-sandbox-paths configuration), skipping"
177180
fi

0 commit comments

Comments
 (0)