all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Attila Lendvai <attila@lendvai.name>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: using an SRFI that is not available in Guile
Date: Thu, 13 Jan 2022 11:49:46 +0100	[thread overview]
Message-ID: <d046fbc52c9576cb37270590db370ac99aa3e800.camel@telenet.be> (raw)
In-Reply-To: <016ZZkL98oO5WENHC8_wYbCvQ45U44f9DsGA17V-MbMl3tz7I69UZlCB53g9SMyAXjzuRdPztbLr6XgmLwOOxeFeeliCM9KiGj2KFgRb4tc=@lendvai.name>

[-- Attachment #1: Type: text/plain, Size: 3608 bytes --]

Attila Lendvai schreef op do 13-01-2022 om 09:55 [+0000]:
> thank you Maxime!
> 
> with your guidance, i have managed to add guile-srfi-189 next to
> the other guile-srfi-NNN packages in guile-xyz.scm (a slightly tested
> diff is attached).
> 
> but when i grep for how these guile-srfi-NNN packages are actually used
> within guix, then i don't see any hits unfortunately.
> 
> i tried the following to do a quick test of my new package:
> 
> $ ./pre-inst-env guix shell guile-srfi-189
> $ ./pre-inst-env guix repl
> scheme@(guix-user)> ,use (srfi srfi-189)
> While executing meta-command:
> no code for module (srfi srfi-189)

Using the guile REPL is a little less complicated than the guix repl,
I would recommend trying
"./pre-inst-env guix shell guile-srfi-189 -- guile" first.

> 
> how do i introduce it into the guix codebase, without breaking e.g. bootstrappability?

Take a look at ‘2.2  Requirements’ in the manual:
at least for now, I would recommend that the SRFI is kept optional
(using #:autoload and the like) and only required when doing Guix
System things, to help people bootstrapping Guix from a foreign distro
(without the binary installation, albeit with the bootstrap seeds).

See <https://issues.guix.gnu.org/52742> for how guile-lzma was added as
dependency, or see 67bf61255414115ffae0141df9dd3623bc742bff for
guile-disarchive.

For bootstrappability, you might have to define a copy of
guile-srfi-189 in build-aux/build-self, as done for guile-gcrypt.
Whether this is necessary or not depends on where srfi-189 is used. 
IIUC, if it is needed to compute the derivation of the guix package,
then it is, but otherwise, it is not.  Because it is only used in (gnu
services ...) and not, say, (guix packages), I don't think is
necessary.

However, it would be best to check.  E.g. you could commit the
guile-srfi-189 package definition and your changes to (gnu services ...),
then do

$ guix time-machine --commit=a-commit-from-before-the-srfi-was-packages -- time-machine --disable-authentication --url=/the/checkout --commit=the-commit-in-the-checkout --version

i guess i need to add it as an input and a propagated-input to the
> guix package in package-management.scm? and then progress a kind of
> bootstrap stage/step, so that i can then `#:use-module (srfi srfi-189)`
> it in configuration.scm?

Adding to both inputs and propagated-inputs doesn't have any additional
effect, adding it to propagated-input should be sufficient.

probably by recording the new input as a commit, and then guix pull'ing
> it into my user's profile? and only after that can i start using it within
> the guix codebase?

(FWIW, ~/.guix-profile and ~/.config/guix/current are different profiles)

Personally I wouldn't clutter ~/.config/guix/current with changes
to a local checkout and I would use "guix time-machine" or "guix pull --root=..."
instead, but that's a possibility.

Because guile-srfi-189 is not yet among the inputs,
you will have to do "guix shell -D guix guile-srfi-189" instead
of "guix shell -D guix" to set up a development environment.

That won't work yet because the SRFI isn't upstream yet,
but that can be circumvented with '-e ((@ (guix packages package) (name ...) ...)'.

if that is the case, then is there a simpler/shorter way to test my new
> guile-srfi-189 package before i go through all this dance?

FWIW I think it's easiest to first package the SRFI, submit it
and wait for the patch to be merged.  Adding new inputs to Guix
is complicated enough as-is.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  reply	other threads:[~2022-01-13 10:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12 16:46 using an SRFI that is not available in Guile Attila Lendvai
2022-01-12 17:01 ` Attila Lendvai
2022-01-12 17:09 ` Maxime Devos
2022-01-13  9:55   ` Attila Lendvai
2022-01-13 10:49     ` Maxime Devos [this message]
2022-01-13 18:20       ` Attila Lendvai
2022-01-13 20:48         ` Attila Lendvai
2022-01-14 12:02         ` Maxime Devos
2022-01-17 13:45           ` Attila Lendvai
2022-01-13 10:53     ` Maxime Devos
2022-01-13 10:56       ` Maxime Devos
2022-01-18 15:09 ` Ludovic Courtès
2022-01-18 17:06   ` Attila Lendvai
2022-01-19 10:34     ` Ludovic Courtès
2022-01-21 13:59       ` Attila Lendvai
2022-01-24 15:41         ` Ludovic Courtès
2022-01-24 23:02           ` Attila Lendvai
2022-02-05 11:13             ` Ludovic Courtès

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=d046fbc52c9576cb37270590db370ac99aa3e800.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=attila@lendvai.name \
    --cc=guix-devel@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 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.