Re: About /var/guix/profiles and guix pull generations
On 2018-12-25 19:49, Pierre Neidhardt wrote: Why duplicate lines here? They are not duplicated, the arguments are +profile +(string-append (config-directory #:ensure? #f) "/current"))) so one is for the user profile, one is for the Guix "checkout". : +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 : +(string-append (config-directory #:ensure? #f) "/current"))) I think this is quite long and I don't understand your phrase about broken symlinks. In /var/guix/gcroots/auto, you'll find symlinks to custom profiles, e.g. ~/.my-guix-profile. If you remove ~/.my-guix-profile, then the symlink in /var/guix/gcroots/auto will be broken and automatically removed by Guix. Makes sense? Can you suggest a better phrasing? Could you write a new section "Freeing up space in GuixSD" in the manual instead and refer to that here instead? That could be a good solution indeed. What do you people think? I already sent a patch for the manual on Marks suggestion regarding free space. See https://lists.gnu.org/archive/html/guix-patches/2018-11/msg00243.html You are welcome to adopt it if you think it can make it into the manual that way. At that time I did not know about these stale checkouts you are referring to. I think guix should generally clean up after itself and be very clear about what factors cause it to consume space. -- Cheers Swedebugia
Re: About /var/guix/profiles and guix pull generations
Hi :) On 2018-12-19 17:49, Pierre Neidhardt wrote: snip (display-hint (format #f (G_ "Consider deleting old profile -generations and collecting garbage, along these lines: +generations, deleting old Guix checkouts and collecting garbage, along these +lines: @example -guix package -p ~s --delete-generations=1m -guix gc -@end example\n") -profile)) +guix package --profile=~s --delete-generations=1m +guix package --profile=~s --delete-generations=1m Why duplicate lines here? +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 +(string-append (config-directory #:ensure? #f) "/current"))) I think this is quite long and I don't understand your phrase about broken symlinks. Could you write a new section "Freeing up space in GuixSD" in the manual instead and refer to that here instead? -- Cheers Swedebugia
Re: About /var/guix/profiles and guix pull generations
> I think we're still waiting for Pierre to send his latest patch. If the > text really is too long, perhaps we can provide concrete examples, a > sentence explaining what they do, and a link to the manual, where we put > the slightly more verbose explanation. I think the text so far is OK, > but I also have not seen the final version yet. Pierre, what do you > think? I'll re-send the patch just now. -- Pierre Neidhardt https://ambrevar.xyz/ signature.asc Description: PGP signature
Re: About /var/guix/profiles and guix pull generations
Agreed "checkout" is not very precise, but can anyone come up with a better term? -- Pierre Neidhardt https://ambrevar.xyz/ signature.asc Description: PGP signature
Re: About /var/guix/profiles and guix pull generations
Pierre Neidhardt writes: >> OK. Since that example deletes profile generations, Can we just say >> "profile generations" instead of "checkouts"? The latter makes me think >> of a Git repository checkout. Maybe the phrase "cleaning up old >> profiles" would be good enough, since we put a clear example right after >> the sentence. I wouldn't mind either way, as long as we avoid using the >> term "checkout" to refer to profiles and their generations. > > You might have misunderstood the example. There are two calls to > =--delete-generations=, which delete _both_ the user profile generations and > the > Guix checkout/build/copy generations. When you say the Guix checkout, you're referring to the contents of ~/.config/guix/current, right? It's been a little while since I peeked at that, but I believe that profile and its generations contain not only the currently installed Guix (in pre-compiled form), but also any channels the user has installed (also in pre-compiled form). Since it is not simply a Git checkout of either Guix or the channels, I'm not sure that "checkout" is the right term. But if you still think that "checkout" is easier to understand, then I would be okay with that. I feel like I am already bike-shedding, and I do not want to do that. -- Chris signature.asc Description: PGP signature
Re: About /var/guix/profiles and guix pull generations
Hi Pierre, Thank you for your patience! Pierre Neidhardt writes: >> I'm not sure what you mean by "Guix checkouts". Do you mean a Git >> checkout of Guix's Git repository? If so, why would deleting it help? > > Well, I meant what I wrote in the example below OK. Since that example deletes profile generations, Can we just say "profile generations" instead of "checkouts"? The latter makes me think of a Git repository checkout. Maybe the phrase "cleaning up old profiles" would be good enough, since we put a clear example right after the sentence. I wouldn't mind either way, as long as we avoid using the term "checkout" to refer to profiles and their generations. >> guix package --profile=~s --delete-generations=1m >> ... >> (string-append (config-directory #:ensure? #f) "/current") > > It deletes the old ~/.config/guix/ profiles. If I'm not wrong, each of those > profiles consume a couple of 100MBs. > > So if "checkout" is confusing, what about "Guix copy" instead? > > See "(guix) Invoking guix pull" in the manual for terminology. > >> "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)." > > I like it better! I'll use your suggestion. OK! Could you submit a new patch? Thank you for helping to improve the "user experience"! -- Chris signature.asc Description: PGP signature
Re: About /var/guix/profiles and guix pull generations
Ping? -- Pierre Neidhardt https://ambrevar.xyz/ signature.asc Description: PGP signature
Re: About /var/guix/profiles and guix pull generations
> I'm not sure what you mean by "Guix checkouts". Do you mean a Git > checkout of Guix's Git repository? If so, why would deleting it help? Well, I meant what I wrote in the example below > guix package --profile=~s --delete-generations=1m > ... > (string-append (config-directory #:ensure? #f) "/current") It deletes the old ~/.config/guix/ profiles. If I'm not wrong, each of those profiles consume a couple of 100MBs. So if "checkout" is confusing, what about "Guix copy" instead? See "(guix) Invoking guix pull" in the manual for terminology. > "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)." I like it better! I'll use your suggestion. -- Pierre Neidhardt https://ambrevar.xyz/ signature.asc Description: PGP signature
Re: About /var/guix/profiles and guix pull generations
Hi Pierre, Awesome, thank you for the patch! Pierre Neidhardt writes: > -generations and collecting garbage, along these lines: > +generations, deleting old Guix checkouts and collecting garbage, along these > +lines: I'm not sure what you mean by "Guix checkouts". Do you mean a Git checkout of Guix's Git repository? If so, why would deleting it help? > @example > -guix package -p ~s --delete-generations=1m > -guix gc > -@end example\n") > -profile)) > +guix package --profile=~s --delete-generations=1m > +guix package --profile=~s --delete-generations=1m > +guix gc --free-space=5G > +@end example This part seems reasonable to me. We might also mention that others users may have default profiles of their own. Something like: "If there are multiple users of Guix on this system, you might want to repeat these commands for each user." > +You might also want to delete old non-default profiles in > +/var/guix/gcroots/auto.") This is a little tricky. This might make people think they should delete the links directly from /var/guix/gcroots/auto. For example, if you create a profile at /tmp/myprofile via guix package --profile=/tmp/myprofile -i coreutils you will get the following symlink structure: --8<---cut here---start->8--- [0] marusich@garuda.local:~/guix $ ls -al /tmp/myprofile* lrwxrwxrwx 1 marusich users 16 Dec 9 13:56 /tmp/myprofile -> myprofile-1-link lrwxrwxrwx 1 marusich users 51 Dec 9 13:56 /tmp/myprofile-1-link -> /gnu/store/l4vnx2fpi0b090bg7prjbq5hzlb3skpg-profile [0] marusich@garuda.local:~/guix $ ls -al /var/guix/gcroots/auto | grep myprofile lrwxrwxrwx 1 root root 21 Dec 9 13:56 f2j55vpd15brhsqdwjzshwcxid1g8q9q -> /tmp/myprofile-1-link [0] marusich@garuda.local:~/guix $ --8<---cut here---end--->8--- If you delete /var/guix/gcroots/auto/f2j55vpd15brhsqdwjzshwcxid1g8q9q, liveness no longer flows through /tmp/myprofile-1-link because you've removed the GC root, and the guix-daemon won't know about the profile in /tmp. However, the profile is still there! You can still use coreutils via /tmp/myprofile-1-link, even though coreutils might get garbage collected. That isn't good. In the case of a non-default profile like /tmp/myprofile, it's safe to remove /tmp/myprofile and /tmp/myprofile-1-link directly (e.g., via "rm /tmp/myprofile*"). When guix-daemon next runs GC, it will notice that /var/guix/gcroots/auto/f2j55vpd15brhsqdwjzshwcxid1g8q9q is now broken, and it will remove the broken symlink. Maybe we could change "You might also want to delete old non-default profiles in /var/guix/gcroots/auto." to "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)." What do you think? I know I tend to write more verbose error messages, but I just don't want to encourage people to shoot themselves in the foot. If you can think of a better way to convey the message, that'd be great. Maybe we should just say "don't delete the symlinks in the auto directory"? -- Chris signature.asc Description: PGP signature
Re: About /var/guix/profiles and guix pull generations
And here is my proposed patch. It's such a little thing, I'm posting here for context, I'll merge if no one is opposed to it. From 56e88c25d7b327cd7aaee295b334280417f28aba Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sun, 9 Dec 2018 14:33:17 +0100 Subject: [PATCH] guix scripts: Mention Guix checkouts + gcroots/auto when warning about disk space. * guix/scripts.scm (warn-about-disk-space): Mention Guix checkouts and gcroots/auto. --- guix/scripts.scm | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/guix/scripts.scm b/guix/scripts.scm index 5e20ecd92..e85da99a3 100644 --- a/guix/scripts.scm +++ b/guix/scripts.scm @@ -212,13 +212,19 @@ available." (* ratio 100) (%store-prefix)) (if profile (display-hint (format #f (G_ "Consider deleting old profile -generations and collecting garbage, along these lines: +generations, deleting old Guix checkouts and collecting garbage, along these +lines: @example -guix package -p ~s --delete-generations=1m -guix gc -@end example\n") -profile)) +guix package --profile=~s --delete-generations=1m +guix package --profile=~s --delete-generations=1m +guix gc --free-space=5G +@end example + +You might also want to delete old non-default profiles in +/var/guix/gcroots/auto.") +profile +(string-append (config-directory #:ensure? #f) "/current"))) (display-hint (G_ "Consider running @command{guix gc} to free space.")) -- 2.19.2 -- Pierre Neidhardt https://ambrevar.xyz/ signature.asc Description: PGP signature
Re: About /var/guix/profiles and guix pull generations
I'll send a patch then. -- Pierre Neidhardt https://ambrevar.xyz/ signature.asc Description: PGP signature
Re: About /var/guix/profiles and guix pull generations
Thanks for your feedback, Chris! -- Pierre Neidhardt https://ambrevar.xyz/ signature.asc Description: PGP signature
Re: About /var/guix/profiles and guix pull generations
Pierre Neidhardt writes: > I wonder if we should not document this more. Maybe have "guix" display > extensive information about the profiles in /var/guix/profiles? > When the guix store runs low on disk space, Guix currently suggests to > run "guix gc" and all. I think we should suggest the above command and > to check for other GC rotos in /var/guix/profiles. I think if Guix has germane things to say, it might as well say them. Maybe you could submit a patch? Note that in addition to the profiles found in /var/guix/profiles, there are other GC roots to consider. For example, if you create a profile via "guix package -i coreutils -p /tmp/profile", you'll find a symlink in /var/guix/gcroots/auto/ which points to it. Presumably, a user would keep track of the profiles they have installed. However, it can get confusing, so if Guix can help point things out, that might be useful. > Finally, do I need /var/guix/profiles/per-user/root at all? Is it safe to > remove? Does anything use the software installed in it? If not, then you can probably get rid of it. I don't think the root profile is "special"; I think it's just like any other user's profile. But if you don't know whether it's being used, then perhaps it's safest just to leave it be. This is especially true if, for example, there is no software installed in the profile. -- Chris signature.asc Description: PGP signature