all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Why are custom channels not available to guix repl?
@ 2024-07-12  8:11 Tomas Volf
  2024-07-12 14:15 ` Richard Sent
  0 siblings, 1 reply; 4+ messages in thread
From: Tomas Volf @ 2024-07-12  8:11 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 3217 bytes --]

Hello,

I do not understand the behavior of `guix repl', so I hope someone will be able
to advice on it.  I have pulled custom channels, correctly as far as I can say:

    ~ $ which guix
    /home/wolf/.config/guix/current/bin/guix
    ~ $ guix describe
    Generation 123	Jul 10 2024 12:08:29	(current)
      guix efce95e
        repository URL: https://git.wolfsden.cz/.git/guix
        branch: master
        commit: efce95ec77afec0cfc797d4802e329fdb815f26e
      wolfsden cf8ec30
        repository URL: https://git.wolfsden.cz/.git/wolfsden
        branch: master
        commit: cf8ec30359010e9a6a0436f4e5eec51bc9c6edbc
      nonguix 9fe6f07
        repository URL: https://gitlab.com/nonguix/nonguix
        branch: master
        commit: 9fe6f0751bf5770ef4b2afa7bca0b7e51e1382fd

However when I start `guix repl' and try to use modules from those extra
channels, it does not work:

    $ guix repl
    Loading Guix REPL meta-commands...
    Increasing build verbosity...
    Disabling grafting...
    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)> ,use (nongnu packages mozilla)
    While executing meta-command:
    no code for module (nongnu packages mozilla)

When I explore the load path, I can see this:

    scheme@(guix-user)> ,pp %load-path
    $2 = ("/gnu/store/a8lqn15kzjh99ncms26qm5hw699i94v5-guix-module-union/share/guile/site/3.0"
     "/gnu/store/1gd9nsy4cps8fnrd1avkc9l01l7ywiai-guile-3.0.9/share/guile/3.0"
     "/gnu/store/1gd9nsy4cps8fnrd1avkc9l01l7ywiai-guile-3.0.9/share/guile/3.0"
     "/gnu/store/1gd9nsy4cps8fnrd1avkc9l01l7ywiai-guile-3.0.9/share/guile/site/3.0"
     "/gnu/store/1gd9nsy4cps8fnrd1avkc9l01l7ywiai-guile-3.0.9/share/guile/site"
     "/gnu/store/1gd9nsy4cps8fnrd1avkc9l01l7ywiai-guile-3.0.9/share/guile"
     "/home/wolf/.guix-home/profile/share/guile/site/3.0"
     "/run/current-system/profile/share/guile/site/3.0")

What seems interesting here is that it contains ~/.guix-home path, but not
~/.config/guix/current.  When I check the ~/.config/guix/current the channels
are there:

    $ ls -1 ~/.config/guix/current/share/guile/site/3.0
    COPYING
    NEWS
    README
    README.org
    gnu
    gnu.scm
    guix
    guix.scm
    news.txt
    nongnu
    nonguix
    wolfsden

And when I manually add it to the load path, it starts to work:

    scheme@(guix-user)> (add-to-load-path "/home/wolf/.config/guix/current/share/guile/site/3.0")
    scheme@(guix-user)> ,use (nongnu packages mozilla)
    scheme@(guix-user)>

And I am not sure why that is the case.  Usage for `guix repl' says "In the Guix
execution environment ...", so I would expect the channels to be available by
default.

I am pretty sure the pull itself is fine, since I can reconfigure successfully,
it is just the `guix repl's behavior I do not get.

Thanks in advance for any pointers,
Tomas Volf

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why are custom channels not available to guix repl?
  2024-07-12  8:11 Why are custom channels not available to guix repl? Tomas Volf
@ 2024-07-12 14:15 ` Richard Sent
  2024-07-13 14:49   ` Tomas Volf
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Sent @ 2024-07-12 14:15 UTC (permalink / raw)
  To: ~; +Cc: ludo, help-guix

Hi Tomas,

> However when I start `guix repl' and try to use modules from those extra
> channels, it does not work:

I believe you're being hit with https://issues.guix.gnu.org/61343,
"modules from channels is not available to "guix repl".

As a workaround try ,use (gnu packages). That module has a destructive
setter (%package-module-path I believe) that extends the load path. That
should resolve your issue.

Ideally the issue itself would be resolved of course. I believe a
solution has been identified. There was a comment by Ludo regarding
program name memoization that's beyond my understanding so I don't know
what else needs to be done [1].

[1]: https://issues.guix.gnu.org/61343#12

-- 
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why are custom channels not available to guix repl?
  2024-07-12 14:15 ` Richard Sent
@ 2024-07-13 14:49   ` Tomas Volf
  2024-07-13 15:55     ` Suhail Singh
  0 siblings, 1 reply; 4+ messages in thread
From: Tomas Volf @ 2024-07-13 14:49 UTC (permalink / raw)
  To: Richard Sent; +Cc: ludo, help-guix

[-- Attachment #1: Type: text/plain, Size: 1156 bytes --]

Hello,

On 2024-07-12 10:15:45 -0400, Richard Sent wrote:
> Hi Tomas,
>
> > However when I start `guix repl' and try to use modules from those extra
> > channels, it does not work:
>
> I believe you're being hit with https://issues.guix.gnu.org/61343,
> "modules from channels is not available to "guix repl".

Based on reading the issue that sound like me problem, yes.

>
> As a workaround try ,use (gnu packages). That module has a destructive
> setter (%package-module-path I believe) that extends the load path. That
> should resolve your issue.
>
> Ideally the issue itself would be resolved of course. I believe a
> solution has been identified. There was a comment by Ludo regarding
> program name memoization that's beyond my understanding so I don't know
> what else needs to be done [1].
>
> [1]: https://issues.guix.gnu.org/61343#12

Indeed, importing (gnu packages) does fix it.  Thank you very much, I can just
stuff it into .guile for now.  Or I guess I could just apply your last patch to
my tree.

Have a nice day,
Tomas Volf

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why are custom channels not available to guix repl?
  2024-07-13 14:49   ` Tomas Volf
@ 2024-07-13 15:55     ` Suhail Singh
  0 siblings, 0 replies; 4+ messages in thread
From: Suhail Singh @ 2024-07-13 15:55 UTC (permalink / raw)
  To: Richard Sent; +Cc: ludo, help-guix

Tomas Volf <~@wolfsden.cz> writes:

> Thank you very much, I can just stuff it into .guile for now.

For the benefit of others on the mailing list, something like the below
in .guile ensures that the customization runs only for guix repl:

#+begin_src scheme
  (when (equal? (module-name (current-module)) '(guix-user))
    ;; `guix repl`-only init code
    ;; ensure custom channels are available in guix repl
    (use-modules (gnu packages)) ;; <https://issues.guix.gnu.org/61343>
    )
#+end_src

-- 
Suhail


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-13 15:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-12  8:11 Why are custom channels not available to guix repl? Tomas Volf
2024-07-12 14:15 ` Richard Sent
2024-07-13 14:49   ` Tomas Volf
2024-07-13 15:55     ` Suhail Singh

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.