Subject: Grafting order depends on store connection state

From: Josselin Poiret <[email-masked]>
Date: Mon, 10 Oct 2022 21:40:22 +0200

Hi,

Someone reported yesterday on IRC [1] that they didn't get the same
canonical path for the pass (from `password-store`) binary if they built
it directly or in a profile with `fontconfig` added.  I managed to
isolate the issue down to the following:

--8<---------------cut here---------------start------------->8---
(let ((right (with-store store (run-with-store store (package->derivation
                                                      (specification->package
                                                       "password-store")))))
      (wrong (with-store store (run-with-store store (mbegin %store-monad
                                                       (package->derivation
                                                        (specification->package
                                                         "texlive-bin"))
                                                       (package->derivation
                                                        (specification->package
                                                         "password-store")))))))
  (pk right)
  (pk wrong))
--8<---------------cut here---------------end--------------->8---

Both derivations differ even though they ideally should be identical,
apparently git doesn't appear in the same place in the grafting
derivation.

I've tried to debug the grafting code but to no avail yet.  Does anyone
have any idea?

[1] https://logs.guix.gnu.org/guix/2022-10-09.log#203800

-- 
Josselin Poiret