Merge pull request #19824 from Homebrew/linux_var_tmp

Change default temp on Linux to /var/tmp.
This commit is contained in:
Mike McQuaid 2025-04-25 17:06:20 +00:00 committed by GitHub
commit dcb28327d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 4 deletions

View File

@ -65,8 +65,13 @@ else
CACHE_HOME="${HOMEBREW_XDG_CACHE_HOME:-${HOME}/.cache}"
HOMEBREW_DEFAULT_CACHE="${CACHE_HOME}/Homebrew"
HOMEBREW_DEFAULT_LOGS="${CACHE_HOME}/Homebrew/Logs"
if [[ -r "/var/tmp" && -w "/var/tmp" ]]
then
HOMEBREW_DEFAULT_TEMP="/var/tmp"
else
HOMEBREW_DEFAULT_TEMP="/tmp"
fi
fi
realpath() {
(cd "$1" &>/dev/null && pwd -P)

View File

@ -478,7 +478,7 @@ module Homebrew
"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.",
default_text: "macOS: `/private/tmp`, Linux: `/tmp`.",
default_text: "macOS: `/private/tmp`, Linux: `/var/tmp`.",
default: HOMEBREW_DEFAULT_TEMP,
},
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
FileVault or custom SSD configurations.
*Default:* macOS: `/private/tmp`, Linux: `/tmp`.
*Default:* macOS: `/private/tmp`, Linux: `/var/tmp`.
`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\.
.RS
.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
.TP
\fBHOMEBREW_UPDATE_TO_TAG\fP