From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: guix size Date: Thu, 18 Jun 2015 09:08:27 +0200 Message-ID: <87egl9sdck.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5Tw7-0008GS-KC for guix-devel@gnu.org; Thu, 18 Jun 2015 03:08:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5Tw6-0003Sq-6T for guix-devel@gnu.org; Thu, 18 Jun 2015 03:08:31 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:56005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5Tw6-0003Sm-3j for guix-devel@gnu.org; Thu, 18 Jun 2015 03:08:30 -0400 Received: from pluto.bordeaux.inria.fr ([193.50.110.57]:40241 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1Z5Tw5-0000hp-Jb for guix-devel@gnu.org; Thu, 18 Jun 2015 03:08:29 -0400 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Guix-devel Hello! Commit fcc58db adds a new =E2=80=98guix size=E2=80=99 command (I=E2=80=99ve= copied the documentation below.) I encourage you to give it a try, it=E2=80=99s quite insightful. For insta= nce: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix size ardour substitute: updating list of substitutes from 'http://hydra.gnu.org'... 100= .0% store item total s= elf /gnu/store/sykhf0d7ya15n1a96v6kra4x7qlv0q14-ardour-4.0 1901.6 = 73.3 3.9% /gnu/store/2pxds860wayj2i5l8lamnbrmw95vq5df-suil-0.8.2 1558.5 = 0.1 0.0% /gnu/store/c51q9ch9f8bpmp8xacsx3sjazhqj5m3n-qt-4.8.7 1152.5 = 150.2 7.9% /gnu/store/474fjgir7pzs5d2i7djmxrbyq6l801bw-gtkmm-2.24.4 791.0 = 9.2 0.5% /gnu/store/pbl6nlnfxc56qa36ssqig5rm8vqarqgq-gtk+-2.24.28 773.0 = 35.6 1.9% /gnu/store/x7g63pla2bi0hahmg2ryvqvk3y5as2dc-cups-2.0.3 571.0 = 11.9 0.6% /gnu/store/w9czy5s229aqninhk17vn1sfdjbwy4hs-cups-filters-1.0.68 555.8 = 8.7 0.5% /gnu/store/mw87a68k0mha162nw1g9691bacjx0hwx-mysql-5.6.25 451.6 = 176.2 9.3% [...] /gnu/store/vp4vgmj8qbyrj78y4lqp8wqidaywcjwr-qt-4.8.7-doc 290.6 = 290.6 15.3% /gnu/store/z7zjz3b1i5sbsx9kc1wy591dh69f7yd6-python-2.7.6 289.0 = 72.7 3.8% [...] /gnu/store/898yznjcrl22qhwd98v3jg8gvq1aqsk8-linux-libre-headers-3.14.37 = 95.2 3.4 0.2% /gnu/store/cy7bp1l37q3f9p3llqkzanxx5lc7d1h0-glib-2.44.0 94.8 = 13.9 0.7% /gnu/store/9k4618lnyczns5mjk3xrab72h650cwy3-libxft-2.3.2 92.2 = 0.2 0.0% /gnu/store/5gi1bhrrfiipk5sxlasymnfvklzfcv0i-bootstrap-binaries-0 91.9 = 91.9 4.8% [...] --8<---------------cut here---------------end--------------->8--- That=E2=80=99s 1.9 GiB for the closure of Ardour 4, 15% of which is taken b= y the Qt documentation (this specific issue seems non trivial to fix, though.) MySQL alone is clearly taking too much space (176 MiB), and the closure of Python is too big (289 MiB). Lastly, we end up pulling the bootstrap binaries here, which should never happen (I believe this is fixed by b15389e in core-updates.) Feedback welcome! Ludo=E2=80=99. The =E2=80=98guix size=E2=80=99 command helps package developers profile th= e disk usage of packages. It is easy to overlook the impact of an additional dependency added to a package, or the impact of using a single output for a package that could easily be split (*note Packages with Multiple Outputs::). These are the typical issues that =E2=80=98guix size=E2=80=99 = can highlight. The command can be passed a package specification such as =E2=80=98gcc-4= .8=E2=80=99 or =E2=80=98guile:debug=E2=80=99, or a file name in the store. Consider th= is example: $ guix size coreutils store item total self /gnu/store/=E2=80=A6-coreutils-8.23 70.0 13.9 19.8% /gnu/store/=E2=80=A6-gmp-6.0.0a 55.3 2.5 3.6% /gnu/store/=E2=80=A6-acl-2.2.52 53.7 0.5 0.7% /gnu/store/=E2=80=A6-attr-2.4.46 53.2 0.3 0.5% /gnu/store/=E2=80=A6-gcc-4.8.4-lib 52.9 15.7 22.4% /gnu/store/=E2=80=A6-glibc-2.21 37.2 37.2 53.1% The store items listed here constitute the "transitive closure" of Coreutils=E2=80=94i.e., Coreutils and all its dependencies, recursively=E2= =80=94as would be returned by: $ guix gc -R /gnu/store/=E2=80=A6-coreutils-8.23 Here the output shows 3 columns next to store items. The first column, labeled =E2=80=9Ctotal=E2=80=9D, shows the size in mebibytes (MiB) = of the closure of the store item=E2=80=94that is, its own size plus the size of al= l its dependencies. The next column, labeled =E2=80=9Cself=E2=80=9D, shows the s= ize of the item itself. The last column shows the ratio of the item=E2=80=99s size to= the space occupied by all the items listed here. In this example, we see that the closure of Coreutils weighs in at 70 MiB, half of which is taken by libc. (That libc represents a large fraction of the closure is not a problem per se because it is always available on the system anyway.) When the package passed to =E2=80=98guix size=E2=80=99 is available in t= he store, =E2=80=98guix size=E2=80=99 queries the daemon to determine its dependencie= s, and measures its size in the store, similar to =E2=80=98du -ms --apparent-size= =E2=80=99 (*note (coreutils)du invocation::). When the given package is _not_ in the store, =E2=80=98guix size=E2=80= =99 reports information based on information about the available substitutes (*note Substitutes::). This allows it to profile disk usage of store items that are not even on disk, only available remotely. A single option is available: =E2=80=98--system=3DSYSTEM=E2=80=99 =E2=80=98-s SYSTEM=E2=80=99 Consider packages for SYSTEM=E2=80=94e.g., =E2=80=98x86_64-linux=E2=80= =99.