unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Inherit, rewrite: different binaries?
@ 2020-09-30 19:43 zimoun
  2020-09-30 20:27 ` Tobias Geerinckx-Rice
  0 siblings, 1 reply; 3+ messages in thread
From: zimoun @ 2020-09-30 19:43 UTC (permalink / raw)
  To: guix-devel

Dear,

Let consider this trivial package definitions:

--8<---------------cut here---------------start------------->8---
(define-module (foo)
  #:use-module (guix packages)
  #:use-module (gnu packages base))

(define-public hello-bis
  (package
    (inherit hello)
    (name "hello-bis")))

(define-public hello-ter
  ((package-input-rewriting '()
                            (lambda (name)
                              "hello-ter")
                            #:deep? #f)
   hello))
--8<---------------cut here---------------end--------------->8---

Somehow, the 3 packages ’hello’, ’hello-bis’ and ’hello-ter’ are the
same.

Using Guix 04a459a069155a6b676b6b93d7dbddb426dd0679, the binaries do not
seem the same:

--8<---------------cut here---------------start------------->8---
$ for h in hello hello-bis hello-ter; do md5sum $(guix build -L . $h)/bin/hello; done
4183f77722b91fb156403838f299cc7f  /gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10/bin/hello
4c6b9c3b6eca974c1433ec489a7abe92  /gnu/store/zpmd9s4yggrksr2rki8xkxvzp44q8zmk-hello-bis-2.10/bin/hello
0c34626a575622351678d8554b7b5310  /gnu/store/dg0lxrxc5wz3k3ljc82n5pn3y9ffg8s4-hello-ter-2.10/bin/hello
--8<---------------cut here---------------end--------------->8---


What do I miss?


All the best,
simon


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Inherit, rewrite: different binaries?
  2020-09-30 19:43 Inherit, rewrite: different binaries? zimoun
@ 2020-09-30 20:27 ` Tobias Geerinckx-Rice
  2020-09-30 20:29   ` zimoun
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Geerinckx-Rice @ 2020-09-30 20:27 UTC (permalink / raw)
  To: zimoun; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1613 bytes --]

Zimoun,

zimoun 写道:
> Somehow, the 3 packages ’hello’, ’hello-bis’ and ’hello-ter’ are 
> the
> same.
>
> Using Guix 04a459a069155a6b676b6b93d7dbddb426dd0679, the 
> binaries do not
> seem the same:
>
> --8<---------------cut 
> here---------------start------------->8---
> $ for h in hello hello-bis hello-ter; do md5sum $(guix build -L 
> . $h)/bin/hello; done
> 4183f77722b91fb156403838f299cc7f 
> /gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10/bin/hello
> 4c6b9c3b6eca974c1433ec489a7abe92 
> /gnu/store/zpmd9s4yggrksr2rki8xkxvzp44q8zmk-hello-bis-2.10/bin/hello
> 0c34626a575622351678d8554b7b5310 
> /gnu/store/dg0lxrxc5wz3k3ljc82n5pn3y9ffg8s4-hello-ter-2.10/bin/hello
> --8<---------------cut 
> here---------------end--------------->8---

This is expected: each hello binary contains its own store 
directory:

  $ grep /gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10 \
    /gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10/bin/hello
  Binary file [...]/bin/hello matches.

In the above case you're changing the package name and hence the 
hash, and both of those things change the store directory 
(obviously, or you wouldn't have three things to compare).  The 
string embedded inside each hello binary will also differ.  In 
this case, it's the 
/gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10/share/locale 
used to look up translations, but packages are free to refer to 
themselves as much as they like.  Without inside information, one 
can never assume two different outputs are identical.

Kind regards,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Inherit, rewrite: different binaries?
  2020-09-30 20:27 ` Tobias Geerinckx-Rice
@ 2020-09-30 20:29   ` zimoun
  0 siblings, 0 replies; 3+ messages in thread
From: zimoun @ 2020-09-30 20:29 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: Guix Devel

Hi Tobias

On Wed, 30 Sep 2020 at 22:27, Tobias Geerinckx-Rice <me@tobias.gr> wrote:

> This is expected: each hello binary contains its own store
> directory:
>
>   $ grep /gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10 \
>     /gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10/bin/hello
>   Binary file [...]/bin/hello matches.

It makes sense.  Sorry to be slow on IRC.
Thank you for explaining.

All the best,
simon


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-30 20:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-30 19:43 Inherit, rewrite: different binaries? zimoun
2020-09-30 20:27 ` Tobias Geerinckx-Rice
2020-09-30 20:29   ` zimoun

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).