[ER] guix gc should tell how much space it recovered

  • Done
  • quality assurance status badge
Details
3 participants
  • Andreas Enge
  • Ludovic Courtès
  • Vincent Legoll
Owner
unassigned
Submitted by
Vincent Legoll
Severity
normal

Debbugs page

Vincent Legoll wrote 9 years ago
(address . bug-guix@gnu.org)
CAEwRq=o5Z9e03m+3kKGVfyd=hmRaJgLwEMK8gzZDZ9i8U0GQoQ@mail.gmail.com
It already shows:
note: currently hard linking saves 485.41 MiB

Recovered disk space would nicely complement that.

I could be mentored to do it myself, but I'm very new to guile & guix
;-)

I'd at least require high level directions as to where I should look (in
the code) to graft that functionality.

--
Vincent Legoll
Vincent Legoll wrote 9 years ago
(address . 23979@debbugs.gnu.org)
CAEwRq=opeGzxOQ+4ssndfdE0Ria20FGsGiTYbObzxBon1=SNPw@mail.gmail.com
Looks like I helped myself out of step 1:
this is in guix/scripts/gc.scm if I'm not mistaken

--
Vincent Legoll
Ludovic Courtès wrote 9 years ago
(name . Vincent Legoll)(address . vincent.legoll@gmail.com)(address . 23979@debbugs.gnu.org)
87eg6v0y45.fsf@gnu.org
Vincent Legoll <vincent.legoll@gmail.com> skribis:

Toggle quote (5 lines)
> It already shows:
> note: currently hard linking saves 485.41 MiB
>
> Recovered disk space would nicely complement that.

Indeed.

Toggle quote (3 lines)
> Looks like I helped myself out of step 1:
> this is in guix/scripts/gc.scm if I'm not mistaken

Yep, you’re on the right track!

This code calls the ‘collect-garbage’ procedure, defined in (guix
store). You’ll see that this procedure returns two values, which are
currently ignored: the name of the items that were removed from the
store, and the number of bytes freed.

Your mission, if you accept it, is to change gc.scm to retrieve this
second value and to display it in a human-friendly way. :-)

HTH!

Ludo’.
Andreas Enge wrote 9 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)
20160715151206.GA8436@solar
On Fri, Jul 15, 2016 at 04:33:46PM +0200, Ludovic Courtès wrote:
Toggle quote (5 lines)
> This code calls the ‘collect-garbage’ procedure, defined in (guix
> store). You’ll see that this procedure returns two values, which are
> currently ignored: the name of the items that were removed from the
> store, and the number of bytes freed.

Brutto or netto? Otherwise said, does it take into account the hardlinks
used for deduplication, or does it pretend that every deleted file saves
as much memory as its size indicates?

Andreas
Ludovic Courtès wrote 9 years ago
(name . Andreas Enge)(address . andreas@enge.fr)
87vb06ygoc.fsf@gnu.org
Andreas Enge <andreas@enge.fr> skribis:

Toggle quote (10 lines)
> On Fri, Jul 15, 2016 at 04:33:46PM +0200, Ludovic Courtès wrote:
>> This code calls the ‘collect-garbage’ procedure, defined in (guix
>> store). You’ll see that this procedure returns two values, which are
>> currently ignored: the name of the items that were removed from the
>> store, and the number of bytes freed.
>
> Brutto or netto? Otherwise said, does it take into account the hardlinks
> used for deduplication, or does it pretend that every deleted file saves
> as much memory as its size indicates?

The latter, I think. The actual computation is done by the daemon, in
libstore/gc.cc.

Ludo’.
Vincent Legoll wrote 9 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)
CAEwRq=r7Db_6ze89paueaN8xRaPNH2+ODG3SnNVx+S70qODM0Q@mail.gmail.com
Here is an attempt:


I tried to use call-with-values, but couldn't make it to work so
reverted back to let-values...

To test, I added (guix-gc "-C") at the end of the script and ran "guix
pull && guile gc.scm", looked OK...

--
Vincent Legoll
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 23979@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 23979
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help