Subject: Re: bug#65665: package-mapping with #:deep? #t doesn't get all the implicit inputs

From: Simon Tournier <[email-masked]>
Date: Mon, 23 Oct 2023 15:53:35 +0200

Hi,

On Sat, 21 Oct 2023 at 17:22, Ulf Herrman <[email-masked]> wrote:

>> I don’t know, should we start by having a proper bug report for this and
>> study how this happen?

[...]

>> Again I’m sorry if I’m slow to understand, but I’d like to make sure we
>> have a good understanding of the problem before we start discussing
>> solutions.
>
> Okay, I suppose I should have given a concrete example of the behavior.
> The qgit example can fill that role:
>
> $ cat $(./pre-inst-env guix build qgit -n --derivations --no-grafts --with-latest=qtbase)

If I might, Guix revision a25a492f2b, my understanding is,

    $ ./pre-inst-env guix build qgit -n --with-latest=qtbase
    /gnu/store/gx5d03as0k1w6jv0pssi6j69n8glf6w5-qgit-2.10.drv
    /gnu/store/h02aizdjy4p10n4gmcy0y35x14lmjx3n-qtbase-6.6.0.drv

Then the builder of the derivation
/gnu/store/gx5d03as0k1w6jv0pssi6j69n8glf6w5-qgit-2.10.drv reads,

--8<---------------cut here---------------start------------->8---
(begin
  (use-modules
   (guix build qt-build-system)
   (guix build utils))
  (qt-build #:source "/gnu/store/a57n7wy8mdi7l52pr4zg07132blgj5xp-qgit-2.10-checkout" #:system "x86_64-linux" #:outputs
            (list
             (cons "out"
                   ((@
                     (guile)
                     getenv)
                    "out")))
            #:inputs
            (quote
             (("source" . "/gnu/store/a57n7wy8mdi7l52pr4zg07132blgj5xp-qgit-2.10-checkout")
              ("cmake" . "/gnu/store/ygab8v4ci9iklaykapq52bfsshpvi8pw-cmake-minimal-3.24.2")
              ("qtbase" . "/gnu/store/khlz8afih21pd0szn5x1ck6bp6w320cz-qtbase-6.6.0")
[...]
            #:qtbase "/gnu/store/h8z3xhpb8m1ih2k45935kqx0wya5w7vq-qtbase-5.15.10"
--8<---------------cut here---------------end--------------->8---

Therefore, the transformation does not rewrite #:qtbase.  And note that
qtbase-5.15.10 is not listed as #:inputs.

Without the transformations, it reads,

--8<---------------cut here---------------start------------->8---
(begin
  (use-modules
   (guix build qt-build-system)
   (guix build utils))
  (qt-build #:source "/gnu/store/a57n7wy8mdi7l52pr4zg07132blgj5xp-qgit-2.10-checkout" #:system "x86_64-linux" #:outputs
            (list
             (cons "out"
                   ((@
                     (guile)
                     getenv)
                    "out")))
            #:inputs
            (quote
             (("source" . "/gnu/store/a57n7wy8mdi7l52pr4zg07132blgj5xp-qgit-2.10-checkout")
              ("cmake" . "/gnu/store/ygab8v4ci9iklaykapq52bfsshpvi8pw-cmake-minimal-3.24.2")
              ("qtbase" . "/gnu/store/h8z3xhpb8m1ih2k45935kqx0wya5w7vq-qtbase-5.15.10")
[...]
            #:qtbase "/gnu/store/h8z3xhpb8m1ih2k45935kqx0wya5w7vq-qtbase-5.15.10"
--8<---------------cut here---------------end--------------->8---

Cheers,
simon