[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Two copies of same library in store after cleaning generations and g
From: |
zimoun |
Subject: |
Re: Two copies of same library in store after cleaning generations and gc |
Date: |
Fri, 19 Aug 2022 11:06:02 +0200 |
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