From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SCCRMzWO8WJNfAAAbAwnHQ (envelope-from ) for ; Tue, 09 Aug 2022 00:29:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id aLPKMjWO8WLZ8QAAG6o9tA (envelope-from ) for ; Tue, 09 Aug 2022 00:29:09 +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 3F3E223B55 for ; Tue, 9 Aug 2022 00:29:08 +0200 (CEST) Received: from localhost ([::1]:58242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLBFD-0007H8-4b for larch@yhetil.org; Mon, 08 Aug 2022 18:29:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLBEJ-0006gh-91 for bug-guix@gnu.org; Mon, 08 Aug 2022 18:28:11 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52356) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oLBEA-0000SV-S3 for bug-guix@gnu.org; Mon, 08 Aug 2022 18:28:10 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oLBEA-00023o-Iq for bug-guix@gnu.org; Mon, 08 Aug 2022 18:28:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#56799: (gnu services configuration) usage of *unspecified* is problematic Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 08 Aug 2022 22:28: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, Maxim Cournoyer Received: via spool by 56799-submit@debbugs.gnu.org id=B56799.16599976767909 (code B ref 56799); Mon, 08 Aug 2022 22:28:02 +0000 Received: (at 56799) by debbugs.gnu.org; 8 Aug 2022 22:27:56 +0000 Received: from localhost ([127.0.0.1]:42105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLBE4-00023V-9p for submit@debbugs.gnu.org; Mon, 08 Aug 2022 18:27:56 -0400 Received: from mail-4323.proton.ch ([185.70.43.23]:43951) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLBDx-000237-OL for 56799@debbugs.gnu.org; Mon, 08 Aug 2022 18:27:54 -0400 Date: Mon, 08 Aug 2022 22:27:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail; t=1659997662; x=1660256862; bh=aPyh9X4LlfcUISUIfc2HfLmDM6Tfjhrgx8/+ASvMTVs=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=VRz9pwjnyuQmj1zVu8qGqUxC+4rvVkYDJeEpvmE5gDV84KpJuh5eZBP5wo6VMCJFD KbVBEJu1Vbf3o0LpzTMKbqArNxSlslKhZ+GVTXNzKbXdAKABafnYIjuhZXG/C2dFaE NDiMvyr+48EZSfK5Oh9Fjz5MHIo9vuwbFJzLKKi+mS6U+WRQDhtUU8TeLmvgsbVYw7 2iF2qan7MnxfSq7AfmRMx7PXnZjTvWoBh6jePr5BjZTCFtYiJi8fXG+pp6jfqx4D7b BYe2oV2eCIMXYdhws4F+UAYwqy3I9TNvjNjWGwd8Spm/gmt0zCMpUzw8ZX6TXDKilM RL64rSLSXS99A== From: Attila Lendvai Message-ID: In-Reply-To: <877d3omc9c.fsf@gnu.org> References: <87o7xa8qxt.fsf@gmail.com> <8735egxedv.fsf@gnu.org> <87les82c2f.fsf@gmail.com> <87v8rbumnx.fsf@gnu.org> <87sfme1y8m.fsf@gmail.com> <877d3omc9c.fsf@gnu.org> Feedback-ID: 28384833:user:proton 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: , Reply-To: Attila Lendvai 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=1659997749; h=from:from:sender:sender:reply-to: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=aPyh9X4LlfcUISUIfc2HfLmDM6Tfjhrgx8/+ASvMTVs=; b=DXF0M+CoEGbJ4KfmPjWF5xFI6r/xwajhIg5uF5/1GiTRKnO5h7+d+5LagVt07oluCxreHV SRZxOcKgD3Mm01vtBWDigWczrcrag/iXJsV/Yfv6Uoz5NrcCl/Ockvm6kpQRgK9+nTtjJx EEBj4DobqZW/jlcHWp1BtQ7Gb+3fw1ZlmWRjF7ZSzsSZ5Jww6blkvu9zw8S7LbHLostWcY vrYL9W0dsw/mAWCYcnAZU1LFrIciEREYojGDvDc/LA7uQSlzCNjZ3MwxnZKKS364lNPsbJ KLOr+/P/+eGhcsh/vQ/38GcmEq0Pdjo/9HJiWBEwwpMfU5ZlQz9dVMUJb/fnHg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659997749; a=rsa-sha256; cv=none; b=cXuLmTeJ7XTBga5cHd8PDZlRA0qna1M6Y9SgLDOqqGRtmliPkv9cCHhEPTGO4xfJEvx7vV pspyJF68VSB/CSpSkiXhI/aNnjWv4WGYwpbxljj41JLhhibCbCrPjm6OvgP6X/Rk1hz/rP lYpWHEdijXSggapqK7NF3eH2cVqbGbB4efeC90ou207oLIQmR761iGKDbA2GwD58MAgKq1 Fazy6vYnQx3tKdn3kAuFfhXesVRcl3a8bS60MkJWck2jlQJOdP4nt5A8V8sVDmQrF0AzRV 1XoFLPhaOP6frikbbjxx9Lh+qb+L9M5+RosCmLYXSc+ghRoa93P7H+5x52I+OQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lendvai.name header.s=protonmail header.b=VRz9pwjn; dmarc=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: 0.60 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lendvai.name header.s=protonmail header.b=VRz9pwjn; dmarc=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: 3F3E223B55 X-Spam-Score: 0.60 X-Migadu-Scanner: scn0.migadu.com X-TUID: +U24soG4z6GE i got back online... > That said, whether it=E2=80=99s =E2=80=98unspecified?=E2=80=99 or somethi= ng else, you have to > have a check in place, right? With the new interface it becomes: > > (if (eq? port 'unset) #f port) > > Or you can provide an actual default value (an integer in this case), > but that=E2=80=99s possible whether or not unspecified is the default val= ue. i agree. > With the xvnc example, I better understand the kind of situation where > a field value might end up directly in a gexp, though I=E2=80=99m still u= nsure > whether use of unspecified really makes things worse. At least, > because it lacks a read syntax, the problem is caught early on; whereas > with 'unset, you might end up stuffing 'unset in your config file > without noticing. i agree with this, too. also, seems like it didn't register in this discussion, so i press it once = again: if the default/unspecified value is a symbol (any symbol), then thos= e configuration fields, whose type is set to be of symbol, will not error w= hen they are left unspecified. (see the FIELD-SANITIZER: it simply does a (= IF (PRED VALUE) ...) check, which doesn't fail because 'UNSET satisfies SYM= BOL?). i should have added a unit test for this... i think moving back from *UNSPECIFIED* to using 'UNSET only has drawbacks. = and if it works (read: it doesn't error out while guix is deploying the con= fig), then it probably produces illegal config files by serializing the uns= pecified value into an "unset" string in the config files. i'm obviously not aware of the entire complexity here, othrwise there would= n't have remained a bug... but regardless of the actual API/value used, i d= on't see how any of this could work without the service code explicitly che= cking for the unspecified value for fields that have a maybe type (i.e. who= se type allows the value to be unspecified). i think using a symbol instead= of *unspecified* only pushes the appearance of the symptoms farther away b= oth in time and space (otherwise there should have been a trivial fix to th= is without changing *unspecified* back to 'unset). either way, if there was a failing test case that i could run locally, then= i would have been more than happy to fix it... now i'm only dismayed that = all my service code, and my entire channel got broken. seems like i went of= fline in the worst two weeks. sidenote: what srfi-189 does is basically introduce such a special value th= at we are trying to hone in on here (i.e. Nothing, which is implemented as = a record instance) in a standardized way, and also an API to deal with this= special value in various different contexts (i.e. it exports stuff like MA= YBE-IF, MAYBE-FOLD, MAYBE-AND, etc). https://srfi.schemers.org/srfi-189/srfi-189.html -- =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CAlthough teachers do care and do work very, very hard, the institu= tion is psychopathic-it has no conscience. It rings a bell and the young ma= n in the middle of writing a poem must close his notebook and move to a dif= ferent cell where he must memorize that humans and monkeys derive from a co= mmon ancestor.=E2=80=9D =09=E2=80=94 John Taylor Gatto (1935=E2=80=93), 'Dumbing Us Down: The Hidde= n Curriculum of Compulsory Education' (1992)