Subject: Re: bug#52805: [PATCH] substitute: Add a ‘--clear-cache’ option.

From: Tobias Geerinckx-Rice <[email-masked]>
Date: Mon, 27 Dec 2021 22:20:16 +0100

Hi Mathieu,

Thanks for the review!

Mathieu Othacehe 写道：
> This script is invoked by the daemon as root. In that context,
> %narinfo-cache-directory is "/var/guix/substitute/cache", 
> whereas when
> run as an user it is likely: "~/.cache/guix/substitute".

Correct.

> That would mean that users need to run "sudo guix substitute
> --clear-cache".

If they want to clear /var instead of ~/.cache, sure.

That sounds like a sane interface, if clearing ‘root’'s cache were 
the intention?  How would you even do that without sudo, 
privilege-wise?

> Moreover this script is an internal undocumented tool,
> so I'm not in favor of adding user commands to it.

OK.

The point was to have a little command I could ask other users to 
run, that's guaranteed to clear the correct directory, and doesn't 
involve a spooky rm (which saves some back-and-forth :-).

> Maybe "guix gc" would be a better place?

No, I'd rather not add yet another option to ‘guix gc’ that has 
nothing to do with GC.

Kind regards,

T G-R