| Probably this would be the fix:
Path defaultTempDir()
{
auto dir = settings.tempDir.get().or_else([] {
return getEnvNonEmpty("TMPDIR").and_then([](auto val) -> std::optional<Path> {
#if __APPLE__
/* On macOS, don't use the per-session TMPDIR (as set e.g. by
sshd). This breaks build users because they don't have access
to the TMPDIR, in particular in ‘nix-store --serve’. */
if (val.starts_with("/var/folders/")) {
return std::nullopt;
}
#endif
return val;
});
}).value_or("/tmp");
return canonPath(dir, true);
}
|