-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change default temp on Linux to /var/tmp. #19038
base: master
Are you sure you want to change the base?
Conversation
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 fixes Homebrew#19037.
Update man pages.
To me it makes more sense to scope this to either just Fedora or just when |
Can we detect where to put this somehow? |
I don't think we want to detect it every time we run the brew script. And Debian is moving to having in-RAM /tmp, like most distros already do: https://linuxiac.com/debian-13-moves-to-tmpfs-for-tmp-directory/ However, I would note that moving the temporary directory to /var/tmp means that things will be slower for most users. That's a significant downside. |
This can be done with However, I agree with @fxcoudert. This is already the default behavior in just about every RPM-based distro and in Arch Linux and it will be soon in Debian
Could you explain why for those of us not familiar with Homebrew internals? |
The reason why /tmp is faster than /var/tmp is that it is RAM-based, rather than disk-based. |
Agreed. That's a pretty bad downside. I see three solutions:
|
How about: catch the |
I would be cautious about assuming that applies to all operations without supporting evidence. While I’m not familiar with every use of HOMEBREW_TEMP, based on my benchmarking, I’ve found that the performance of Untarring and decompressing from disk into memory and then writing those files back to disk doesn’t result in any performance improvement compared to simply untarring directly onto disk and renaming afterward — at least when both the source and destination are on the same file system. |
Maintaining the status quo doesn't require supporting evidence, proposing a change does. |
An argument in favour of this change: this makes things more similar to macOS and we've never had serious complaints about the status-quo there. |
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 fixes #19037.
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Please let me know if there's anything else I need to change.