Subject: bug#64856: closed (Re: bug#64856: guix shell cache doesn't consider grafts)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 12 Oct 2023 16:58:02 +0000

Your bug report

#64856: guix shell cache doesn't consider grafts

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
64856: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64856
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#64856: guix shell cache doesn't consider grafts
From: Ludovic Courtès <[email-masked]>
To: Maxim Cournoyer <[email-masked]>
Cc: [email-masked]
Date: Thu, 12 Oct 2023 18:57:05 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

Maxim Cournoyer <[email-masked]> skribis:

> While investigating https://issues.guix.gnu.org/64836, I discovered that
> the cache of 'guix shell' doesn't take into account grafts for
> subsequent invocations.

Fixed in 75bdf8e06a325b90bf387a03f88726d338acbbf6.

Thanks,
Ludo’.

Subject: guix shell cache doesn't consider grafts
From: Maxim Cournoyer <[email-masked]>
To: bug-guix <[email-masked]>
Date: Tue, 25 Jul 2023 09:55:22 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

While investigating https://issues.guix.gnu.org/64836, I discovered that
the cache of 'guix shell' doesn't take into account grafts for
subsequent invocations.

Consider, using Guix at commit 21b718f4d6c3ded8ef50d12f6e9ae6474f74620f:

--8<---------------cut here---------------start------------->8---
$ guix build gtk+
/gnu/store/6vqx7nip7r95h2nhvhb9vxzjpri581b9-gtk+-3.24.37

$ guix build --no-grafts gtk+
/gnu/store/2n2kprz35a19ibs5kbjsb3k4cdl69q2w-gtk+-3.24.37

$ guix shell gtk+ -- sh -c 'realpath $GUIX_ENVIRONMENT/lib/libgtk-3.so'
/gnu/store/6vqx7nip7r95h2nhvhb9vxzjpri581b9-gtk+-3.24.37/lib/libgtk-3.so.0.2405.32

$ guix shell --no-grafts gtk+ -- sh -c 'realpath $GUIX_ENVIRONMENT/lib/libgtk-3.so'
/gnu/store/6vqx7nip7r95h2nhvhb9vxzjpri581b9-gtk+-3.24.37/lib/libgtk-3.so.0.2405.32
--8<---------------cut here---------------end--------------->8---

The 'guix shell --no-grafts' invocation simply reused the same cache as
the previous command, so grafts are in use, which is non-intuitive.  The
reverse would be true as well:

--8<---------------cut here---------------start------------->8---
$ guix shell --rebuild-cache --no-grafts gtk+ -- sh -c 'realpath $GUIX_ENVIRONMENT/lib/libgtk-3.so'
/gnu/store/2n2kprz35a19ibs5kbjsb3k4cdl69q2w-gtk+-3.24.37/lib/libgtk-3.so.0.2405.32

$ guix shell gtk+ -- sh -c 'realpath $GUIX_ENVIRONMENT/lib/libgtk-3.so'
/gnu/store/2n2kprz35a19ibs5kbjsb3k4cdl69q2w-gtk+-3.24.37/lib/libgtk-3.so.0.2405.32
--8<---------------cut here---------------end--------------->8---

The ungrafted cache got reused by the invocation that should have used
grafted inputs.

-- 
Thanks,
Maxim