unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: Extending Guix without using the Guile load path
Date: Sun, 06 Dec 2020 02:14:37 +0100	[thread overview]
Message-ID: <878sab7n2a.fsf@elephly.net> (raw)
In-Reply-To: <87ft5spvhn.fsf@gnu.org>


Ludovic Courtès <ludo@gnu.org> writes:

> 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’?

I’m not sure if that would complicate installation too much.  Installing
a package in the “guix pull” profile suggests to me that it is installed
when “guix pull” is run, and not by “guix package -p
~/.config/guix/current -i my-extension”.

I suppose it would help with propagated inputs, because they would also
end up in the “guix pull” profile, but perhaps that’s not really
desirable as an extension probably should not be able to accidentally
break Guix just because it uses a different version of a Guile library
that Guix also happens to use.

Keeping the directory tree of the extension separate from the “guix
pull” profile would ensure that the core features of Guix keep working,
no matter how badly broken an extension might be.

So I’m thinking that we should instead define GUIX_EXTENSIONS_PATH as a
list of directories containing merely the *entry points* for additional
Guix commands.  For example, the GWL would provide a script “workflow”
in a directory $prefix/share/guix/extensions/ (or whatever), and that
script is a wrapped executable that sets its own %load-path and
%load-compiled-path as needed (and determined at build time).  All Guix
does is search for matching executables on GUIX_EXTENSIONS_PATH when
asked for an unknown command.

This is disappointingly simple, but I think it’s one of the safest
things to do.

An incidental side effect of doing things this way is that extensions
could, in theory, be written in languages other than Guile (stretching
the meaning of “extension” to its limits).

-- 
Ricardo


  reply	other threads:[~2020-12-06  1:15 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
2020-12-06  1:14       ` Ricardo Wurmus [this message]
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=878sab7n2a.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /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).