GNU bug report logs - #46214
[PATCH] DRAFT: narinfo hooks for ‘guix publish’

Previous Next

Package: guix-patches;

Reported by: Maxime Devos <maximedevos <at> telenet.be>

Date: Sun, 31 Jan 2021 16:18:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 46214 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#46214; Package guix-patches. (Sun, 31 Jan 2021 16:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxime Devos <maximedevos <at> telenet.be>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 31 Jan 2021 16:18:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: guix-patches <at> gnu.org
Subject: [PATCH] DRAFT: narinfo hooks for ‘guix publish’
Date: Sun, 31 Jan 2021 12:11:25 +0100
[Message part 1 (text/plain, inline)]
Hello Guix!

I've a proposal to make ‘guix publish’ somewhat extensible.
The draft patch allows for passing a list of ‘hooks’ to guix
publish, with "guix publish --hooks=FILE-WITH-HOOKS.scm
--hooks=MORE-HOOKS.go".  "guix publish" then will consult
this list of hooks at some points.

I've defined a ‘narinfo-hook’, which allows adding extra
key value pairs to the generated narinfos.  See the last
patch that adds a ‘hook.scm’ file for a silly example
that includes a random number and some arbitrary strings.

A TODO for a future revision of the patch, is modifying
‘guix-publish-service-type’ to allow passing a list of
hooks (as gexps).

The use case I had in mind: this could be used for Guix+IPFS
and Guix+GNUnet integration (at least on the "guix publish"
side), by implementing a hook that inserts the store item
into IPFS and GNUnet respectively, and add an appropriate
IPFS and GNUnet URI.

(I'll look into appropriate "guix substitute" hooks
later.)

Guix+IPFS and Guix+GNUnet integrations could of course
use a forked guix (until the integration is merged
upstream when it is in a good state), but a hook system
seems more practical for experimentation to me.

(Also, if hypothetically, in the future "guix publish" supports,
say, IPFS, GNUnet, BitTorrent and Dat, then using the approach
of wip-ipfs-substitutes, there would be four keyword
arguments that need to be passed everywhere.  This patch
only passes a single #:hooks argument.)

Also a question for guix-devel: the wip-ipfs-substitutes
patch adds the "IPFS: etcetera" line *after* the signed
part, while this patch only allows for addings key-value
pairs that will be signed.  Would it be problematic for
the "IPFS: etcetera" or "GNUnet: etcetera" line to be
signed?

If this proposal seems OK to guix-devel, I'll write up
some documentation, tests and changes to
guix-publish-service-type.

(Patch can also be found as signed tag wip-publish-narinfo-hook0
at https://notabug.org/mdevos/guix-gnunet.)

Greetings,
Maxime
-- 
Maxime Devos <maximedevos <at> telenet.be>
PGP Key: C1F3 3EE2 0C52 8FDB 7DD7  011F 49E3 EE22 1917 25EE
Freenode handle: mdevos
[0001-DRAFT-Support-hooks-for-adding-extra-entries-to-the-.patch (text/x-patch, attachment)]
[0002-DRAFT-add-hook-example.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#46214; Package guix-patches. (Mon, 01 Feb 2021 20:18:02 GMT) Full text and rfc822 format available.

Message #8 received at 46214 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: 46214 <at> debbugs.gnu.org
Subject: Re: [PATCH] DRAFT: narinfo hooks for ‘guix publish’
Date: Mon, 01 Feb 2021 21:17:10 +0100
[Message part 1 (text/plain, inline)]
I've began writing tests, will post all patches here
(hook code, tests, service-extension code for
guix-publish-service-type and system tests) once
they are completed.

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#46214; Package guix-patches. (Mon, 01 Feb 2021 22:23:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
To: guix-patches <at> gnu.org
Subject: Re: [bug#46214] [PATCH] DRAFT: narinfo hooks for ‘guix publish’
Date: Mon, 1 Feb 2021 23:22:46 +0100
On 31.01.21 12:11, Maxime Devos wrote:
> Hello Guix!
>
> I've a proposal to make ‘guix publish’ somewhat extensible.
> The draft patch allows for passing a list of ‘hooks’ to guix
> publish, with "guix publish --hooks=FILE-WITH-HOOKS.scm
> --hooks=MORE-HOOKS.go".  "guix publish" then will consult
> this list of hooks at some points.
>
> I've defined a ‘narinfo-hook’, which allows adding extra
> key value pairs to the generated narinfos.  See the last
> patch that adds a ‘hook.scm’ file for a silly example
> that includes a random number and some arbitrary strings.
I didn't looked really into the code, but would this also allow hooks
like baking the nar-file and write it into the cache? Or is it only for
the narinfos?




Information forwarded to guix-patches <at> gnu.org:
bug#46214; Package guix-patches. (Tue, 16 Feb 2021 19:27:01 GMT) Full text and rfc822 format available.

Message #14 received at 46214 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
Cc: 46214 <at> debbugs.gnu.org
Subject: Re: [bug#46214] [PATCH] DRAFT: narinfo hooks for
 ‘guix publish’
Date: Tue, 16 Feb 2021 20:26:39 +0100
[Message part 1 (text/plain, inline)]
Sorry for the late response, for some reason your mail didn't end
up in my inbox.  A reminder for what my goal is: I am attempting
to serve substitutes via a P2P system.  Ludovic has a patch
for substitutes over IPFS, myself I'm planning to write a patch
for substitutes over GNUnet.  This patch aims to define a
simple ‘hook’ into ‘guix publish’ for adding the IPFS or GNUnet
URI.

On Mon, 2021-02-01 at 23:22 +0100, Jonathan Brielmaier wrote:
> 
> On 31.01.21 12:11, Maxime Devos wrote:
> > [...]
> > I've defined a ‘narinfo-hook’, which allows adding extra
> > key value pairs to the generated narinfos.  [...]
> I didn't looked really into the code, but would this also allow hooks
> like baking the nar-file and write it into the cache? Or is it only for
> the narinfos?

This patch is only for the generation of the narinfos.

(I would like to eventually write a hook that publishes
the store item via GNUnet and embeds the URI in the narinfo,
but there isn't yet a corresponding hook mechanism on
the substituter side.)

That said, other hook types could be defined with additional
patches, though I don't know what use that would serve.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 3 years and 68 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.