From unknown Sun Aug 17 04:15:29 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#53663 <53663@debbugs.gnu.org> To: bug#53663 <53663@debbugs.gnu.org> Subject: Status: [PATCH] gnu: services: Also accept 'undefined in maybe-foo? constructs. Reply-To: bug#53663 <53663@debbugs.gnu.org> Date: Sun, 17 Aug 2025 11:15:29 +0000 retitle 53663 [PATCH] gnu: services: Also accept 'undefined in maybe-foo? c= onstructs. reassign 53663 guix-patches submitter 53663 Attila Lendvai severity 53663 normal tag 53663 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 31 10:34:48 2022 Received: (at submit) by debbugs.gnu.org; 31 Jan 2022 15:34:48 +0000 Received: from localhost ([127.0.0.1]:40290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEYhc-0000mr-8u for submit@debbugs.gnu.org; Mon, 31 Jan 2022 10:34:48 -0500 Received: from lists.gnu.org ([209.51.188.17]:48278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEYha-0000mj-63 for submit@debbugs.gnu.org; Mon, 31 Jan 2022 10:34:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEYhZ-0003zI-SK for guix-patches@gnu.org; Mon, 31 Jan 2022 10:34:45 -0500 Received: from [2a00:1450:4864:20::429] (port=38898 helo=mail-wr1-x429.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nEYhY-0007m8-56 for guix-patches@gnu.org; Mon, 31 Jan 2022 10:34:45 -0500 Received: by mail-wr1-x429.google.com with SMTP id c23so26176875wrb.5 for ; Mon, 31 Jan 2022 07:34:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GRwAtcQB5pFFzmOWItCPdJNgBWusdmyVGoyN00Sgcd0=; b=LaALMnKgyjdVcda6k1u6FDjL4uWorEdxc1J0unwLmIxPlXEjIde83ZgGHB+Mj8I385 19mS/knSAIjU2lrxp90Nc5XLtK7vUjzW50Vw22X3TSy45cCvgdKPpI/3GkeRtu7PJf1c 7Ueh0JytnxjjclRIYRwTjLqd+59gntlgWrkaUV3yq6IBhsOr3j88onAfCYTmtMlFmaSz 6721mFztanTLky8f9QbyOwEiwdDpDp1EfCB8v8gbmPdfxWtBCH9gxsWAG7eQuD0SCn44 8EhedHQEaUo/NUrmE7VsAj0615y8xfh39VLLJBFndgls0toElgE/uNUkuOKx4dM6M99K ClXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=GRwAtcQB5pFFzmOWItCPdJNgBWusdmyVGoyN00Sgcd0=; b=hKiXo/lz+2GzuSv95Nci3Z7PxhcWzbH1l9foM77f1dIZw7QZv4BL8iNRK7tHxG57gq j5hFsQgiBdroSme4G4kDhG00AjaGGa5qEtRVqpjeTX96NOPFusVO/RsFD19ZETSpNi9D xrGjFWgs0WFE6KcaHPMAi4PHSpLvlCT3TPHT+yRGd3V2KdAaf7jOq2iu1RU61pPoZ3pn CyjYdd8khrMsQex1wqPRGhw5+xEL36mnF+znoGEu3IQqFgnmawUKOmMLe6fTK6gmtuJ8 cWaH9OMTcnteY7RfTu9p3S2aaYgsj3FqluSw416DvB0m6D39H2GNE0dquvi0SUovXvw6 T0Ig== X-Gm-Message-State: AOAM5338Fw63eINwDjPv0yuNjF+hvrw74qer3+H50Fsj35VUa1HhHnqU RBZsfGIEb6eY+c5iDo1cIYr43MTDHlg= X-Google-Smtp-Source: ABdhPJzk04LdSYoLwkBxfQOlkMYOglPMqt3Q3fJH3HRmRczia9bcK9N+gZm+MUor1uDwsDzBQIlvww== X-Received: by 2002:a17:907:7e9f:: with SMTP id qb31mr17466522ejc.468.1643642905571; Mon, 31 Jan 2022 07:28:25 -0800 (PST) Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu. [89.132.245.188]) by smtp.gmail.com with ESMTPSA id a26sm13688815ejy.105.2022.01.31.07.28.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 07:28:24 -0800 (PST) From: Attila Lendvai To: guix-patches@gnu.org Subject: [PATCH] gnu: services: Also accept 'undefined in maybe-foo? constructs. Date: Mon, 31 Jan 2022 16:27:54 +0100 Message-Id: <20220131152753.19880-1-attila@lendvai.name> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::429 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=attila.lendvai@gmail.com; helo=mail-wr1-x429.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: submit Cc: Attila Lendvai X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.8 (-) This is a temporary bandaid until a more explicit handling of maybe types is introduced for configurations (e.g. by using srfi-189). Until then, with this change it becomes possible to have definitions like: (define-maybe string (no-serialization)) (define-configuration my-configuration (my-field (maybe-string)) (no-serialization)) i.e. without providing a default value for MY-FIELD. --- gnu/services/configuration.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm index 0de350a4df..c5f276eab5 100644 --- a/gnu/services/configuration.scm +++ b/gnu/services/configuration.scm @@ -141,7 +141,9 @@ (define (define-maybe-helper serialize? prefix syn) (id #'stem #'serialize-maybe- #'stem)))) #`(begin (define (maybe-stem? val) - (or (eq? val 'disabled) (stem? val))) + (or (eq? val 'disabled) + (eq? val 'undefined) + (stem? val))) #,@(if serialize? (list #'(define (serialize-maybe-stem field-name val) (if (stem? val) -- 2.34.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 04:53:49 2022 Received: (at 53663) by debbugs.gnu.org; 1 Feb 2022 09:53:49 +0000 Received: from localhost ([127.0.0.1]:41779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEprB-0000Uh-0P for submit@debbugs.gnu.org; Tue, 01 Feb 2022 04:53:49 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:52706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEpr9-0000UT-56 for 53663@debbugs.gnu.org; Tue, 01 Feb 2022 04:53:47 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 984141DD; Tue, 1 Feb 2022 10:53:40 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y3O71nyLayur; Tue, 1 Feb 2022 10:53:39 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id DDAE813D; Tue, 1 Feb 2022 10:53:38 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Attila Lendvai Subject: Re: bug#53663: [PATCH] gnu: services: Also accept 'undefined in maybe-foo? constructs. References: <20220131152753.19880-1-attila@lendvai.name> Date: Tue, 01 Feb 2022 10:53:38 +0100 In-Reply-To: <20220131152753.19880-1-attila@lendvai.name> (Attila Lendvai's message of "Mon, 31 Jan 2022 16:27:54 +0100") Message-ID: <87ilty6hgd.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: 984141DD X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; SUBJECT_HAS_QUESTION(0.00)[] X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 53663 Cc: 53663@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi! Attila Lendvai skribis: > This is a temporary bandaid until a more explicit handling of maybe types= is > introduced for configurations (e.g. by using srfi-189). Until then, with = this > change it becomes possible to have definitions like: > > (define-maybe string (no-serialization)) > > (define-configuration my-configuration > (my-field (maybe-string)) > (no-serialization)) > > i.e. without providing a default value for MY-FIELD. > --- > gnu/services/configuration.scm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.= scm > index 0de350a4df..c5f276eab5 100644 > --- a/gnu/services/configuration.scm > +++ b/gnu/services/configuration.scm > @@ -141,7 +141,9 @@ (define (define-maybe-helper serialize? prefix syn) > (id #'stem #'serialize-maybe- #'stem= )))) > #`(begin > (define (maybe-stem? val) > - (or (eq? val 'disabled) (stem? val))) > + (or (eq? val 'disabled) > + (eq? val 'undefined) > + (stem? val))) My understanding is that 'disabled is here precisely to allow users to not provide a value, in which case the generated configuration file will not contain anything for that field. What would be different here? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 02 06:47:13 2022 Received: (at 53663-close) by debbugs.gnu.org; 2 Feb 2022 11:47:13 +0000 Received: from localhost ([127.0.0.1]:51691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFE6T-0002ya-Hx for submit@debbugs.gnu.org; Wed, 02 Feb 2022 06:47:13 -0500 Received: from mail-4317.proton.ch ([185.70.43.17]:49617) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFE6R-0002yI-7g for 53663-close@debbugs.gnu.org; Wed, 02 Feb 2022 06:47:12 -0500 Date: Wed, 02 Feb 2022 11:47:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail3; t=1643802422; bh=qUFV4T7ycyk+EJU0dHA2uqBh23xECrqauuU68Qx2d90=; h=Date:To:From:Reply-To:Subject:Message-ID:In-Reply-To:References: From:To:Cc; b=P0WdZ5jvjqJGZTftoO6dKLFN1TInFycOKhqS/Ac94RN5EPRJJ4BdOmiMVDzO50LiN TAfdBzmBNXFJIrPHHsNYUvKR7rLI8nj+Bu+4ZONrsqVPKyV6KTuqfDsUiA1Fj6OoI5 R627zLmDPES9rBuZaeWFQ2KFWG2Lkpiy8lxvC47tyG5PiDA9DZ601MElUmo5Pyws2W LAUIkPNd5p0KB4ZlWSEZMKGPrHxSjqZT7SIfdDd33kQlMOlzv7uFmSfFH/+oKhWru2 BLulK0PBEZRd5qvo0/26n0Pc8zqc2V80WBm2FibB/G82ptw5Ekpn49FKbothyaztTN IBAcbjJi/EtCQ== To: "53663-close@debbugs.gnu.org" <53663-close@debbugs.gnu.org> From: Attila Lendvai Subject: Fw: Re: bug#53663: [PATCH] gnu: services: Also accept 'undefined in maybe-foo? constructs. Message-ID: In-Reply-To: References: <20220131152753.19880-1-attila@lendvai.name> <87ilty6hgd.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53663-close X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Attila Lendvai Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > What would be different here? the possibility of writing: (define-configuration my-cfg (my-field (maybe-string))) versus now having to write: (define-configuration my-cfg (my-field (maybe-string 'disabled))) but now that i thought about it, i think everyone is better off if i deal with this on my side, instead of having a discussion about the exact shape of a bandaid. closing this for now; more later in the form of a proper cleanup proposal of the configuration code. -- =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CThere can be no greater stretch of arbitrary power than is require= d to seize children from their parents, teach them whatever the authorities= decree they shall be taught, and expropriate from the parents the funds to= pay for the procedure.=E2=80=9D =09=E2=80=94 Isabel Paterson (1886=E2=80=931961), 'The God of the Machine' = (1943) From unknown Sun Aug 17 04:15:29 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 02 Mar 2022 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator