GNU bug report logs

#27155 [PATCH 0/2] Support service extensions on the "final" service values

PackageSource(s)Maintainer(s)
guix-patches PTS Buildd Popcon
Full log

Message #25 received at 27155@debbugs.gnu.org (full text, mbox, reply):

Received: (at 27155) by debbugs.gnu.org; 4 Jun 2017 14:26:51 +0000
From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 04 10:26:51 2017
Received: from localhost ([127.0.0.1]:55923 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1dHWUU-00031A-Ti
	for submit@debbugs.gnu.org; Sun, 04 Jun 2017 10:26:51 -0400
Received: from mail-lf0-f68.google.com ([209.85.215.68]:35876)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alezost@gmail.com>) id 1dHWUS-00030x-KO
 for 27155@debbugs.gnu.org; Sun, 04 Jun 2017 10:26:49 -0400
Received: by mail-lf0-f68.google.com with SMTP id x81so2400706lfb.3
 for <27155@debbugs.gnu.org>; Sun, 04 Jun 2017 07:26:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=sAn5cuvrvObbrirdJ9LPZqlJB4AiM/uhIfkjT69O4Js=;
 b=lRaJMejmwM8V2Uj2x67099zV77jPXiM+ecQ1BsgScyuk2egQ+ssLcbd4QK840SieDn
 QZgKMEUx5Yi5ohU5hncO+6lsILahjdagUU6AApdt7k4qld8EaxlBFfsNXSKGXuvU9nPT
 i0IbVDH2o59ikKkhLyQ1/OrXq/MTwh8mmIyFGL0GHe45GdaVQmLCk0bbGTtPYazQaRfn
 FLD6xm7tOzdl6EAoMkrVZiQUBue8lyLpH4iPvwSQQZXeG4IkVTgcD0xoPCjayP/A72D5
 1aXt0jRl0KNZfo8+Y8/QIJDtC1hloZQNQTg9uRbyjc+Ec3R0nX0wzjalwWcrH1cZXkmy
 fosA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=sAn5cuvrvObbrirdJ9LPZqlJB4AiM/uhIfkjT69O4Js=;
 b=l0DbojAmL51NW9hRRaLQcOH6rikKHPTGHuW+xe9YMlS5iLRDD2d9L00ZI+e/PbgPj9
 QQK4i6yuL5RBduqfGSrI+wyDV/oXFJy+ew/hAWUuBx+LROTqWo56ISqHoIyr2Ebu1lBs
 WpEjlkrrls6UwMK41BU3UtNwNDfQ02sY4vUWihiXKBjArq732TF+cLC45NddcHVOxQo8
 CA88nCyPJWRLnM4JqgTtW6shvqbYVlPxLcl+2n9nlEjwdIe3zSMk3sr8kj9i/OiUeCqQ
 guqwLZj2+h+WT0e9Lf47wIz/6qIyhLd8JTZH/+vg/5T1Z9i1BvC13GHrT3c5oaLoKZBH
 4a4A==
X-Gm-Message-State: AODbwcBIs6uqnfuGFSRklyEYj5fMHiUQNAgQM5ToyHcNIRoUkIJQiWGy
 4+ZcxzW207Ie3mn5
X-Received: by 10.46.9.146 with SMTP id 140mr492592ljj.42.1496586402302;
 Sun, 04 Jun 2017 07:26:42 -0700 (PDT)
Received: from leviafan ([217.107.194.134])
 by smtp.gmail.com with ESMTPSA id x24sm6257631ljd.5.2017.06.04.07.26.41
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Sun, 04 Jun 2017 07:26:41 -0700 (PDT)
From: Alex Kost <alezost@gmail.com>
To: ludo@gnu.org (Ludovic Courtès)
Subject: Re: bug#27155: [PATCH 0/2] Support service extensions on the "final"
 service values
References: <20170530215850.7522-1-ludo@gnu.org> <8737bgkbsy.fsf@gnu.org>
Date: Sun, 04 Jun 2017 17:26:41 +0300
In-Reply-To: <8737bgkbsy.fsf@gnu.org> ("Ludovic
 \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\=
 \=\?utf-8\?Q\?s\?\= message of "Sat, 03 Jun 2017 23:21:01 +0200")
Message-ID: <87o9u3q15q.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 27155
Cc: 27155@debbugs.gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: 0.5 (/)
Ludovic Courtès (2017-06-03 23:21 +0200) wrote:

> Ludovic Courtès <ludo@gnu.org> skribis:
>
>> This patch adds support for service extensions that modify the
>> "final" values of a service.  This is meant to implement cross-cutting
>> concerns as well as system-wide customization as discussed with Alex
>> long ago:
>>
>>   https://lists.gnu.org/archive/html/guix-devel/2015-11/msg00623.html
>>   https://lists.gnu.org/archive/html/guix-devel/2016-09/msg01505.html
>>
>> To summarize, a "finalization extension" (for lack of a better name)
>> gets the final value of a service and returns a new value for that
>> service.
>
> I found a better name: “customizations”.

I kinda like "finalization" more :-)  But "customization" is fine with
me, not a big deal.

>> For example, for the /etc service, a "normal" extension can only add
>> entries for /etc.  A "finalization" extension can instead inspect and
>> change all the /etc entries.  IOW, it is a sort of a "sudo" for service
>> extensions; it's also quite inelegant compared to the "normal" extension
>> mechanism, but it's certainly useful.
>
> Not liking the “sudo” aspect of this patch, I thought it would be
> natural if service types could control how customizations apply.  That
> way, the PAM or /etc service could still guarantee, for instance, that
> customization does not add or remove entries, and so on.

Ouch, that's what I don't like.  I think a full control is better.
You'll never know what a user might want to do, and giving a user a full
freedom (even to break a system!) would be a great feature.  So I'm
against such guarantees that strict users in modifying their systems.

> In the end, this control by the service type makes it easier to reason
> about what extensions do, whereas the “sudo” style means that an
> extension can alter the service’s value in any possible way.

Right, "any possible way" is exactly what I want!

> So I started modifying this patch set to add a ‘customize’ field to
> <service-type>, next to ‘extend’.  For the PAM and /etc services,
> ‘customize’ would compose and apply procedures that modify an entry, for
> instance.
>
> Then I realized that the only difference between ‘customize’ and
> ‘extend’ would be the meaning attached to it.  IOW, both are some kind
> of an extension.
>
> So at this point, I started wondering whether we should just allow
> service types to declare several extension points.  So for PAM, we’d do:
>
> (define pam-service-addition
>   ;; The extension point to add PAM services.
>   (service-extension-point
>     (compose concatenate)
>     (extend append)))
>
> (define pam-service-cutomization
>   ;; The extension point to customize PAM services.
>   (service-extension-point
>     (compose compose)
>     (extend append)))
>
> (define pam-root-service-type
>   (service-type (name 'pam)
>                 (extensions (list (service-extension etc-service-type
>                                                      /etc-entry)))
>
>                 (extension-points (list pam-service-addtion
>                                         pam-service-customization))))
>
> But then ‘service-extension’ would need to specify not only the target
> service type but also the target extension point, which means more
> boilerplate, etc.

I don't have a deep understanding of services, but your suggestion seems
(to me) to have the following downsides:

- More additional work – to determine (and implement) what aspects of
  services should and what should not be modified by a user.

- Less freedom (comparing to your previous solution) for users in
  modifying services.

> So after so much thought and hacking, I feel like the ad hoc solution at
> <https://lists.gnu.org/archive/html/guix-devel/2016-09/msg01505.html>
> was not that bad after all.

He-he :-)

> Sorry to bother you with philosophical design questions when we already
> have two ways to solve the problem at hand, but I feel like there’s a
> pattern worth looking for!

No problem, looking for patterns is always an interesting occupation!
As for me, I agree with any solution that allows me to replace
"/etc/profile".  But in general, I vote for that solution that allows
users to customize as much things as possible.

-- 
Alex




Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Tue Sep 9 15:48:07 2025; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.