From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Wingo Subject: Re: Service refactoring Date: Tue, 08 Sep 2015 12:33:17 +0200 Message-ID: <871te9dwuq.fsf@igalia.com> References: <87a8t3mc2v.fsf@netris.org> <87d1xyk45i.fsf@igalia.com> <87vbbn44zi.fsf_-_@gnu.org> <87fv2pe1qx.fsf@igalia.com> <87mvwxmd8s.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZGDO-000248-Lg for guix-devel@gnu.org; Tue, 08 Sep 2015 06:33:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZGDK-000417-ES for guix-devel@gnu.org; Tue, 08 Sep 2015 06:33:26 -0400 In-Reply-To: <87mvwxmd8s.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Tue, 08 Sep 2015 12:12:03 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org Hi! Some thoughts but I am interested to see your results, your approach sounds good. On Tue 08 Sep 2015 12:12, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > An issue is that each finalization procedure is passed more information > than strictly needed. Thus, any service can potentially influence any > other service=E2=80=99s configuration, which makes it harder to reason ab= out > service composition. Good point. > Another problem is that it=E2=80=99s not really extensible: we=E2=80=99ll= have to keep > adding new fields to every time we think of a new way a > service needs to extend another service. We could use an alist instead > of those record fields, but then that would make the thing sloppy (typos > would go undetected, etc.) On the scale of badness, this to me is bad but not so bad. How many of these kinds of services will there be? I am guessing like 6 or so (pam, udev, dbus, polkit, file systems, dunno). It's manageable. If you extend services as first-class values -- is this your proposal? -- that gets more precise, but then you have the problem of -- well let's say that desktop.scm defines dbus-service, which is a factory procedure. What would elogind-service capture? Would you have to pass in the value of the instantiated dbus service in your (operating-system (services _))? > There=E2=80=99s also the assumption that each service that the user speci= fies > maps to a dmd service, which is not always the case (D-Bus services, > Apache modules, etc.) Good point... > Lastly, without making the =E2=80=9Cextends=E2=80=9D relations explicit, = it=E2=80=99s easy to > end up specifying an extension that actually extends nothing. For > instance, you use a service that has a non-empty =E2=80=98dbus-services= =E2=80=99 field > but forget to use the D-Bus service; Guix has no way to tell that > something=E2=80=99s missing. This is only the case if you have an open extension set. If the extension set is closed, like the set of fields is closed, we can add custom logic. > What I suggested would address these by constraining things. What > remains to be seen is if this can be implemented without making things > too complex. I=E2=80=99ll try to experiment with this. Good luck :) Looking forward to see what you come up with. Cheers, Andy