GNU bug report logs - #41538
[PATCH] guix scripts: Mention Guix checkouts + gcroots/auto when warning about disk space.

Previous Next

Package: guix-patches;

Reported by: Pierre Neidhardt <mail <at> ambrevar.xyz>

Date: Tue, 26 May 2020 13:23:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 41538 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#41538; Package guix-patches. (Tue, 26 May 2020 13:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pierre Neidhardt <mail <at> ambrevar.xyz>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 26 May 2020 13:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: guix-patches <at> gnu.org
Subject: [PATCH] guix scripts: Mention Guix checkouts + gcroots/auto when
 warning about disk space.
Date: Tue, 26 May 2020 15:22:19 +0200
* guix/scripts.scm (warn-about-disk-space): Mention Guix checkouts, system profiles and
gcroots/auto.
---
 guix/scripts.scm | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/guix/scripts.scm b/guix/scripts.scm
index 3e19e38957..c90c3b840c 100644
--- a/guix/scripts.scm
+++ b/guix/scripts.scm
@@ -241,11 +241,23 @@ THRESHOLDS is a pair (ABSOLUTE-THRESHOLD . RELATIVE-THRESHOLD)."
                             absolute-threshold-in-bytes))
       (warning (G_ "only ~,1f GiB of free space available on ~a~%")
                (/ available 1. GiB) (%store-prefix))
-      (display-hint (format #f (G_ "Consider deleting old profile
-generations and collecting garbage, along these lines:
+      (if profile
+          (display-hint (format #f (G_ "Consider deleting old profile
+generations, deleting old Guix checkouts and collecting garbage, along these
+lines:
 
 @example
-guix gc --delete-generations=1m
-@end example\n"))))))
+guix package --profile=~s --delete-generations=1m
+guix pull --delete-generations=20d # Guix checkouts
+guix system delete-generations=2..9 # System generations
+guix gc --free-space=5G
+@end example
+
+You might also want to delete old non-default profiles pointed to by
+the symlinks in /var/guix/gcroots/auto (broken symlinks in this
+directory will be automatically removed).")
+                                profile))
+          (display-hint (G_ "Consider running @command{guix gc} to free
+space."))))))
 
 ;;; scripts.scm ends here
-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#41538; Package guix-patches. (Thu, 28 May 2020 21:28:01 GMT) Full text and rfc822 format available.

Message #8 received at 41538 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 41538 <at> debbugs.gnu.org
Subject: Re: [bug#41538] [PATCH] guix scripts: Mention Guix checkouts +
 gcroots/auto when warning about disk space.
Date: Thu, 28 May 2020 23:27:13 +0200
Pierre Neidhardt <mail <at> ambrevar.xyz> skribis:

> * guix/scripts.scm (warn-about-disk-space): Mention Guix checkouts, system profiles and
> gcroots/auto.

[...]

> -      (display-hint (format #f (G_ "Consider deleting old profile
> -generations and collecting garbage, along these lines:
> +      (if profile
> +          (display-hint (format #f (G_ "Consider deleting old profile
> +generations, deleting old Guix checkouts and collecting garbage, along these
> +lines:
>  
>  @example
> -guix gc --delete-generations=1m
> -@end example\n"))))))
> +guix package --profile=~s --delete-generations=1m
> +guix pull --delete-generations=20d # Guix checkouts
> +guix system delete-generations=2..9 # System generations
> +guix gc --free-space=5G
> +@end example

‘guix gc --delete-generations=1m’ deletes generations of both
~/.guix-profile and ~/.config/guix/current.  (When running as root it
does that for all the users.)

I would not recommend ‘guix system delete-generations’ here because it’s
only accessible to root.

> +You might also want to delete old non-default profiles pointed to by
> +the symlinks in /var/guix/gcroots/auto (broken symlinks in this
> +directory will be automatically removed).")

IMO hints should remain concise, and I’m afraid this might be too much.
Also, /var/guix/gcroots/auto is an implementation detail; I’d recommend
running ‘guix package --list-profiles’ instead.

WDYT?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#41538; Package guix-patches. (Fri, 29 May 2020 09:30:02 GMT) Full text and rfc822 format available.

Message #11 received at 41538 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 41538 <at> debbugs.gnu.org
Subject: Re: [bug#41538] [PATCH] guix scripts: Mention Guix checkouts +
 gcroots/auto when warning about disk space.
Date: Fri, 29 May 2020 11:29:01 +0200
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> ‘guix gc --delete-generations=1m’ deletes generations of both
> ~/.guix-profile and ~/.config/guix/current.  (When running as root it
> does that for all the users.)

Today I learned something! :)

> I would not recommend ‘guix system delete-generations’ here because it’s
> only accessible to root.

I still find it a useful tip because system generations may eat up a lot
of space and are easily forgotten.

What about adding "if you have root privileges"?

>> +You might also want to delete old non-default profiles pointed to by
>> +the symlinks in /var/guix/gcroots/auto (broken symlinks in this
>> +directory will be automatically removed).")
>
> IMO hints should remain concise, and I’m afraid this might be too much.
> Also, /var/guix/gcroots/auto is an implementation detail; I’d recommend
> running ‘guix package --list-profiles’ instead.

Good point.  What about this then?

--8<---------------cut here---------------start------------->8---
You might also want to delete old non-default profiles returned by `guix
package --list-profiles`.
--8<---------------cut here---------------end--------------->8---

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#41538; Package guix-patches. (Fri, 29 May 2020 10:15:01 GMT) Full text and rfc822 format available.

Message #14 received at 41538 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 41538 <at> debbugs.gnu.org
Subject: Re: [bug#41538] [PATCH] guix scripts: Mention Guix checkouts +
 gcroots/auto when warning about disk space.
Date: Fri, 29 May 2020 12:14:12 +0200
Hi Pierre,

On Tue, 26 May 2020 at 15:23, Pierre Neidhardt <mail <at> ambrevar.xyz> wrote:

> +          (display-hint (format #f (G_ "Consider deleting old profile
> +generations, deleting old Guix checkouts and collecting garbage, along these
> +lines:

[...]

> +guix pull --delete-generations=20d # Guix checkouts

What do you mean by "checkouts"?

I understand delete old stuff under "~/.cache/guix/checkouts"; which
is not what you mean, I guess.

You mean "self Guix generations" or something like that, right?


Cheers,
simon




Information forwarded to guix-patches <at> gnu.org:
bug#41538; Package guix-patches. (Fri, 29 May 2020 11:57:01 GMT) Full text and rfc822 format available.

Message #17 received at 41538 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 41538 <at> debbugs.gnu.org
Subject: Re: [bug#41538] [PATCH] guix scripts: Mention Guix checkouts +
 gcroots/auto when warning about disk space.
Date: Fri, 29 May 2020 13:56:19 +0200
Hi,

Pierre Neidhardt <mail <at> ambrevar.xyz> skribis:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>> ‘guix gc --delete-generations=1m’ deletes generations of both
>> ~/.guix-profile and ~/.config/guix/current.  (When running as root it
>> does that for all the users.)
>
> Today I learned something! :)
>
>> I would not recommend ‘guix system delete-generations’ here because it’s
>> only accessible to root.
>
> I still find it a useful tip because system generations may eat up a lot
> of space and are easily forgotten.
>
> What about adding "if you have root privileges"?

We could do that, but again people on “foreign distros” etc. could be
confused and overwhelmed.  I’d lean towards keeping it concise.

>>> +You might also want to delete old non-default profiles pointed to by
>>> +the symlinks in /var/guix/gcroots/auto (broken symlinks in this
>>> +directory will be automatically removed).")
>>
>> IMO hints should remain concise, and I’m afraid this might be too much.
>> Also, /var/guix/gcroots/auto is an implementation detail; I’d recommend
>> running ‘guix package --list-profiles’ instead.
>
> Good point.  What about this then?
>
> You might also want to delete old non-default profiles returned by `guix
> package --list-profiles`.

SGTM!  (Use @command markup in the actual hint.)

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#41538; Package guix-patches. (Fri, 29 May 2020 16:39:03 GMT) Full text and rfc822 format available.

Message #20 received at 41538 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 41538 <at> debbugs.gnu.org
Subject: Re: [bug#41538] [PATCH] guix scripts: Mention Guix checkouts +
 gcroots/auto when warning about disk space.
Date: Fri, 29 May 2020 18:38:13 +0200
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

>> What about adding "if you have root privileges"?
>
> We could do that, but again people on “foreign distros” etc. could be
> confused and overwhelmed.  I’d lean towards keeping it concise.

So what about "# if it applies" instead?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#41538; Package guix-patches. (Fri, 29 May 2020 18:50:02 GMT) Full text and rfc822 format available.

Message #23 received at 41538 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <marius <at> gnu.org>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>, Ludovic Courtès
 <ludo <at> gnu.org>
Cc: 41538 <at> debbugs.gnu.org
Subject: Re: [bug#41538] [PATCH] guix scripts: Mention Guix checkouts +
 gcroots/auto when warning about disk space.
Date: Fri, 29 May 2020 20:48:58 +0200
[Message part 1 (text/plain, inline)]
Pierre Neidhardt <mail <at> ambrevar.xyz> writes:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>>> What about adding "if you have root privileges"?
>>
>> We could do that, but again people on “foreign distros” etc. could be
>> confused and overwhelmed.  I’d lean towards keeping it concise.
>
> So what about "# if it applies" instead?

I think newbie users might not know whether it applies or not.  Given
that 'guix gc --delete-generations' removes old generations of _all_
user profiles, perhaps we can just keep that instead of listing each of
the various ways to --delete-generations?

It looks a bit overwhelming to have to do all that just to make some
space in the store, especially when there is a single command to do all
of them.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#41538; Package guix-patches. (Sat, 30 May 2020 09:04:02 GMT) Full text and rfc822 format available.

Message #26 received at 41538 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Marius Bakke <marius <at> gnu.org>, Ludovic Courtès
 <ludo <at> gnu.org>
Cc: 41538 <at> debbugs.gnu.org
Subject: Re: [bug#41538] [PATCH] guix scripts: Mention Guix checkouts +
 gcroots/auto when warning about disk space.
Date: Sat, 30 May 2020 11:03:28 +0200
[Message part 1 (text/plain, inline)]
Marius Bakke <marius <at> gnu.org> writes:

> I think newbie users might not know whether it applies or not.  Given
> that 'guix gc --delete-generations' removes old generations of _all_
> user profiles, perhaps we can just keep that instead of listing each of
> the various ways to --delete-generations?

I think this is not just about newbie users, but also a reminder of
the full list of what you have to go through to clean up your system
(including system profiles which take up a lot of space).
I've used Guix for a while now and I still frequently forget to clean up
either one of these profiles: Guix, default, non-defaults, system.

I think it's fine if the list has 4 items instead of 1: if the newcomer
does not understand everything, they'll move on.  Once they do
understand, they will be properly reminded to do it.

> It looks a bit overwhelming to have to do all that just to make some
> space in the store, especially when there is a single command to do all
> of them.

Does

  sudo guix gc --delete-duration=DURATION

delete all profiles including system profiles and non-default profiles?
If so, then it's fine but:

1. The user might not want to delete profiles of other users.
2. It requires root privileges.

Thoughts?

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#41538; Package guix-patches. (Sat, 30 May 2020 14:07:01 GMT) Full text and rfc822 format available.

Message #29 received at 41538 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 41538 <at> debbugs.gnu.org, Marius Bakke <marius <at> gnu.org>
Subject: Re: [bug#41538] [PATCH] guix scripts: Mention Guix checkouts +
 gcroots/auto when warning about disk space.
Date: Sat, 30 May 2020 16:05:46 +0200
Hi,

Pierre Neidhardt <mail <at> ambrevar.xyz> skribis:

> Marius Bakke <marius <at> gnu.org> writes:
>
>> I think newbie users might not know whether it applies or not.  Given
>> that 'guix gc --delete-generations' removes old generations of _all_
>> user profiles, perhaps we can just keep that instead of listing each of
>> the various ways to --delete-generations?
>
> I think this is not just about newbie users, but also a reminder of
> the full list of what you have to go through to clean up your system
> (including system profiles which take up a lot of space).
> I've used Guix for a while now and I still frequently forget to clean up
> either one of these profiles: Guix, default, non-defaults, system.
>
> I think it's fine if the list has 4 items instead of 1: if the newcomer
> does not understand everything, they'll move on.  Once they do
> understand, they will be properly reminded to do it.

I checked (guix scripts gc).  ‘guix gc -d’ operates on all the profiles
among the roots returned by ‘gc-roots’.  This is the same as what ‘guix
package --list-profiles’ returns so it includes non-standard profiles.
You can check on your machine.

It does not include non-profile GC roots, and in particular it does not
include system generations.

Deleting a system generation involves reinstalling the bootloader (or
its config file), so it cannot be done from ‘guix gc’, at least in its
current state.

In short, ‘guix gc -d’ was introduced precisely so that one doesn’t have
to search for all the profiles, and this hint was added in the same
patch series I think.  (So my earlier advice to mention ‘guix package
--list-profiles’ in the hint was actually misguided.)

The only things not handled are (1) the system, and (2) non-profile GC
roots.  I think it’s OK to not mention them in the hint because these
are kinda “advanced” features.

Thoughts?

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#41538; Package guix-patches. (Sat, 30 May 2020 15:57:02 GMT) Full text and rfc822 format available.

Message #32 received at 41538 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 41538 <at> debbugs.gnu.org, Marius Bakke <marius <at> gnu.org>
Subject: Re: [bug#41538] [PATCH] guix scripts: Mention Guix checkouts +
 gcroots/auto when warning about disk space.
Date: Sat, 30 May 2020 17:55:55 +0200
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> The only things not handled are (1) the system, and (2) non-profile GC
> roots.  I think it’s OK to not mention them in the hint because these
> are kinda “advanced” features.

Do we have a place where we recommend how to clean up the store?
I'm not sure we ever explain how to remove non-profile GC roots.

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 3 years and 303 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.