Closed codyps closed 1 year ago
Hi, thanks for opening the issue! I am not sure how to solve it, I will do some investigation on my side, if you have any suggestion, they are more than welcome!
3.Ideally, extract the file as a streaming operation as it is downloaded to avoid the use of $TMPDIR entirely.
This would be perfect, but I am not sure if there is a way to do this.
A good option here:
Download & extract files to the rustup
tmp dir ($HOME/.rustup/tmp
, $RUSTUP_HOME/tmp
, etc) instead of $TMPDIR
. This would mirror rustup behavior which folks probably expect. (even if they don't like it much. I have symlinks in place so that $RUSTUP_HOME/tmp
ends up in $XDG_CACHE_HOME
).
A good option here:
Download & extract files to the
rustup
tmp dir ($HOME/.rustup/tmp
,$RUSTUP_HOME/tmp
, etc) instead of$TMPDIR
. This would mirror rustup behavior which folks probably expect. (even if they don't like it much. I have symlinks in place so that$RUSTUP_HOME/tmp
ends up in$XDG_CACHE_HOME
).
Good idea! Just implemented this, do you mind testing it?
cargo uninstall espup
cargo install espup --git https://github.com/SergioGasquez/espup --branch feature/update-tmp-loc
espup install
Placing temporary data in the final toolchain directory certainly does work, and it runs fine for me.
It does feel a little weird to use the toolchain directory instead of the $RUSTUP_HOME/tmp
directory, because that directory already exists and is used for this purpose by rustup, but what's there now is a definite improvement over using $TMPDIR
given the size of the temporary data.
Updated the branch to use $RUSTUP_HOME/tmp
and simplified the code a bit!
Works for me 👍
Bug description
espup
downloads and extracts data in$TMPDIR
, resulting in ~1.2GiB of space usage.$TMPDIR
is often a ram disk, so we're storing data to ram. We later copy this same data to other locations (directories in$RUSTUP_HOME
, etc).To Reproduce
Steps to reproduce the behavior:
TMPDIR
at a tmpfs (probably the default, if you're using linux with systemd)espup
so that it downloads & installs a toolchaindf -h
to note 1.2GiB of tmpfs usageExpected behavior
$TMPDIR
, instead extracting them adjacent to their final location so they can be moved into place$TMPDIR
entirely.Environment
Additional context
Systemd defaults
RuntimeDirectory
(which$TMPDIR
points to) to 10% of available memory (https://www.freedesktop.org/software/systemd/man/logind.conf.html#RuntimeDirectorySize=). This means on a system with 2GiB of ram, we get 200MiB. With the current 1.2GiB of usage, espup users with linux + systemd defaults will need to ensure they have ~12GiB of ram.