guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Transform options: check if applied or not


From: zimoun
Subject: Transform options: check if applied or not
Date: Thu, 09 Sep 2021 00:29:18 +0200

Hi Ludo,

This thread is initially about 2 issues:

 1) apply a transformation to a non-existent package,
 2) check if the transformation makes sense or not.

Here, I will comment only about #2.

On Wed, 08 Sep 2021 at 22:55, Ludovic Courtès <ludo@gnu.org> wrote:

>> The other issue is to list if the transformation is applied or not.  I
>> think it is possible by traversing again the graph and check if a
>> property appears at least once; well it should be better to warn if
>> the 'mapping-property' is not found at least once.  I had some
>> headaches to implement it... and I moved to other "urgent" stuff. :-)
>
> Hmm the ‘mapping-property’ is not enough.  I think you pretty much have
> to compute the derivations of the new and old packages and compare them.

>From my understanding, the transformation can replace something and then
return a new package but this new package can be the same as the old
one.  I agree that the detection of such cases requires to compute the
both derivation––which is probably too expensive / complex, IMHO.

However, the transformation might replace nothing and so it is sure that
the new and old packages are the same. :-)

Other said,

  a) there is no guarantee that if the new graph contains a least one
replacement then the new package is different than the old one.

But,

  b) there is a guarantee that if the new graph does not contains any
replacement, then for sure the new package is the same than the old one.

For instance,

 a) guix build hello@2.10 
--with-source=hello=https://ftpmirror.gnu.org/gnu/hello/hello-2.10.tar.gz
 b) guix build hello@2.10 --with-latest=python-scipy

and it would be nice to warn for the case b-.  After digging again in
the code, the ’mapping-property’ is probably not the right way, even if
a ’properties’ could be added when the rewrite happens and this
’properties’ can be checked at the end of the traversal.  WDYT?


Cheers,
simon

Well well, I miss a point:

--8<---------------cut here---------------start------------->8---
$ 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
--8<---------------cut here---------------end--------------->8---

Where https://ftpmirror.gnu.org/gnu/hello/hello-2.10.tar.gz is an
official mirror.  It was expecting the same store item so why not a
different one.

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; again that’s fine.  The corresponding
first and second derivations are:

--8<---------------cut here---------------start------------->8---
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"]

[...]

--8<---------------cut here---------------end--------------->8---

and

--8<---------------cut here---------------start------------->8---
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"]

[...]

--8<---------------cut here---------------end--------------->8---

Therefore, I understand why the two store items have different hashes.


What puzzled me are the corresponding ’guile-builder’s:

--8<---------------cut here---------------start------------->8---
  (define %build-inputs
    (quote
     (("source" . 
"/gnu/store/chariqd6k0sli3s7vcl4q3al0crirz5v-hello-2.10.tar.gz")
--8<---------------cut here---------------end--------------->8---

and

--8<---------------cut here---------------start------------->8---
  (define %build-inputs
    (quote
     (("source" . 
"/gnu/store/hbdalsf5lpf01x4dcknwx6xbn6n5km6k-hello-2.10.tar.gz")
--8<---------------cut here---------------end--------------->8---

but these 2 items have the same hash:

--8<---------------cut here---------------start------------->8---
$ guix hash /gnu/store/chariqd6k0sli3s7vcl4q3al0crirz5v-hello-2.10.tar.gz
0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i

$ guix hash /gnu/store/hbdalsf5lpf01x4dcknwx6xbn6n5km6k-hello-2.10.tar.gz
0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i
--8<---------------cut here---------------end--------------->8---

Why?  It is fixed-output so I was expecting the same thing.  And the
same as:

--8<---------------cut here---------------start------------->8---
$ guix download https://ftpmirror.gnu.org/gnu/hello/hello-2.10.tar.gz

Starting download of /tmp/guix-file.qkhxkp
>From 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.gz
0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i
--8<---------------cut here---------------end--------------->8---

Why the store item of source tarball is it different when applying the
transformation?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]