From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8OkuENg96WJaHwEAbAwnHQ (envelope-from ) for ; Tue, 02 Aug 2022 17:08:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id yB81ENg96WI0PQAAauVa8A (envelope-from ) for ; Tue, 02 Aug 2022 17:08:08 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CD6EF3556B for ; Tue, 2 Aug 2022 17:07:46 +0200 (CEST) Received: from localhost ([::1]:54026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oItUn-0000TM-DV for larch@yhetil.org; Tue, 02 Aug 2022 11:07:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oItU7-0000SP-0s for bug-guix@gnu.org; Tue, 02 Aug 2022 11:07:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55009) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oItU6-0003hx-OV for bug-guix@gnu.org; Tue, 02 Aug 2022 11:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oItU6-0000kS-KQ for bug-guix@gnu.org; Tue, 02 Aug 2022 11:07:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#56799: (gnu services configuration) usage of *unspecified* is problematic Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 02 Aug 2022 15:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56799 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 56799@debbugs.gnu.org, attila@lendvai.name Received: via spool by 56799-submit@debbugs.gnu.org id=B56799.16594527882826 (code B ref 56799); Tue, 02 Aug 2022 15:07:02 +0000 Received: (at 56799) by debbugs.gnu.org; 2 Aug 2022 15:06:28 +0000 Received: from localhost ([127.0.0.1]:44757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oItTX-0000jV-CY for submit@debbugs.gnu.org; Tue, 02 Aug 2022 11:06:27 -0400 Received: from mail-qk1-f182.google.com ([209.85.222.182]:44641) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oItTV-0000jA-Fu for 56799@debbugs.gnu.org; Tue, 02 Aug 2022 11:06:26 -0400 Received: by mail-qk1-f182.google.com with SMTP id b25so10784029qka.11 for <56799@debbugs.gnu.org>; Tue, 02 Aug 2022 08:06:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=xmASlgGiiN0qWvjeMGLDi0Bd7i6AMMQCpCLJDf/6c+I=; b=ODxGj/uy6KJF9NIr2UZs+5CjM+zta38SKOPHdfzrtFiSprX7uqEBmZN+jMkcbmzsnr Bd4FS1Has2bmE3BC29Ychq/MO2dIU+/8hXKEHTPwiWgTq5Kf/PmvnVYdXR/9VjHRKiwn 80BPg52bn2eaqDQDFbo0fUU0HgCRiEzq2Q1S8UVQGCiuoe0K/vljHd1anBZMyuClY690 rKCeF1NIjE+aHanm+PwJ17JYqNi2ILtrru+XnRZZnnnlTsA5IHEfJfLpLiNGETbu4GfM I8Y8diCke/amkfPJ9OiBMVlcdw1K+BZnjIt6Sh9Y58ZRs7JjlVc2hiFDaGv+5yIDiRmj WE+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=xmASlgGiiN0qWvjeMGLDi0Bd7i6AMMQCpCLJDf/6c+I=; b=i0AGiY4rgsLAErDDurxPIYvCCOS5epEt/lC4+tZFkz4M3cSZfNuul8q7svwB6S8ZtJ 5w4IgsIC3gXkHVfLKTs/+/V1yel19hx2ao52Q1pq7dvM8r44n7A7mAuHZwFrMiUcahzv ybh7SMmn6KcBjd0vL1wNN9Esf40LADfR9Dlgds08+QRsN9x4LObsD0zqSOV7fDjog/JV GjOCZplKTSLMEkP9gkFbfvwgUy0cY+AbYenmRjnLS7h+dVUKESkfg8WIrfW/etPf4Ygx vgbGRMjJTLNmKnuE3AXx+/6BBLqJjJ4KDIl5gd+3MYRF8JzkZuf9U8OlClLBGJMNwL6N omXw== X-Gm-Message-State: AJIora98YDSl5bzK3XGe5Xb852b2kaxnImqIZIKvBjy6/40uMbaACqWF Kl9Z8fgEMfdjnGFFSitG17I= X-Google-Smtp-Source: AGRyM1vlwMTTeN0u78prPjydMVoGcC5WBSzeIBdImBAjoOjcjcSR0tEz5eoZY/G103O00R37LpGElQ== X-Received: by 2002:a05:620a:2556:b0:6a7:9f07:602 with SMTP id s22-20020a05620a255600b006a79f070602mr15248858qko.207.1659452779816; Tue, 02 Aug 2022 08:06:19 -0700 (PDT) Received: from hurd (dsl-151-182.b2b2c.ca. [66.158.151.182]) by smtp.gmail.com with ESMTPSA id h6-20020ac846c6000000b0033b6f4895afsm641137qto.42.2022.08.02.08.06.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Aug 2022 08:06:19 -0700 (PDT) From: Maxim Cournoyer References: <87o7xa8qxt.fsf@gmail.com> <8735egxedv.fsf@gnu.org> <87les82c2f.fsf@gmail.com> <87v8rbumnx.fsf@gnu.org> Date: Tue, 02 Aug 2022 11:06:17 -0400 In-Reply-To: <87v8rbumnx.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Tue, 02 Aug 2022 09:31:14 +0200") Message-ID: <87sfme1y8m.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1659452866; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=xmASlgGiiN0qWvjeMGLDi0Bd7i6AMMQCpCLJDf/6c+I=; b=lQKHJ3Fp5DhppYMUG+2UrEvSCZLo3uy9xR7dztQ9jvKWUyQm3vB9Ba0Q09dvg87Mionlhb yspP6U+bHehZRa3uEvkPApmLzRkUh45rKHPL07kTNgVZ/5zCWAaQBiahZTqgeBVEZ1Au/3 HsPxSCtnXsOcnoUB+aEGuYcrIRzE/D8l0KF/2lW6yRTiVn73xGwmkbc+gE25EMfpZfKjCQ pOHaDcIikoOB1j8O8VcU46syRik5N7YM24087ByXUFEkoEfxeqRpkOj8obSklFGTGQcaeW BWkdkXHf9x/g4X4ufQgG65CIqSmtGnVDN3y7Ndgz+Yq9ACBgVbrLvPALscgYOw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659452866; a=rsa-sha256; cv=none; b=o+keveBZbRzag1AbeTZcnw7RZfVEJ9zLvQRy7Eop87OHTsVB9rjc67ZWJI+d5zA73a25WJ dHvDsbcexFCmzIs2NDvw/H0VxwZTKRQiMST0bDE0arSOU7IeqJmKQWr3y9Q6ETpT4TOKSA R+BQ9ACHnuabijnwitGMb8yhRN8Y+703UXkfe75jtJ9FbQ89r8+/pxN5h/Xa0XaJgLdRIn Ok9f1PEkYWj9InyZ4ustZLjCCwOteX8Yx7JD0XiU6lqfPMROBqq5SyB7RE94Tr5X7+h4GF k4reoz8xrS/J21Cf4cVn4uFxht3Gtsyv/Jut8xQ9vKIBoYJoy9cLFM6IgqqZEw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b="ODxGj/uy"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.08 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b="ODxGj/uy"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: CD6EF3556B X-Spam-Score: 7.08 X-Migadu-Scanner: scn0.migadu.com X-TUID: ZMWcz3/WX3Fv Hi Ludovic, Ludovic Court=C3=A8s writes: [...] >> Granted, few services outside of Jami probably made use of this, but it >> was nevertheless a useful property. > > I don=E2=80=99t know of any. I think mostly because few services make use of define-configuration. While attempting to write a new VNC service, it quickly became a visible annoyance: --8<---------------cut here---------------start------------->8--- (define-configuration/no-serialization xvnc-configuration (xvnc (file-like tigervnc-server) "The package that provides the Xvnc binary.") (display-number (number 0) "The display number used by Xvnc. You should set this to a number not already used a Xorg server.") (geometry (string "1024x768") "The size of the desktop to be created.") (depth (color-depth 24) "The pixel depth in bits of the desktop to be created. Accepted values = are 16, 24 or 32.") (port maybe-port "The port on which to listen for connections from viewers. When left unspecified, it defaults to 5900 plus the display number.") (ipv4? (boolean #t) "Use IPv4 for incoming and outgoing connections.") (ipv6? (boolean #t) "Use IPv6 for incoming and outgoing connections.") (password-file maybe-string "The password file to use, if any. Refer to vncpasswd(1) to learn how to generate such a file.") (frame-rate (number 60) "The maximum number of updates per second sent to each client.") (security-types (security-types (list "None")) (format #f "The allowed security schemes to use for incoming connections. The default is \"None\", which is safe given that Xvnc is configured to authenticate the user via the display manager, and only for local connectio= ns. Accepted values are any of the following: ~s" %security-types)) (localhost? (boolean #t) "Only allow connections from the same machine. It is set to #true by default for security, which means SSH or another secure means should be used to expose the remote port.") (log-level (log-level 30) "The log level, a number between 0 and 100, 100 meaning most verbose output. The log messages are output to syslog.") (extra-options (strings '()) "This can be used to provide extra Xvnc options not exposed via this record.")) [...] (define (xvnc-shepherd-service config) "Return a for Xvnc with CONFIG." ;; XXX: Ensure all the *unspecified* values are handled outside of gexps,= as ;; they are not valid gexp input (they are not self-quoting/serializable). ;; This would otherwise cause problem during 'guix deploy'. (let* ((display-number (xvnc-configuration-display-number config)) (port (if (unspecified? (xvnc-configuration-port config)) #f (xvnc-configuration-port config))) (port* (or port (+ 5900 display-number))) (inaddr (if (xvnc-configuration-localhost? config) INADDR_LOOPBACK INADDR_ANY)) (in6addr (if (xvnc-configuration-localhost? config) IN6ADDR_LOOPBACK IN6ADDR_ANY)) (ipv4-socket (and (xvnc-configuration-ipv4? config) (make-socket-address AF_INET inaddr port*))) (ipv6-socket (and (xvnc-configuration-ipv6? config) (make-socket-address AF_INET6 in6addr port*)))) (shepherd-service (provision '(xvnc vncserver)) (documentation "Run the Xvnc server.") (requirement '(networking syslogd)) (start #~(make-inetd-constructor #$(xvnc-configuration->command-line-arguments config) `(,@(if #$ipv4-socket (list (endpoint #$ipv4-socket)) '()) ,@(if #$ipv6-socket (list (endpoint #$ipv6-socket)) '())))) (stop #~(make-inetd-destructor))))) --8<---------------cut here---------------end--------------->8--- As you can see, the *unspecified* values need to be carefully massaged out before starting to assemble the G-exp, as they aren't valid G-Exp inputs. > Having spent time reviewing the original change that Attila proposed and > then chiming in on this issue, I would have hoped for a longer > discussion before enacting the change in > a2b89a3319dc1d621c546855f578acae5baaf6da. OK. > In addition to these issues around the process, I think we should strive > for more stability. One of the reasons it took time to review > is that interface changes are a > commitment. Now commit a2b89a3319dc1d621c546855f578acae5baaf6da > introduces a second interface change for reasons that are unclear to me > (if the conclusion had been to revert, I=E2=80=99d have favored an actual= revert > rather than introducing 'unset). I like to think of *unspecified* or 'unset as an uninteresting implementation detail that shouldn't be part of the public API. It's an implementation detail of the 'maybe' types/predicates generator of the (gnu services configuration) machinery. Perhaps we could introduce a 'maybe-set?' predicate to check them, to avoid leaking the implementation detail (the 'unset symbol). Also, after reading more on the topic, it became clear to me that *unspecified* is not meant as a value to be actively used by programmers in Scheme; it seems it's rather a value meant to be returned when the behavior of a procedure is unspecified [0]. Why 'unspecified?' even exist in Guile I don't know, I suppose because of some disagreement on the matter, as hinted in the previous link. The reason I did not simply revert was because the change also introduced something useful in the same code change, which is to lift the requirement to specify a default value for maybe-* fields. > How should we move forward? Perhaps we can discuss any issues I may have missed that arise from the this change, or possible future directions that would improve things. Thanks, Maxim [0] https://scheme-reports.scheme-reports.narkive.com/QSQtJSAh/unspecified= -values