GNU bug report logs - #44800
[PATCH 0/2] publish: Add Avahi support.

Previous Next

Package: guix-patches;

Reported by: Mathieu Othacehe <othacehe <at> gnu.org>

Date: Sun, 22 Nov 2020 15:58:02 UTC

Severity: normal

Tags: patch

Merged with 44801, 44802

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 44800 <at> debbugs.gnu.org
Subject: [bug#44800] [PATCH v2 2/3] publish: Add avahi support.
Date: Fri, 27 Nov 2020 18:12:25 +0100
Hi,

Mathieu Othacehe <othacehe <at> gnu.org> skribis:

> * guix/scripts/publish.scm (%options): Add "--enable-avahi" option.
> (show-help): Document it.
> (service-name): New procedure,
> (publish-service-type): new variable.
> (run-publish-server): Add "avahi?" and "port" parameters. Use them to publish
> the server using Avahi.
> (guix-publish): Pass the "avahi?" option to "run-publish-server".
> * gnu/services/base.scm (<guix-publish-configuration>): Add "enable-avahi?"
> field.
> (guix-publish-shepherd-service): Honor it.

Neat!

> +When the @option{--enable-avahi} option is passed, the publish server is
> +advertised on the local network as an Avahi service, using Guile-Avahi
> +bindings.

s/bindings/(@pxref{Top,,, guile-avahi, Using Avahi in Guile Scheme Programs}/

As discussed on IRC, I would avoid using the name Avahi on the CLI and
to some extent in the API as well.  The command-line option could be
“--advertise”.

The documentation would be something like:

  … the server advertises its availability on the local network using
  multicast DNS (mDNS) and DNS service discovery (DNS-SD), currently
  @i{via} Guile-Avahi …

(I remember that Julien posted a DNS client implementation a few years
ago, we never know what the future will be like…  :-))

> +  (enable-avahi? guix-publish-enable-avahi?       ;boolean
> +                 (default #f))

Same here.

>  (define* (run-publish-server socket store
>                               #:key
> +                             avahi? port
>                               (compressions (list %no-compression))
>                               (nar-path "nar") narinfo-ttl
>                               cache pool)
> +  (when avahi?
> +    (avahi-publish-service-thread (service-name)
> +                                  #:type publish-service-type
> +                                  #:port port))

Maybe add (info (_ "advertising …")) here.  Ideally, you’d need a
callback because you can’t tell what the actual advertised name is since
Avahi can pick one to avoid name clashes.

Thanks,
Ludo’.




This bug report was last modified 4 years and 176 days ago.

Previous Next


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