unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: Extending Guix without using the Guile load path
Date: Sun, 01 Nov 2020 23:23:16 +0100	[thread overview]
Message-ID: <87ft5spvhn.fsf@gnu.org> (raw)
In-Reply-To: <87tuuayplb.fsf@elephly.net> (Ricardo Wurmus's message of "Sat, 31 Oct 2020 23:53:36 +0100")

Hi!

Ricardo Wurmus <rekado@elephly.net> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>
>> Hello!
>>
>> Ricardo Wurmus <rekado@elephly.net> skribis:
>>
>>> I think it’s a bit difficult to install the Guix Workflow Language at
>>> this point and I’d like to change that.
>>>
>>> Currently, new sub-commands for Guix are looked up by module name on the
>>> Guile load path.  When installing the “gwl” package, though, the Guile
>>> load path is not automatically altered, so users need to set it up by
>>> themselves.  The load path is only altered automatically when users
>>> install the “guile” package.  This is not a good recommendation because
>>> users may have Guile 2.2 in their profile, and not Guile 3.0 or whatever
>>> version may be needed by the extension.

[...]

>> GUIX_EXTENSIONS_PATH sounds like a good idea.  I suppose it could be
>> implemented pretty much like GUIX_PACKAGE_PATH?
>>
>> That would also allow us to consider Guix Home a package rather than a
>> channel, like you did for GWL.
>
> Below is a draft that adds Guile modules from GUIX_EXTENSIONS_PATH to
> the %load-path and %load-compiled-path.
>
> I think this implementation is not good, but I’d like to provoke some
> comments about the following thoughts:
>
> * what happens to the Guile dependencies of an extension?  Those would
>   not be added to the load path.  Should the extension take care of this
>   by manually augmenting the load path?

Hmm that doesn’t sound great.

> * The draft simply uses the same directories that GUILE_LOAD_PATH and
>   GUILE_LOAD_COMPILED_PATH use.  Is this a bad idea?  Would it not be
>   better to have a new directory prefix (such as “lib/guix/extensions”)?

On one hand, if it’s a different search path, you’d rather use a
different directory like lib/guix/extensions.  OTOH, all this is regular
Guile code and it’d be ridiculous to be unable to just have it on the
Guile load path.

> * The search path on the “guix” package does not distinguish between
>   compiled modules and source modules; it simply looks for all the
>   conventional directories and puts them on the GUIX_EXTENSIONS_PATH,
>   while (guix ui) adds them to both %load-path and %load-compiled-path.

Traditionally distros distinguish between arch-dependent and
arch-independent files, and that would prevent that.

(Thinking out loud.)

What if an extension could instead be a package installed next to Guix
and its channels in ~/.config/guix/current, and we use
‘package-path-entries’ as is done in (gnu packages) to augment
‘%load-path’ and ‘%load-compiled-path’?

Thanks,
Ludo’.


  reply	other threads:[~2020-11-01 22:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-19 15:36 Extending Guix without using the Guile load path Ricardo Wurmus
2020-02-19 19:46 ` Gábor Boskovits
2020-02-19 20:40   ` Julien Lepiller
2020-03-12 13:29 ` Ludovic Courtès
2020-03-17 18:32   ` Joshua Branson
2020-03-17 19:36     ` Julien Lepiller
2020-10-31 22:53   ` Ricardo Wurmus
2020-10-31 22:53   ` Ricardo Wurmus
2020-11-01 22:23     ` Ludovic Courtès [this message]
2020-12-06  1:14       ` Ricardo Wurmus
2020-12-08 11:03         ` Ludovic Courtès
2021-01-05 10:18           ` [PATCH] Discover extensions via GUIX_EXTENSIONS_PATH Ricardo Wurmus

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=87ft5spvhn.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=rekado@elephly.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).