From: "Ludovic Courtès" <ludo@gnu.org>
To: Carlo Zancanaro <carlo@zancanaro.id.au>
Cc: Josselin Poiret <dev@jpoiret.xyz>,
Simon Tournier <zimon.toutoune@gmail.com>,
Mathieu Othacehe <othacehe@gnu.org>,
Tobias Geerinckx-Rice <me@tobias.gr>,
74425@debbugs.gnu.org, Christopher Baines <guix@cbaines.net>
Subject: [bug#74425] [PATCH] ui: Include channels in load path before searching for commands.
Date: Thu, 21 Nov 2024 13:14:00 +0100 [thread overview]
Message-ID: <87jzcwss1j.fsf@gnu.org> (raw)
In-Reply-To: <eb0ba012b1cafc05b8438eb99a9c736237031242.1731968797.git.carlo@zancanaro.id.au> (Carlo Zancanaro's message of "Tue, 19 Nov 2024 09:26:37 +1100")
Hello,
Carlo Zancanaro <carlo@zancanaro.id.au> skribis:
> * guix/ui.scm (extension-directories): Add channel directories to load path,
> compiled load path, and returned list of directories.
>
> Co-authored-by: Ludovic Courtès <ludo@gnu.org>
> Change-Id: I3063cbf7164a065b2c6c2a5c6473df79ce8cbe9b
Nice, thanks for looking into it!
> (define (extension-directories)
> "Return the list of directories containing Guix extensions."
> - (filter file-exists?
> - (parse-path
> - (getenv "GUIX_EXTENSIONS_PATH"))))
> + (define package-path-entries
> + ;; We need to resolve this lazily, because even using an #:autoload is too
> + ;; much and breaks compilation during "guix pull".
> + (module-ref (resolve-module `(guix describe))
> + (symbol-append 'package-path-entries)))
> + (let ((scm-path go-path (package-path-entries)))
> + (set! %load-path (append %load-path scm-path))
> + (set! %load-compiled-path (append %load-compiled-path go-path))
> + (filter file-exists?
> + (parse-path (getenv "GUIX_EXTENSIONS_PATH") scm-path))))
I think you could do:
#:autoload (guix describe) (package-path-entries)
instead of doing the trick above.
Two things:
1. The ‘%load-path’ and ‘%load-compiled-path’ modifications can now be
removed from (gnu packages), after checking that GUIX_PACKAGE_PATH
still takes precedence.
2. The performance impact of this change must be tested, in particular
the startup time of ‘guix’ commands since they’ll now be loading
(guix channels) & co. unconditionally.
One way to do that might be:
PROFILE=$(guix time-machine -q --url=/path/to/checkout)
guix shell time -- time $PROFILE/bin/guix build --help
strace -c $PROFILE/bin/guix build --help
Could you give it a try?
Ludo’.
next prev parent reply other threads:[~2024-11-21 12:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-18 22:26 [bug#74425] [PATCH] ui: Include channels in load path before searching for commands Carlo Zancanaro
2024-11-21 12:14 ` Ludovic Courtès [this message]
2024-11-21 23:25 ` Carlo Zancanaro
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87jzcwss1j.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=74425@debbugs.gnu.org \
--cc=carlo@zancanaro.id.au \
--cc=dev@jpoiret.xyz \
--cc=guix@cbaines.net \
--cc=me@tobias.gr \
--cc=othacehe@gnu.org \
--cc=zimon.toutoune@gmail.com \
/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 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.