Open ArthurBorsboom opened 1 year ago
yay uses both XDG_CACHE_HOME
and HOME
, otherwise it defaults to a tmpdir
func getCacheHome() (string, error) {
uid := os.Geteuid()
if cacheHome := os.Getenv("XDG_CACHE_HOME"); cacheHome != "" && uid != 0 {
cacheDir := filepath.Join(cacheHome, "yay")
if err := initDir(cacheDir); err == nil {
return cacheDir, nil
}
}
if cacheHome := os.Getenv("HOME"); cacheHome != "" && uid != 0 {
cacheDir := filepath.Join(cacheHome, ".cache", "yay")
if err := initDir(cacheDir); err == nil {
return cacheDir, nil
}
}
if uid == 0 && os.Getenv("SUDO_USER") == "" && os.Getenv("DOAS_USER") == "" {
return systemdCache, nil // Don't create directory if systemd-run takes care of it
}
tmpDir := filepath.Join(os.TempDir(), "yay")
return tmpDir, initDir(tmpDir)
}
Can you confirm if $HOME
is set on your system?
As well check the ~/.config/yay/config.json
's builddir
for anything unusual
I can reproduce this by setting config.json
to
{
"buildDir": "/yay"
}
why it gets set to that is my question
This issue happened a month ago (about). I will take some time to reproce the problem again and report back with more details.
On Mon, 3 Apr 2023, 18:18 Jo, @.***> wrote:
I can reproduce this by setting config.json to
{ "buildDir": "/yay" }
why it gets set to that is my question
— Reply to this email directly, view it on GitHub https://github.com/Jguer/yay/issues/2052#issuecomment-1494616779, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSVB44UHFXVKCX7XELNPC3W7LZ6HANCNFSM6AAAAAAWRH5AL4 . You are receiving this because you authored the thread.Message ID: @.***>
After switching to another desktop environment, I noticed that yay stopped working with the following error message.
Even
yay --version
andyay --help
do not work.After setting XDG_CACHE_HOME yay starts working again. According the XDG specifications, the variable XDG_CACHE_HOME is not mandatory and each application should automatically fallback.
Source: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
Can yay be fixed so that it won't fail on the missing XDG_CACHE_HOME environment variable?