all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Ricardo Wurmus <rekado@elephly.net>, Mike Jones <mike@mjones.io>
Cc: Hartmut Goebel <h.goebel@crazy-compilers.com>, help-guix@gnu.org
Subject: Re: Two copies of same library in store after cleaning generations and gc
Date: Fri, 19 Aug 2022 11:06:02 +0200	[thread overview]
Message-ID: <874jy87gcl.fsf@gmail.com> (raw)
In-Reply-To: <87sfls3gkn.fsf@elephly.net>

Hi,

On ven., 19 août 2022 at 08:13, Ricardo Wurmus <rekado@elephly.net> wrote:

> This sounds like grafts working as intended.  Do you also have more than
> one instance of icecat – one using the graft and one without?
>
> (Due to deduplication in /gnu/store this is not as wasteful as it may
> seem.)

Using Guix 8f0d45c,

--8<---------------cut here---------------start------------->8---
$ guix build mesa
/gnu/store/5y054ijr0dqpd6v4wlby9alhbzmha033-mesa-21.3.8-bin
/gnu/store/74ags388lb0xasf7v1h8j9ywj8zrsgv9-mesa-21.3.8

$ guix build mesa --no-grafts
/gnu/store/znvm7i9rgaviwi2841j8gimanif99wl1-mesa-21.3.8-bin
/gnu/store/wdm2s2si8fqsrcd5xpc29ivmpkf20s8d-mesa-21.3.8

$ guix gc --references $(guix build icecat) | grep mesa
/gnu/store/lcqz4q3834bjd3dlc8zsr95mvzz9n006-mesa-21.3.8
--8<---------------cut here---------------end--------------->8---

it can be confusing…  Let examine. :-)



First, let consider mesa referred by icecat.

--8<---------------cut here---------------start------------->8---
$ guix gc --derivers /gnu/store/lcqz4q3834bjd3dlc8zsr95mvzz9n006-mesa-21.3.8
/gnu/store/qqa192m2cx4qrlvhr1dg7vrc49jqa84h-mesa-21.3.8.drv
/gnu/store/y2yxw4zd4p916lby3sibmskdv860zvpa-mesa-21.3.8.drv
--8<---------------cut here---------------end--------------->8---

It means that the both derivations,

        /gnu/store/qqa192m2cx4qrlvhr1dg7vrc49jqa84h-mesa-21.3.8.drv
        /gnu/store/y2yxw4zd4p916lby3sibmskdv860zvpa-mesa-21.3.8.drv

have the same output:

        /gnu/store/lcqz4q3834bjd3dlc8zsr95mvzz9n006-mesa-21.3.8

Yes, that’s surprising but possible.


From /gnu/store/qqa192m2cx4qrlvhr1dg7vrc49jqa84h-mesa-21.3.8.drv, the
guile-builder reads:

--8<---------------cut here---------------start------------->8---
  (define %build-inputs
    (quote
     (("x" . "/gnu/store/wdm2s2si8fqsrcd5xpc29ivmpkf20s8d-mesa-21.3.8")
[...]
       ((old-outputs
         (quote
          (("out" . "/gnu/store/wdm2s2si8fqsrcd5xpc29ivmpkf20s8d-mesa-21.3.8"))))
--8<---------------cut here---------------end--------------->8---

which grafts, I guess.  Note that this derivation lists the other
derivation /gnu/store/0yd0gxbcrkh32zy4q8dkpyyv2xpvm1mh-mesa-21.3.8.drv.

From /gnu/store/y2yxw4zd4p916lby3sibmskdv860zvpa-mesa-21.3.8.drv, the
guile-builder is exactly the same (/gnu/store/a0h343…-mesa-21.3.8-guile-builder).
However, the derivation lists
/gnu/store/ylx0p9sl6qla4qsmp6dsvaqgd7g3m1rw-mesa-21.3.8.drv.

These two derivations,

        /gnu/store/0yd0gxbcrkh32zy4q8dkpyyv2xpvm1mh-mesa-21.3.8.drv
        /gnu/store/ylx0p9sl6qla4qsmp6dsvaqgd7g3m1rw-mesa-21.3.8.drv.

have the same outputs; which reads:

--8<---------------cut here---------------start------------->8---
Derive
([("bin","/gnu/store/znvm7i9rgaviwi2841j8gimanif99wl1-mesa-21.3.8-bin","","")
  ,("out","/gnu/store/wdm2s2si8fqsrcd5xpc29ivmpkf20s8d-mesa-21.3.8","","")]
--8<---------------cut here---------------end--------------->8---

other said, the ungrafted version.  So far, so good!


Second, let consider the grafted build,

--8<---------------cut here---------------start------------->8---
$ guix gc --derivers /gnu/store/74ags388lb0xasf7v1h8j9ywj8zrsgv9-mesa-21.3.8
/gnu/store/ji6h6y5jizwhsx2jzw67myk5fhiv87va-mesa-21.3.8.drv
--8<---------------cut here---------------end--------------->8---

and the guile-builder (/gnu/store/j4j58b…-mesa-21.3.8-guile-builder)
contains,

--8<---------------cut here---------------start------------->8---
  (define %build-inputs
    (quote
     (("x" . "/gnu/store/znvm7i9rgaviwi2841j8gimanif99wl1-mesa-21.3.8-bin")
      ("x" . "/gnu/store/wdm2s2si8fqsrcd5xpc29ivmpkf20s8d-mesa-21.3.8")
[...]
       ((old-outputs
         (quote
          (("bin" . "/gnu/store/znvm7i9rgaviwi2841j8gimanif99wl1-mesa-21.3.8-bin")
           ("out" . "/gnu/store/wdm2s2si8fqsrcd5xpc29ivmpkf20s8d-mesa-21.3.8"))))
--8<---------------cut here---------------end--------------->8---

and that’s why the hash 74ags388lb… (from “guix build mesa”) is
different from lcqz4q383… (from icecat).

This derivation /gnu/store/ji6h6y5jizwhsx2jzw67myk5fhiv87va-mesa-21.3.8.drv
lists the other derivation,
/gnu/store/0yd0gxbcrkh32zy4q8dkpyyv2xpvm1mh-mesa-21.3.8.drv.  Wait, it
has already appeared below. :-)


Well, all seems consistent, isn’t it?  I hope now it is less confusing.


However, something still appears to me confusing:

--8<---------------cut here---------------start------------->8---
$ diff -r --no-dereference /gnu/store/74ags388lb0xasf7v1h8j9ywj8zrsgv9-mesa-21.3.8 /gnu/store/lcqz4q3834bjd3dlc8zsr95mvzz9n006-mesa-21.3.8 
Binary files /gnu/store/74ags388lb0xasf7v1h8j9ywj8zrsgv9-mesa-21.3.8/lib/dri/i830_dri.so and /gnu/store/lcqz4q3834bjd3dlc8zsr95mvzz9n006-mesa-21.3.8/lib/dri/i830_dri.so differ

[...]

diff -r --no-dereference /gnu/store/74ags388lb0xasf7v1h8j9ywj8zrsgv9-mesa-21.3.8/lib/pkgconfig/dri.pc /gnu/store/lcqz4q3834bjd3dlc8zsr95mvzz9n006-mesa-21.3.8/lib/pkgconfig/dri.pc
1c1
< prefix=/gnu/store/74ags388lb0xasf7v1h8j9ywj8zrsgv9-mesa-21.3.8
---
> prefix=/gnu/store/lcqz4q3834bjd3dlc8zsr95mvzz9n006-mesa-21.3.8

[...]
--8<---------------cut here---------------end--------------->8---

Other said, the grafted item is duplicated.  Right?


Therefore, my question is: is deduplication optimal?  Or better worded:
what is the waste by the duplicated grafted items?


Cheers,
simon


  reply	other threads:[~2022-08-19  9:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-14 11:31 Two copies of same library in store after cleaning generations and gc Mike Jones
2022-08-18 12:13 ` Hartmut Goebel
2022-08-18 20:30   ` Mike Jones
2022-08-19  6:13     ` Ricardo Wurmus
2022-08-19  9:06       ` zimoun [this message]
2022-08-19 11:37         ` Mike Jones
2022-08-22 15:49           ` zimoun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874jy87gcl.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=h.goebel@crazy-compilers.com \
    --cc=help-guix@gnu.org \
    --cc=mike@mjones.io \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.