From: Carlo Zancanaro <carlo@zancanaro.id.au>
To: "Ludovic Courtès" <ludo@gnu.org>
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: Fri, 22 Nov 2024 10:25:15 +1100 [thread overview]
Message-ID: <87iksgxj8k.fsf@zancanaro.id.au> (raw)
In-Reply-To: <87jzcwss1j.fsf@gnu.org> ("Ludovic Courtès"'s message of "Thu, 21 Nov 2024 13:14:00 +0100")
On Thu, Nov 21 2024, Ludovic Courtès wrote:
> I think you could do:
>
> #:autoload (guix describe) (package-path-entries)
>
> instead of doing the trick above.
I tried that, and it breaks "guix pull" (as mentioned in the comment in
the code). I don't have the specific error easily accessible, but I
think it was "no code for module: (git)". I assume it was an issue with
how build-program in (build-self) puts things together, but I wasn't
able to investigate further than that.
> 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.
With this change, (extension-directories) does not include the paths in
GUIX_PACKAGE_PATH. Perhaps it should, but I wasn't sure given the
distinction between GUIX_PACKAGE_PATH and GUIX_EXTENSIONS_PATH.
Do we want to run commands from GUIX_PACKAGE_PATH? Or load packages from
GUIX_EXTENSIONS_PATH? At the moment I think the code says "no" to both.
My other concern with removing the code in (gnu packages) is that it may
break code that is using Guix as a library. That is, something like
this:
--8<---------------cut here---------------start------------->8---
guix shell guix guile -- guile -c '(use-modules (gnu packages)) (pk (find-packages-by-name "guile"))'
--8<---------------cut here---------------end--------------->8---
might not add the right things to the load path.
That said, the current patch will add duplicate entries to the load path
when using the Guix CLI, which also isn't good. Perhaps this needs to be
factored out into a single place where we can keep track of whether
we've already added to the load paths.
> 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?
Sure!
With the change in my patch, I'm seeing:
strace: number of calls and errors is roughly the same both with and
without my patch.
time: all the numbers look pretty similar with and without my patch.
I haven't done any statistical analysis of the various values recorded
by strace and time, but the numbers don't vary *too* much between runs,
so I'm fairly confident this isn't having too much of an effect.
I also tested leaving off the "-q" in the time machine call (so my other
channels were also included), but this didn't make any meaningful
difference to the numbers when running "guix build --help".
Carlo
prev parent reply other threads:[~2024-11-21 23:26 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
2024-11-21 23:25 ` Carlo Zancanaro [this message]
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=87iksgxj8k.fsf@zancanaro.id.au \
--to=carlo@zancanaro.id.au \
--cc=74425@debbugs.gnu.org \
--cc=dev@jpoiret.xyz \
--cc=guix@cbaines.net \
--cc=ludo@gnu.org \
--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.