guix size should account for hard links in its disk space calculation

  • Open
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Maxim Cournoyer
Severity
normal
M
M
Maxim Cournoyer wrote on 12 May 2019 21:18
(name . bug-guix)(address . bug-guix@gnu.org)
878svbv5v7.fsf@gmail.com
Consider the following operating system declaration:
$ guix size `guix system build robot-framework-system.scm`

gives:

store item total self
/gnu/store/f9fy1b2yf1qxy523732r7z34ymwqz64b-linux-libre-5.1 241.5 241.5 21.8%
/gnu/store/1lcniyxkxkh8g73zvh2gpbccvl6ggna7-locale-2.28 91.8 91.8 8.3%
/gnu/store/zm3188ipzi262s0m8bxm24br77yh9pd8-python-3.7.0 183.0 74.6 6.7%
/gnu/store/h8l1pby3cm6b4fxsfwwr65b4d1hyh6cs-python-3.7.0 183.0 74.6 6.7%
/gnu/store/wqr8rwnwpmag01i6kb0laf62vsqnhrxy-python-3.7.0 183.0 74.6 6.7%
/gnu/store/b7fqhszxl02g6pfm3vw6b3cjz472qrly-python-3.7.0 182.8 74.6 6.7%
[...]

total: 1106.3 MiB

But,

$ guix size `guix system --no-grafts build robot-framework-system.scm`

store item total self
/gnu/store/f9fy1b2yf1qxy523732r7z34ymwqz64b-linux-libre-5.1 241.5 241.5 28.4%
/gnu/store/1lcniyxkxkh8g73zvh2gpbccvl6ggna7-locale-2.28 91.8 91.8 10.8%
/gnu/store/b7fqhszxl02g6pfm3vw6b3cjz472qrly-python-3.7.0 182.8 74.6 8.8%
/gnu/store/ybglr7nfs8v9kpnm8vf4drg3gafnvd15-guile-static-stripped-2.2.4 45.9 45.9 5.4%
total: 851.2 MiB

Conclusion: the size of grafts is added multiple times even though they
should be very light on disk usage given that they are mostly hard links
to the original, ungrafted output.
L
L
Ludovic Courtès wrote on 14 May 2019 10:17
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 35701@debbugs.gnu.org)
877eat30w8.fsf@gnu.org
Salut Maxim,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

Toggle quote (4 lines)
> Conclusion: the size of grafts is added multiple times even though they
> should be very light on disk usage given that they are mostly hard links
> to the original, ungrafted output.

I think there should be an option to take hard links into account, but
it should probably not be done by default. There are cases (e.g., when
using ‘guix pack’ or when evaluating the amount of data that will
actually be transferred over the wire) where you want to know the
“apparent size”, ignoring hard links.

Note that it’s a bit more work to take hard links into account since
currently ‘guix size’ just queries each store item’s size to the
daemon.

Thanks,
Ludo’.
?