different fixed-output when using ’--with-source’ transformation

OpenSubmitted by zimoun.
Details
3 participants
  • Ludovic Courtès
  • Maxime Devos
  • zimoun
Owner
unassigned
Severity
normal
Z
Z
zimoun wrote 4 days ago
different fixed-output when using ’--with-sourc e’ transformation
(name . Bug Guix)(address . bug-guix@gnu.org)
86zgsecrzv.fsf@gmail.com
Hi,
If the package source tarball is provided to ’--with-source’, then thehash differs. I would expect a fixed point.
Let investigate:
Toggle snippet (7 lines)$ guix build hello@2.10 --with-source=hello=https://ftpmirror.gnu.org/gnu/hello/hello-2.10.tar.gz/gnu/store/zfwhbbknkhxi3yqmp0qgh1l1crljgbm6-hello-2.10
$ guix build hello@2.10 /gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10
Where https://ftpmirror.gnu.org/gnu/hello/hello-2.10.tar.gzis anofficial mirror. I expect the same store item.
Why are they different? It is because the derivations are different.The first call contains the source tarball as an “input”; that’s fine.The second call contains the source tarball as a derivation; againthat’s fine. The corresponding first and second derivations are:
Toggle snippet (15 lines)Derive([("out","/gnu/store/zfwhbbknkhxi3yqmp0qgh1l1crljgbm6-hello-2.10","","")] ,[("/gnu/store/101ny738l311p4fm3cas7jgnkzagjv6a-module-import-compiled.drv",["out"])
[...]
,("/gnu/store/z4s27gwacbw8f38andfsh21r8v330dag-xz-5.2.4.drv",["out"])] ,["/gnu/store/8a0wry8cvr405ha8d8bpjyzj5dzghigd-module-import", "/gnu/store/chariqd6k0sli3s7vcl4q3al0crirz5v-hello-2.10.tar.gz", "/gnu/store/rndq9g8877l29ha41dvsl3aj1z0gw0ng-hello-2.10-guile-builder"]
[...]

and
Toggle snippet (15 lines)Derive([("out","/gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10","","")] ,[("/gnu/store/101ny738l311p4fm3cas7jgnkzagjv6a-module-import-compiled.drv",["out"]) ,("/gnu/store/1a7xfcqcxj0pqi4f81x1agcxa46v2bbm-hello-2.10.tar.gz.drv",["out"])
[...]
,("/gnu/store/z4s27gwacbw8f38andfsh21r8v330dag-xz-5.2.4.drv",["out"])] ,["/gnu/store/8a0wry8cvr405ha8d8bpjyzj5dzghigd-module-import", "/gnu/store/kql8b2hbsabcmany4m3hfm3wzdiymliy-hello-2.10-guile-builder"]
[...]

Therefore, I understand why the two store items have different hashes.Although, it should be better that the derivations would be the same;another story. :-)

What puzzled me are the corresponding ’guile-builder’s:
Toggle snippet (5 lines) (define %build-inputs (quote (("source" . "/gnu/store/chariqd6k0sli3s7vcl4q3al0crirz5v-hello-2.10.tar.gz")
and
Toggle snippet (5 lines) (define %build-inputs (quote (("source" . "/gnu/store/hbdalsf5lpf01x4dcknwx6xbn6n5km6k-hello-2.10.tar.gz")
but these 2 items have the same hash:
Toggle snippet (7 lines)$ guix hash /gnu/store/chariqd6k0sli3s7vcl4q3al0crirz5v-hello-2.10.tar.gz0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i
$ guix hash /gnu/store/hbdalsf5lpf01x4dcknwx6xbn6n5km6k-hello-2.10.tar.gz0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i
Why? It is fixed-output so I was expecting the same thing. And thesame as:
Toggle snippet (11 lines)$ guix download https://ftpmirror.gnu.org/gnu/hello/hello-2.10.tar.gz
Starting download of /tmp/guix-file.qkhxkpFrom https://ftpmirror.gnu.org/gnu/hello/hello-2.10.tar.gz...following redirection to `https://mirrors.sarata.com/gnu/hello/hello-2.10.tar.gz'... …10.tar.gz 709KiB 549KiB/s 00:01 [##################]100.0%/gnu/store/hbdalsf5lpf01x4dcknwx6xbn6n5km6k-hello-2.10.tar.gz0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i
Why the store item of source tarball is it different when applying thetransformation?
Maxime provided a clue [1].
All the best,simon
1: https://yhetil.org/guix/bd48bb84243bb6b6a3a7f6e1350767d7c1015238.camel@telenet.be
L
L
Ludovic Courtès wrote 4 hours ago
Re: bug#50597: different fixed-output when using ’--with-source’ transformation
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 50597@debbugs.gnu.org)
87fsu1uaup.fsf@gnu.org
Hello!
zimoun <zimon.toutoune@gmail.com> skribis:
Toggle quote (5 lines)> Why the store item of source tarball is it different when applying the> transformation?>> Maxime provided a clue [1].
Maxime is right: ‘--with-source’ passes #:recursive? #t unconditionally,whereas it’s usually #f for a ‘url-fetch’ kind of URI.
What we could do is make it #t if and only if the URL denotes a localfile and that file is a directory. I think that would achieve what youwant without any observable regression in practice.
WDYT?
Thanks,Ludo’.
M
M
Maxime Devos wrote 3 hours ago
(address . 50597@debbugs.gnu.org)
bfbc4c2bd52137e55afb32c424e62d576d9cbf73.camel@telenet.be
Ludovic Courtès schreef op za 18-09-2021 om 18:06 [+0200]:
Toggle quote (18 lines)> Hello!> > zimoun <zimon.toutoune@gmail.com> skribis:> > > Why the store item of source tarball is it different when applying the> > transformation?> > > > Maxime provided a clue [1].> > Maxime is right: ‘--with-source’ passes #:recursive? #t unconditionally,> whereas it’s usually #f for a ‘url-fetch’ kind of URI.> > What we could do is make it #t if and only if the URL denotes a local> file and that file is a directory. I think that would achieve what you> want without any observable regression in practice.>> WDYT?
This seems reasonable to me.
Greetings,Maxime.
-----BEGIN PGP SIGNATURE-----
iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYUYjURccbWF4aW1lZGV2b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7oHOAQCg5aZN+D+ze0P5pr7U5H1WZM52m2AS+jL24v5H/nSX4QD/fIPYjX4kXQ/IcB3OzPjeNFKnfCrqIDS57zgVDlKdBAA==OtFz-----END PGP SIGNATURE-----

?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send email to 50597@debbugs.gnu.org