yay v9.0.1 - libalpm v11.0.1
It would be nice if you could set the cache dir to something different than ~/.cache/yay and I couldn't find an option to do that from quickly reading through the code. For example pacaur has the environment variable AURDEST that lets you specificy a different directory to throw the PKGBUILDs in (which is important because I have my ~/.cache on a tmpfs, but I'd like to save the PKGBUILDs)
Side note: There's a typo in cachdir in main.go, and I think that that is dead code
If you use yay -Syu --builddir=<your dir> --save the pkgbuilds should be thrown in there if I'm not mistaken
Yep, that is partially what I want. But still completion.cache and vcs.json (according to the man page) will be lost on reboot.
True, I guess changing $XDG_CACHE_DIR is not really an option :laughing:. We are a bit in the middle of refactoring configuration so I'll probably slap an enhancement label on it and tie it with those changes.
Thanks!
I've got my /home mounted with noexec causing build errors for some aur packages. Using yay --builddir=/tmp//yay --save is a good workaround though.
For anyone coming across this wanting this behavior, for all makepkg based builds, the makepkg variable BUILDDIR is honored, so you can set your makepkg builddir to BUILDDIR=/tmp/makepg and still keep PKGBUILDs.
I've tried it with a few package installs like linux-lqx and it seems to work fine.
I get this: stat /home/user/.cache/yay: permission denied
I had this problem with yay -Sc. I turns out that I had this set:
export AURDEST=/tmp
I'm guessing that the systemd-private directories were getting in the way?
I feel like the build and the cache directory should be split. It's fine to store the cached content in $home, but compiling should happen in a temporary directory.
To add my two cents' worth in addition to @RubenKelevra's point, the one thing I would really appreciate from yay, is if it would honour the TMPDIR environment variable when it does builds.
yay seems pretty fixated on using /tmp for builds, but for reasons I would rather not get into here, the systems I'm running this on have /tmp mounted with the noexec flag. This isn't an issue for most builds, but some packages require being able to exec something in the build directory, and the noexec flag causes this to fail.
It would be nice if I could run something like TMPDIR=/var/tmp yay ... for those one-off builds that require being able to exec something in the build dir.
I think building should happening in a chroot environment, which could systemd-nspawn provide.
Compiling could happen in a temporary directory which is managed by systemd (and which is optionally a mount of a tmpfs) while data which is useful between two builds, like go-build cache or the git on devel packages could be stored permanently - with the option to clear it between builds.
This would allow us to share the go-cache as a mount between the individual packages in something something like /var/cache/yay/gocache/ to save compile time, download-bandwidth and disk space, while avoiding to taint the go-cache of the user.
Additionally yay could start to manage the cache, so if there's an application no longer installed, it could remove the part of the dependencies while updating with something like go clean -modcache -r "github.com/something/something/cmd/something".
It also allows us to cut the internet connection after the prepare(), since build() and package() shouldn't have internet connection nor access to the system with the user rights.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
At the very least, honoring XDG_CACHE_HOME would be great. Currently yay is the only thing in my ~/.cache directory.
Most helpful comment
I feel like the build and the cache directory should be split. It's fine to store the cached content in $home, but compiling should happen in a temporary directory.