Change default temp on Linux to /var/tmp.

Previously, the default temporary directory was /tmp on Linux and
/private/tmp on macOS. On many Linux distros, including at least Fedora,
/tmp is stored in RAM. This diverges from the behavior on macOS and has
led to bugs, most notably the inability to install large bottles on
memory-limited machines.
This commit is contained in:
Aman Verma 2025-01-04 21:31:12 -06:00 committed by Mike McQuaid
parent 83e4d73670
commit 9c79c5b632
No known key found for this signature in database
4 changed files with 4 additions and 4 deletions

View File

@ -65,7 +65,7 @@ else
CACHE_HOME="${HOMEBREW_XDG_CACHE_HOME:-${HOME}/.cache}" CACHE_HOME="${HOMEBREW_XDG_CACHE_HOME:-${HOME}/.cache}"
HOMEBREW_DEFAULT_CACHE="${CACHE_HOME}/Homebrew" HOMEBREW_DEFAULT_CACHE="${CACHE_HOME}/Homebrew"
HOMEBREW_DEFAULT_LOGS="${CACHE_HOME}/Homebrew/Logs" HOMEBREW_DEFAULT_LOGS="${CACHE_HOME}/Homebrew/Logs"
HOMEBREW_DEFAULT_TEMP="/tmp" HOMEBREW_DEFAULT_TEMP="/var/tmp"
fi fi
realpath() { realpath() {

View File

@ -478,7 +478,7 @@ module Homebrew
"different volumes, as macOS has trouble moving symlinks across volumes when the target " \ "different volumes, as macOS has trouble moving symlinks across volumes when the target " \
"does not yet exist. This issue typically occurs when using FileVault or custom SSD " \ "does not yet exist. This issue typically occurs when using FileVault or custom SSD " \
"configurations.", "configurations.",
default_text: "macOS: `/private/tmp`, Linux: `/tmp`.", default_text: "macOS: `/private/tmp`, Linux: `/var/tmp`.",
default: HOMEBREW_DEFAULT_TEMP, default: HOMEBREW_DEFAULT_TEMP,
}, },
HOMEBREW_UPDATE_TO_TAG: { HOMEBREW_UPDATE_TO_TAG: {

View File

@ -4344,7 +4344,7 @@ command execution e.g. `$(cat file)`.
the target does not yet exist. This issue typically occurs when using the target does not yet exist. This issue typically occurs when using
FileVault or custom SSD configurations. FileVault or custom SSD configurations.
*Default:* macOS: `/private/tmp`, Linux: `/tmp`. *Default:* macOS: `/private/tmp`, Linux: `/var/tmp`.
`HOMEBREW_UPDATE_TO_TAG` `HOMEBREW_UPDATE_TO_TAG`

View File

@ -2843,7 +2843,7 @@ If set in Homebrew\[u2019]s system\-wide environment file (\fB/etc/homebrew/brew
Use this path as the temporary directory for building packages\. Changing this may be needed if your system temporary directory and Homebrew prefix are on different volumes, as macOS has trouble moving symlinks across volumes when the target does not yet exist\. This issue typically occurs when using FileVault or custom SSD configurations\. Use this path as the temporary directory for building packages\. Changing this may be needed if your system temporary directory and Homebrew prefix are on different volumes, as macOS has trouble moving symlinks across volumes when the target does not yet exist\. This issue typically occurs when using FileVault or custom SSD configurations\.
.RS .RS
.P .P
\fIDefault:\fP macOS: \fB/private/tmp\fP, Linux: \fB/tmp\fP\&\. \fIDefault:\fP macOS: \fB/private/tmp\fP, Linux: \fB/var/tmp\fP\&\.
.RE .RE
.TP .TP
\fBHOMEBREW_UPDATE_TO_TAG\fP \fBHOMEBREW_UPDATE_TO_TAG\fP