aura icon indicating copy to clipboard operation
aura copied to clipboard

Move cache from `/tmp` to some `cache` folder

Open hissssst opened this issue 4 years ago • 21 comments

Current behaviour

If aura fails to build package, some folders are left in /tmp

Desired behaviour

If aura fails to build package, folders are moved from /tmp to some cache directory like $XDG_HOME_CACHE (if it exists for root user)

Enviroment

$ aura --version
 __ _ _  _ _ _ __ _    Pacman v5.2.2 - libalpm v12.0.2
/ _` | || | '_/ _` |   Copyright (C) 2006-2020 Pacman Development Team
\__,_|\_,_|_| \__,_|   Copyright (C) 2002-2006 Judd Vinet
AURA Version 3.2.2
 by Colin Woodbury     This program may be freely redistributed under
                       the terms of the GNU General Public License.

hissssst avatar Jan 14 '21 13:01 hissssst

You mean this? That's configurable. https://github.com/fosskers/aura/blob/master/aura/doc/aura.conf#L47

micwoj92 avatar Jan 14 '21 13:01 micwoj92

@micwoj92 I want to build in /tmp and to move build cache from /tmp to some cache directory

hissssst avatar Jan 14 '21 14:01 hissssst

I could add configuration for this.

fosskers avatar Jan 14 '21 20:01 fosskers

@fosskers It would be nice I can implement the PR, but it'll take some time since I don't know haskell

hissssst avatar Jan 14 '21 21:01 hissssst

Doesn't this already exist as PKGDEST?

Morganamilo avatar Jan 14 '21 21:01 Morganamilo

Actually perhaps he was looking for SRCDEST? For the record @hissssst we're referring to settings in /etc/makepkg.conf.

fosskers avatar Jan 14 '21 21:01 fosskers

I've just read the man 5 makepkg.conf SRCDEST and PKGDEST do not satisfy this issue

What I want is to build packages in /tmp, but remove sources and build cache from there after the build finished (successfully or not)

hissssst avatar Jan 14 '21 21:01 hissssst

Above you said you wanted to move the stuff not remove them.

Morganamilo avatar Jan 14 '21 21:01 Morganamilo

@Morganamilo , moving is also acceptable (if it will help to decrease build time)

Anyway, the idea is that

  1. While building, have files in buildpath
  2. After build, have no files in buildpath

I found out, that some heavy builds leave files in buildpath after finishing. Their size can be about 1 GB, which is pretty heavy to have in /tmp with 4GB RAM laptop

hissssst avatar Jan 14 '21 21:01 hissssst

then set BUILDDIR to /tmp?

Morganamilo avatar Jan 14 '21 21:01 Morganamilo

@Morganamilo Thanks! I can set this, but I don't think that default behaviour of aura should use my RAM after the build fails

hissssst avatar Jan 15 '21 23:01 hissssst

@fosskers ping

hissssst avatar Jan 19 '21 11:01 hissssst

Thanks for the updates, I will look into this as I complete the Rust port. I'm currently also moving countries and am quite busy with that.

fosskers avatar Jan 19 '21 18:01 fosskers

I also "experienced" this, aka. as my /tmp became out of space because of remains from old failed builds. So I had to manually remove them to have enough space to run aura -Au successfully again.

mims-github avatar Apr 08 '22 12:04 mims-github

This is an auto-fix with the Rust build, since /tmp is no longer used in this way.

fosskers avatar Apr 08 '22 19:04 fosskers

Sorry to hijack. I too would like to have the build done in /tmp but moved to $XDG_HOME_CACHE after. I know this isn't possible currently so I tried to move the build path to my $XDG_HOME_CACHE folder.

I've tried various settings in the buildpath but I can't work out what it wants, as it is a global file I tried: $home/.cache/aura and this resulted in /home/t0m5k1/$home/.cache/aura being created, .cache/aura as build path and this resulted in /tmp/.cache/aura being created, ~/.cache/aura and i ended up with /tmp/~/.cache/aura $XDG_HOME_CACHE/aura but this just resulted in /tmp/$XDG_HOME_CACHE/aura

So i'm quite baffled as to what I can put here to at least get the build path to be where I want it and it doesn't help that the doc have no guidance on this config option

t0m5k1 avatar May 14 '22 09:05 t0m5k1

Set BUILDDIR to tmp and PKGDEST to wherever you want?

Morganamilo avatar May 14 '22 10:05 Morganamilo

@Morganamilo I'm sorry my comment not self explanatory. You've suggested that twice already but it's not what we're looking for.

I'm only referring to /etc/aura.conf Pacman/makepkg is fine as it is.

This is aura.conf:

 buildpath = /home/t0m5k1/.cache/aura
# allsourcepath = /var/cache/aura/src
# vcspath = /var/cache/aura/vcs

However this is a global file so all users build files are being sent to my folder, I want them to go to $XDG_HOME_CACHE/aura for all users. This way all users have their own cache of what they've built.

t0m5k1 avatar May 14 '22 10:05 t0m5k1

I respond to email. This was so long ago didn't realise it was the same thread :p

Morganamilo avatar May 14 '22 10:05 Morganamilo

lol, yea I know that feeling ..do it all the time at work

t0m5k1 avatar May 14 '22 10:05 t0m5k1

This way all users have their own cache of what they've built.

This will be / already is the case for Aura 4, which is under development.

fosskers avatar May 14 '22 20:05 fosskers