We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
1 parent c338545 commit 36f363bCopy full SHA for 36f363b
src/libmain/shared.cc
@@ -162,6 +162,14 @@ void initNix()
162
163
if (char *pack = getenv("_NIX_OPTIONS"))
164
settings.unpack(pack);
165
+
166
+ /* On macOS, don't use the per-session TMPDIR (as set e.g. by
167
+ sshd). This breaks build users because they don't have access
168
+ to the TMPDIR, in particular in ‘nix-store --serve’. */
169
+#if __APPLE__
170
+ if (getuid() == 0 && hasPrefix(getEnv("TMPDIR"), "/var/folders/"))
171
+ unsetenv("TMPDIR");
172
+#endif
173
}
174
175
0 commit comments