unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#41538] [PATCH] guix scripts: Mention Guix checkouts + gcroots/auto when warning about disk space.
@ 2020-05-26 13:22 Pierre Neidhardt
  2020-05-28 21:27 ` Ludovic Courtès
  2020-05-29 10:14 ` zimoun
  0 siblings, 2 replies; 10+ messages in thread
From: Pierre Neidhardt @ 2020-05-26 13:22 UTC (permalink / raw)
  To: 41538

* 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





^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#41538] [PATCH] guix scripts: Mention Guix checkouts + gcroots/auto when warning about disk space.
  2020-05-26 13:22 [bug#41538] [PATCH] guix scripts: Mention Guix checkouts + gcroots/auto when warning about disk space Pierre Neidhardt
@ 2020-05-28 21:27 ` Ludovic Courtès
  2020-05-29  9:29   ` Pierre Neidhardt
  2020-05-29 10:14 ` zimoun
  1 sibling, 1 reply; 10+ messages in thread
From: Ludovic Courtès @ 2020-05-28 21:27 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 41538

Pierre Neidhardt <mail@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’.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#41538] [PATCH] guix scripts: Mention Guix checkouts + gcroots/auto when warning about disk space.
  2020-05-28 21:27 ` Ludovic Courtès
@ 2020-05-29  9:29   ` Pierre Neidhardt
  2020-05-29 11:56     ` Ludovic Courtès
  0 siblings, 1 reply; 10+ messages in thread
From: Pierre Neidhardt @ 2020-05-29  9:29 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41538

[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]

Ludovic Courtès <ludo@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/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#41538] [PATCH] guix scripts: Mention Guix checkouts + gcroots/auto when warning about disk space.
  2020-05-26 13:22 [bug#41538] [PATCH] guix scripts: Mention Guix checkouts + gcroots/auto when warning about disk space Pierre Neidhardt
  2020-05-28 21:27 ` Ludovic Courtès
@ 2020-05-29 10:14 ` zimoun
  1 sibling, 0 replies; 10+ messages in thread
From: zimoun @ 2020-05-29 10:14 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 41538

Hi Pierre,

On Tue, 26 May 2020 at 15:23, Pierre Neidhardt <mail@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




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#41538] [PATCH] guix scripts: Mention Guix checkouts + gcroots/auto when warning about disk space.
  2020-05-29  9:29   ` Pierre Neidhardt
@ 2020-05-29 11:56     ` Ludovic Courtès
  2020-05-29 16:38       ` Pierre Neidhardt
  0 siblings, 1 reply; 10+ messages in thread
From: Ludovic Courtès @ 2020-05-29 11:56 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 41538

Hi,

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> Ludovic Courtès <ludo@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’.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#41538] [PATCH] guix scripts: Mention Guix checkouts + gcroots/auto when warning about disk space.
  2020-05-29 11:56     ` Ludovic Courtès
@ 2020-05-29 16:38       ` Pierre Neidhardt
  2020-05-29 18:48         ` Marius Bakke
  0 siblings, 1 reply; 10+ messages in thread
From: Pierre Neidhardt @ 2020-05-29 16:38 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41538

[-- Attachment #1: Type: text/plain, Size: 337 bytes --]

Ludovic Courtès <ludo@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/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#41538] [PATCH] guix scripts: Mention Guix checkouts + gcroots/auto when warning about disk space.
  2020-05-29 16:38       ` Pierre Neidhardt
@ 2020-05-29 18:48         ` Marius Bakke
  2020-05-30  9:03           ` Pierre Neidhardt
  0 siblings, 1 reply; 10+ messages in thread
From: Marius Bakke @ 2020-05-29 18:48 UTC (permalink / raw)
  To: Pierre Neidhardt, Ludovic Courtès; +Cc: 41538

[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

Pierre Neidhardt <mail@ambrevar.xyz> writes:

> Ludovic Courtès <ludo@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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#41538] [PATCH] guix scripts: Mention Guix checkouts + gcroots/auto when warning about disk space.
  2020-05-29 18:48         ` Marius Bakke
@ 2020-05-30  9:03           ` Pierre Neidhardt
  2020-05-30 14:05             ` Ludovic Courtès
  0 siblings, 1 reply; 10+ messages in thread
From: Pierre Neidhardt @ 2020-05-30  9:03 UTC (permalink / raw)
  To: Marius Bakke, Ludovic Courtès; +Cc: 41538

[-- Attachment #1: Type: text/plain, Size: 1328 bytes --]

Marius Bakke <marius@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/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#41538] [PATCH] guix scripts: Mention Guix checkouts + gcroots/auto when warning about disk space.
  2020-05-30  9:03           ` Pierre Neidhardt
@ 2020-05-30 14:05             ` Ludovic Courtès
  2020-05-30 15:55               ` Pierre Neidhardt
  0 siblings, 1 reply; 10+ messages in thread
From: Ludovic Courtès @ 2020-05-30 14:05 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 41538, Marius Bakke

Hi,

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> Marius Bakke <marius@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’.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#41538] [PATCH] guix scripts: Mention Guix checkouts + gcroots/auto when warning about disk space.
  2020-05-30 14:05             ` Ludovic Courtès
@ 2020-05-30 15:55               ` Pierre Neidhardt
  0 siblings, 0 replies; 10+ messages in thread
From: Pierre Neidhardt @ 2020-05-30 15:55 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41538, Marius Bakke

[-- Attachment #1: Type: text/plain, Size: 412 bytes --]

Ludovic Courtès <ludo@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/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-05-30 15:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26 13:22 [bug#41538] [PATCH] guix scripts: Mention Guix checkouts + gcroots/auto when warning about disk space Pierre Neidhardt
2020-05-28 21:27 ` Ludovic Courtès
2020-05-29  9:29   ` Pierre Neidhardt
2020-05-29 11:56     ` Ludovic Courtès
2020-05-29 16:38       ` Pierre Neidhardt
2020-05-29 18:48         ` Marius Bakke
2020-05-30  9:03           ` Pierre Neidhardt
2020-05-30 14:05             ` Ludovic Courtès
2020-05-30 15:55               ` Pierre Neidhardt
2020-05-29 10:14 ` zimoun

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).