unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Simon Tournier <zimon.toutoune@gmail.com>
To: 61574@debbugs.gnu.org, zimon.toutoune@gmail.com,
	iyzsong@envs.net, 61343@debbugs.gnu.org
Cc: Josselin Poiret <dev@jpoiret.xyz>
Subject: bug#61574: [PATCH v2] scripts: repl: Extend REPL %load-path with all channels.
Date: Fri, 17 Feb 2023 15:56:27 +0100	[thread overview]
Message-ID: <20230217145627.85062-1-zimon.toutoune@gmail.com> (raw)
In-Reply-To: <e0ffbcbb07fe41a04688223342461aa4d3310142.1676582046.git.dev@jpoiret.xyz>

Fixes <https://bugs.gnu.org/61343>.
Reported by 宋文武 <iyzsong@envs.net>.

* guix/scripts/repl.scm (define-command): Before starting the REPL,
run (current-profile) which makes available all channels.
---

Hi,

Instead I am proposing this, it avoids to load all the module.

For testing, once applied to some Guix checkout, just run:

$ ./pre-inst-env guix pull --disable-authentication -C /tmp/channels.scm -p /tmp/new
$ echo '(use-modules (rde features))' | /tmp/new/bin/guix repl /dev/stdin

where /tmp/channels.scm reads,

(list
 (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"))))
 (channel
  (name 'guix)
  (url "/home/simon/src/guix/guix")))

tweaking the path to your Guix checkout.

Cheers,
simon


 guix/scripts/repl.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/guix/scripts/repl.scm b/guix/scripts/repl.scm
index 787c63d48e..fc55d79c41 100644
--- a/guix/scripts/repl.scm
+++ b/guix/scripts/repl.scm
@@ -211,6 +211,7 @@ (define script
               ((guile)
                (save-module-excursion
                 (lambda ()
+                  (current-profile) ;Run (%package-module-path) as explained above.
                   (set-user-module)
                   ;; Do not exit repl on SIGINT.
                   ((@@ (ice-9 top-repl) call-with-sigint)

base-commit: cb45e9d0dc6cbe6f69a858f71252411610b4ce82
-- 
2.38.1





  parent reply	other threads:[~2023-02-17 14:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07  8:59 bug#61343: modules from channels is not available to "guix repl" 宋文武 via Bug reports for GNU Guix
2023-02-14 19:22 ` Simon Tournier
2023-02-16 21:14   ` bug#61343: [PATCH] scripts: repl: Load (gnu packages) to set up %load-path Josselin Poiret via Bug reports for GNU Guix
2023-02-17  3:09     ` 宋文武 via Bug reports for GNU Guix
2023-02-17 14:56     ` Simon Tournier [this message]
2023-02-27 14:01       ` bug#61343: bug#61574: [PATCH v2] scripts: repl: Extend REPL %load-path with all channels Ludovic Courtès
2023-03-02 13:44         ` bug#61574: " Andrew Tropin
2023-03-02 19:48           ` bug#61343: " Simon Tournier
2023-03-03 11:14             ` Ludovic Courtès
2023-02-17 15:21     ` bug#61343: [PATCH] scripts: repl: Load (gnu packages) to set up %load-path Simon Tournier
2024-03-03  5:54 ` bug#61343: bug#61574: bug#61343: bug#61574: [PATCH] scripts: repl: Extend REPL %load-path with all channels. For real Richard Sent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230217145627.85062-1-zimon.toutoune@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=61343@debbugs.gnu.org \
    --cc=61574@debbugs.gnu.org \
    --cc=dev@jpoiret.xyz \
    --cc=iyzsong@envs.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).