Subject: bug#61343: modules from channels is not available to "guix repl"

From: Simon Tournier <[email-masked]>
Date: Tue, 14 Feb 2023 20:22:45 +0100

Hi,

On mar., 07 févr. 2023 at 16:59, 宋文武 via Bug reports for GNU Guix <[email-masked]> wrote:

> --8<---------------cut here---------------start------------->8---
> (cons*
>  (channel
>   (name 'rde)
>   (url "https://git.sr.ht/~abcdw/rde")
>   (introduction
>    (make-channel-introduction
>     "257cebd587b66e4d865b3537a9a88cccd7107c95"
>     (openpgp-fingerprint
>      "2841 9AC6 5038 7440 C7E9  2FFA 2208 D209 58C1 DEB0"))))
>  %default-channels)
> --8<---------------cut here---------------end--------------->8---
>
> But then, Run:
>   echo '(use-modules (rde features))' | guix repl /dev/stdin
> Will get error: no code for module (rde features)
>
> Well, Run:
>   echo '(use-modules (gnu packages) (rde features))' | guix repl /dev/stdin
> Will pass!

Yes, somehow a bug with the load path.

--8<---------------cut here---------------start------------->8---
$ guix time-machine -C /tmp/channels.scm -- repl -q
GNU Guile 3.0.9
Copyright (C) 1995-2023 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guix-user)> ,pp %load-path
$1 = ("/gnu/store/n7h2ggfgljikvy9xlppsihvhgqj6bprd-guix-module-union/share/guile/site/3.0"
 "/gnu/store/kphp5d85rrb3q1rdc2lfqc1mdklwh3qp-guile-3.0.9/share/guile/3.0"
 "/gnu/store/kphp5d85rrb3q1rdc2lfqc1mdklwh3qp-guile-3.0.9/share/guile/3.0"
 "/gnu/store/kphp5d85rrb3q1rdc2lfqc1mdklwh3qp-guile-3.0.9/share/guile/site/3.0"
 "/gnu/store/kphp5d85rrb3q1rdc2lfqc1mdklwh3qp-guile-3.0.9/share/guile/site"
 "/gnu/store/kphp5d85rrb3q1rdc2lfqc1mdklwh3qp-guile-3.0.9/share/guile"
 "/home/simon/.guix-profile/share/guile/site/3.0"
 "/home/simon/.config/guix/profiles/emacs/emacs/share/guile/site/3.0"
 "/home/simon/.guix-profile/share/guile/site/3.0"
 "/home/simon/.config/guix/profiles/emacs/emacs/share/guile/site/3.0")
scheme@(guix-user)> (use-modules (gnu packages))
scheme@(guix-user)> ,pp %load-path
$2 = ("/gnu/store/n7h2ggfgljikvy9xlppsihvhgqj6bprd-guix-module-union/share/guile/site/3.0"
 "/gnu/store/kphp5d85rrb3q1rdc2lfqc1mdklwh3qp-guile-3.0.9/share/guile/3.0"
 "/gnu/store/kphp5d85rrb3q1rdc2lfqc1mdklwh3qp-guile-3.0.9/share/guile/3.0"
 "/gnu/store/kphp5d85rrb3q1rdc2lfqc1mdklwh3qp-guile-3.0.9/share/guile/site/3.0"
 "/gnu/store/kphp5d85rrb3q1rdc2lfqc1mdklwh3qp-guile-3.0.9/share/guile/site"
 "/gnu/store/kphp5d85rrb3q1rdc2lfqc1mdklwh3qp-guile-3.0.9/share/guile"
 "/home/simon/.guix-profile/share/guile/site/3.0"
 "/home/simon/.config/guix/profiles/emacs/emacs/share/guile/site/3.0"
 "/home/simon/.guix-profile/share/guile/site/3.0"
 "/home/simon/.config/guix/profiles/emacs/emacs/share/guile/site/3.0"
 "/gnu/store/nf3z5kqjybi687v8li2dcbc5i49zm15s-rde/share/guile/site/3.0")
scheme@(guix-user)> ,use(srfi srfi-1)
scheme@(guix-user)> (lset-difference string=? $2 $1)
$3 = ("/gnu/store/nf3z5kqjybi687v8li2dcbc5i49zm15s-rde/share/guile/site/3.0")
scheme@(guix-user)> ,q

$ ls /gnu/store/nf3z5kqjybi687v8li2dcbc5i49zm15s-rde/share/guile/site/3.0
contrib  gnu  rde
--8<---------------cut here---------------end--------------->8---

>From my understanding, it is about %package-module-path not activated by
“guix repl“; I do not know if it is a bug or a feature. :-)

Cheers,
simon