all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bruno Victal <mirai@makinata.eu>
To: 63985@debbugs.gnu.org
Cc: Bruno Victal <mirai@makinata.eu>,
	liliana.prikler@gmail.com, maxim.cournoyer@gmail.com,
	ludo@gnu.org
Subject: [bug#63985] [PATCH v3 00/11] Service subsystem improvements
Date: Mon, 26 Jun 2023 22:57:27 +0100	[thread overview]
Message-ID: <cover.1687816304.git.mirai@makinata.eu> (raw)
In-Reply-To: <cover.1686343642.git.mirai@makinata.eu>

This patch-series is an agglomeration of smaller but weakly-related
patch-series, done so in order to build up the case for the changes.
I structured the series in order to make it suitable for cherry-picking.


Summary of changes:

* Plumbing changes to serialize-configuration

By orienting it around SRFI-171 transducers, it's now easier
to build custom configuration serializing procedures.

* New define-configuration syntax: serializer-options

Serializers may now accept more than two arguments.

* New module (gnu services configuration generic-ini)

* Deduplicate often used predicates.

* network-manager-service-type cleanup & new fields.



Notable changes since v2:

* Documentation changes

The documentation for define-configuration was reworded to make later
syntax extensions easier to document.
In addition, the new 'serializer-options' is now documented.


* (gnu services configuration) changes

** New predicates.

Reduce code duplication by migrating some commonly used predicates into
this module.


* generic-ini changes

** Initial field testing

Some deficiencies were found & corrected while doing a first field
testing when network-manager-service-type was refactored to make use
of this module.

** generic-ini- serializers

** Handling of multiple entries

Implemented as a transducer, this is useful to deal with escape-hatch
fields.


* network-manager-service-type changes

** Use define-configuration for <network-manager-configuration>

** Refactored serialization process to use the new generic-ini module

** New configuration fields: log-configuration and extra-options

Provides an escape hatch for options not yet implemented in the
record type.

** Renamed fields: 'network-manager' to 'package'

Naming the field 'package' is more informative & less confusing than a
reduplication of the package-name with the field-name itself.



Omissions in generic-ini:

For now, I've omitted:
* Custom leading (presumed to be whitespace) characters for entries
  à la gitconfig, mostly beautifying purposes
* Configurable delimiter (\n, \r\n, \0, ...)
* Configurable Key-value separator (this is usually =)

These can be implemented later if required.



Notes:

The interface in (gnu services configuration generic-ini) is still in its
infancy and might require further adjustments/additions and I'm still
thinking about its potential generalizations to TOML & co.
For the time being I'd prefer not to promise any interface stability.



Nice to haves:

I didn't have much luck in replacing the memq approach in the predicate
with define-enumeration:

--8<---------------cut here---------------start------------->8---
;; This works.
(define (network-manager-log-level? x)
  (memq x '(off err warn info debug trace)))

;; This does not.
(define-enumeration network-manager-log-level?
  (off err warn info debug trace)
  network-manager-log-level-set)

;; While executing meta-command:
;; ERROR:
;;   1. &origin: "network-manager-log-level?"
;;   2. &message: "not a member of the set"
;;   3. &syntax:
;;      form: #f
;;      subform: #f
--8<---------------cut here---------------end--------------->8---

Would be nice to know what went wrong and whether an enumeration could
be used here instead.


Bruno Victal (11):
  services: configuration: Simplify normalize-extra-args.
  services: configuration: Use transducers within
    serialize-configuration.
  services: fstrim-service-type: Serialize with SRFI-171 transducers.
  doc: Rewrite define-configuration.
  services: configuration: Add serializer-options field.
  services: configuration: New generic-ini module.
  services: configuration: Add some commonly used predicates.
  services: NetworkManager: Use define-configuration and generic-ini.
  services: NetworkManager: Prefer package over network-manager.
  services: NetworkManager: add log-configuration field.
  services: NetworkManager: Add extra-options field.

 Makefile.am                                  |   1 +
 doc/guix.texi                                | 161 +++++----
 gnu/local.mk                                 |   1 +
 gnu/services/audio.scm                       |   7 +-
 gnu/services/configuration.scm               | 108 ++++--
 gnu/services/configuration/generic-ini.scm   | 165 +++++++++
 gnu/services/linux.scm                       |  11 +-
 gnu/services/networking.scm                  | 352 ++++++++++++++-----
 gnu/services/telephony.scm                   |  49 ++-
 tests/services/configuration.scm             |  88 ++++-
 tests/services/configuration/generic-ini.scm | 129 +++++++
 11 files changed, 861 insertions(+), 211 deletions(-)
 create mode 100644 gnu/services/configuration/generic-ini.scm
 create mode 100644 tests/services/configuration/generic-ini.scm


base-commit: ac86174e22fcd762893bd4515786b1376af9397b
-- 
2.39.2





  parent reply	other threads:[~2023-06-26 21:58 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09 21:18 [bug#63985] [PATCH RFC 0/5] Generic INI serializer & SRFI-171 for define-configuration Bruno Victal
2023-06-09 21:20 ` [bug#63985] [PATCH RFC 1/5] services: configuration: Simplify normalize-extra-args Bruno Victal
2023-06-09 21:20 ` [bug#63985] [PATCH RFC 2/5] services: configuration: Use transducers within serialize-configuration Bruno Victal
2023-06-09 21:20 ` [bug#63985] [PATCH RFC 3/5] services: fstrim-service-type: Serialize with SRFI-171 transducers Bruno Victal
2023-06-09 21:20 ` [bug#63985] [PATCH RFC 4/5] services: configuration: Add serializer-kwargs field Bruno Victal
2023-06-09 21:21 ` [bug#63985] [PATCH RFC 5/5] services: configuration: New generic-ini module Bruno Victal
2023-06-10 20:10 ` [bug#63985] [PATCH RFC v2 1/5] services: configuration: Simplify normalize-extra-args Bruno Victal
2023-06-10 20:10 ` [bug#63985] [PATCH RFC v2 2/5] services: configuration: Use transducers within serialize-configuration Bruno Victal
2023-06-10 20:10 ` [bug#63985] [PATCH RFC v2 3/5] services: fstrim-service-type: Serialize with SRFI-171 transducers Bruno Victal
2023-06-10 20:10 ` [bug#63985] [PATCH RFC v2 4/5] services: configuration: Add serializer-options field Bruno Victal
2023-06-10 20:10 ` [bug#63985] [PATCH RFC v2 5/5] services: configuration: New generic-ini module Bruno Victal
2023-06-26 21:57 ` Bruno Victal [this message]
2023-06-26 21:59   ` [bug#63985] [PATCH v3 01/11] services: configuration: Simplify normalize-extra-args Bruno Victal
2023-10-02 17:00     ` [bug#63985] [PATCH RFC 0/5] Generic INI serializer & SRFI-171 for define-configuration Maxim Cournoyer
2023-10-07 12:36       ` [bug#63985] [PATCH v3 01/11] services: configuration: Simplify normalize-extra-args. (was: bug#63985: [PATCH RFC 0/5] Generic INI serializer & SRFI-171 for define-configuration) Bruno Victal
2023-06-26 21:59   ` [bug#63985] [PATCH v3 02/11] services: configuration: Use transducers within serialize-configuration Bruno Victal
2023-10-02 17:25     ` [bug#63985] [PATCH RFC 0/5] Generic INI serializer & SRFI-171 for define-configuration Maxim Cournoyer
2023-10-07 13:39       ` [bug#63985] [PATCH v3 02/11] services: configuration: Use transducers within serialize-configuration. (was : bug#63985: [PATCH RFC 0/5] Generic INI serializer & SRFI-171 for define-configuration) Bruno Victal
2023-10-07 14:37         ` Maxim Cournoyer
2023-06-26 21:59   ` [bug#63985] [PATCH v3 03/11] services: fstrim-service-type: Serialize with SRFI-171 transducers Bruno Victal
2023-06-26 21:59   ` [bug#63985] [PATCH v3 04/11] doc: Rewrite define-configuration Bruno Victal
2023-10-02 18:28     ` [bug#63985] [PATCH RFC 0/5] Generic INI serializer & SRFI-171 for define-configuration Maxim Cournoyer
2023-10-07 14:21       ` Bruno Victal
2023-10-07 16:35         ` Maxim Cournoyer
2023-06-26 21:59   ` [bug#63985] [PATCH v3 05/11] services: configuration: Add serializer-options field Bruno Victal
2023-10-02 19:12     ` [bug#63985] [PATCH RFC 0/5] Generic INI serializer & SRFI-171 for define-configuration Maxim Cournoyer
2023-10-06 18:29       ` Bruno Victal
2023-06-26 21:59   ` [bug#63985] [PATCH v3 06/11] services: configuration: New generic-ini module Bruno Victal
2023-10-02 19:15     ` [bug#63985] [PATCH RFC 0/5] Generic INI serializer & SRFI-171 for define-configuration Maxim Cournoyer
2023-06-26 21:59   ` [bug#63985] [PATCH v3 07/11] services: configuration: Add some commonly used predicates Bruno Victal
2023-06-26 21:59   ` [bug#63985] [PATCH v3 08/11] services: NetworkManager: Use define-configuration and generic-ini Bruno Victal
2023-06-26 21:59   ` [bug#63985] [PATCH v3 09/11] services: NetworkManager: Prefer package over network-manager Bruno Victal
2023-10-02 16:52     ` [bug#63985] [PATCH RFC 0/5] Generic INI serializer & SRFI-171 for define-configuration Maxim Cournoyer
2023-06-26 21:59   ` [bug#63985] [PATCH v3 10/11] services: NetworkManager: add log-configuration field Bruno Victal
2023-10-05 16:57     ` Maxim Cournoyer
2023-06-26 21:59   ` [bug#63985] [PATCH v3 11/11] services: NetworkManager: Add extra-options field Bruno Victal
2023-10-05 16:59     ` Maxim Cournoyer
2023-06-27  4:20   ` [bug#63985] [PATCH v3 00/11] Service subsystem improvements Liliana Marie Prikler
2023-09-16 21:22   ` Bruno Victal
2023-09-16 21:55     ` Liliana Marie Prikler
2023-09-23 13:35       ` Bruno Victal
2023-09-23 15:22         ` Liliana Marie Prikler
2023-09-25 14:06       ` Ludovic Courtès
2023-10-07 15:57 ` [bug#63985] [PATCH v4 0/5] SRFI-171 based improvements for define-configuration Bruno Victal
2023-10-07 15:57   ` [bug#63985] [PATCH v4 2/5] services: configuration: Use transducers within serialize-configuration Bruno Victal
2023-10-07 15:59   ` [bug#63985] [PATCH v4 1/5] services: configuration: Simplify normalize-extra-args Bruno Victal
2023-10-07 15:59   ` [bug#63985] [PATCH v4 3/5] services: fstrim-service-type: Serialize with SRFI-171 transducers Bruno Victal
2023-10-07 15:59   ` [bug#63985] [PATCH v4 4/5] doc: Rewrite define-configuration Bruno Victal
2023-10-07 15:59   ` [bug#63985] [PATCH v4 5/5] services: configuration: Add some commonly used predicates Bruno Victal
2023-10-07 16:57   ` bug#63985: SRFI-171 based improvements for define-configuration Maxim Cournoyer

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=cover.1687816304.git.mirai@makinata.eu \
    --to=mirai@makinata.eu \
    --cc=63985@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    --cc=ludo@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /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.