* bug#35701: guix size should account for hard links in its disk space calculation
@ 2019-05-12 19:18 Maxim Cournoyer
2019-05-14 8:17 ` Ludovic Courtès
0 siblings, 1 reply; 2+ messages in thread
From: Maxim Cournoyer @ 2019-05-12 19:18 UTC (permalink / raw)
To: 35701
[-- Attachment #1: Type: text/plain, Size: 54 bytes --]
Consider the following operating system declaration:
[-- Attachment #2: robot-framework-system.scm --]
[-- Type: application/octet-stream, Size: 2226 bytes --]
;; This is an operating system configuration template for a bare-bone,
;; containerization-friendly setup, with no X11 display server and
;; no Guix daemon / client.
(use-modules (gnu)
(gnu packages bash)
(gnu packages python)
(gnu packages python-xyz)
(gnu packages xml)
(guix packages))
(operating-system
(host-name "robot-framework")
(timezone "America/Montreal")
;; Boot in "legacy" BIOS mode, assuming /dev/sdX is the
;; target hard disk, and "my-root" is the label of the target
;; root file system.
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(target "/dev/sda")))
(file-systems (cons (file-system
(device (file-system-label "my-root"))
(mount-point "/")
(type "ext4"))
%base-file-systems))
(users (cons (user-account
(name "builder")
(group "users")
(supplementary-groups '("wheel"))
(home-directory "/home/builder"))
%base-user-accounts))
;; Globally-installed packages.
(packages (cons* python-wrapper
(list python "tk")
python-robotframework
python-robotframework-sshlibrary
python-robotframework-lint
python-xmltodict
%base-packages))
(services (list
;; Enable #!/bin/sh and #!/bin/bash shebangs.
(service special-files-service-type
`(("/bin/bash" ,(file-append (canonical-package bash)
"/bin/bash"))))
(service special-files-service-type
`(("/bin/sh" ,(file-append (canonical-package bash)
"/bin/sh"))))
;; The following is a very small subset extracted of
;; %base-services.
(service login-service-type)
(service udev-service-type (udev-configuration))
(syslog-service)))
;; When using sudo, by default some environment variables such as
;; PYTHONPATH are dropped. Make it so that any environment
;; variables are honored. This is important so that the Guix system
;; profile can work correctly for any user.
(sudoers-file (plain-file "sudoers" "\
root ALL=(ALL) ALL
%wheel ALL=(ALL) ALL
Defaults !env_reset,!env_delete\n")))
[-- Attachment #3: Type: text/plain, Size: 1416 bytes --]
$ 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#35701: guix size should account for hard links in its disk space calculation
2019-05-12 19:18 bug#35701: guix size should account for hard links in its disk space calculation Maxim Cournoyer
@ 2019-05-14 8:17 ` Ludovic Courtès
0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2019-05-14 8:17 UTC (permalink / raw)
To: Maxim Cournoyer; +Cc: 35701
Salut Maxim,
Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
> 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’.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-14 8:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-12 19:18 bug#35701: guix size should account for hard links in its disk space calculation Maxim Cournoyer
2019-05-14 8:17 ` Ludovic Courtès
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).