From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id cOe+IOQcBmOtrwAAbAwnHQ (envelope-from ) for ; Wed, 24 Aug 2022 14:43:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cBe3IOQcBmOCJAEA9RJhRA (envelope-from ) for ; Wed, 24 Aug 2022 14:43:16 +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 3903B164BC for ; Wed, 24 Aug 2022 14:43:16 +0200 (CEST) Received: from localhost ([::1]:46222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQpj0-0006G6-OG for larch@yhetil.org; Wed, 24 Aug 2022 08:43:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQphs-0005QL-Ao for bug-guix@gnu.org; Wed, 24 Aug 2022 08:42:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56180) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQphr-0000nK-LB for bug-guix@gnu.org; Wed, 24 Aug 2022 08:42:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oQphr-00083X-HZ for bug-guix@gnu.org; Wed, 24 Aug 2022 08:42:03 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#56799: [PATCH 5/5] services: configuration: Change the value of the unset marker. Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 24 Aug 2022 12:42:03 +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: 56799@debbugs.gnu.org Cc: Attila Lendvai Received: via spool by 56799-submit@debbugs.gnu.org id=B56799.166134488830896 (code B ref 56799); Wed, 24 Aug 2022 12:42:03 +0000 Received: (at 56799) by debbugs.gnu.org; 24 Aug 2022 12:41:28 +0000 Received: from localhost ([127.0.0.1]:45925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQphI-00082F-0x for submit@debbugs.gnu.org; Wed, 24 Aug 2022 08:41:28 -0400 Received: from mail-ej1-f46.google.com ([209.85.218.46]:44779) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQphG-00081r-3r for 56799@debbugs.gnu.org; Wed, 24 Aug 2022 08:41:26 -0400 Received: by mail-ej1-f46.google.com with SMTP id kk26so3570657ejc.11 for <56799@debbugs.gnu.org>; Wed, 24 Aug 2022 05:41:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc; bh=EuEvu/m9vTXP1uhe7xfafXSMjQnu6BZ8kJH9HxLCMIg=; b=chTo7j83JRFaqHFyCC7W5THZmDZTCu+D4jeWM3q4cWqm6X/LXvUXuADczjmWNEuTiC Fm498iXnt1geNXx1R0AtijztQBbQxtr6l4hCTJW2MQtqVlqdX7vHQ/siIK5xzsbJAeQm Up+/2sRZA5evg2ukRQjIBVqQLbTabHJ2TRS1/JKe5HvnNYisNetKgLqOJwCYU5i4onPl EsGfQPqfwYWIv03sGBTlfsjmWqDcLUqSz92hLkjOFF/unGjQ3cRorYArnpyhBzOj2aO/ xos+8iks7XorcPXNcGbbx6Gm/9yAsOrrXfVjlS4WYLeLhFirKXLNrVlwEoccpG2lQYd0 HzKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc; bh=EuEvu/m9vTXP1uhe7xfafXSMjQnu6BZ8kJH9HxLCMIg=; b=DVeRI4BU77nA2e4SkpGLIKXcNmlJv6PeHeW/2Jo5XXX1qyiDVq6fE2ZnZENmB3yRs4 u3w0zuQYeNqRVDGDi0FBFP/1LHlvNIhGGMXBEnlZGQ4VdjYpATOumYlBLNC39SxAc7OS 9ISioPl1UF4mGG7xcpX6RGk/WYftuCJBYbG/bT2IjHsvDpN3qE/EG3Dybw4g5b8E7gk6 y+TzwGDZjABGMqXREs2vq1zCTGIy4IfBOI7w3M2i7S7+NIYgMXaWhie9N+r9enF/6US+ 0pCMchG5hdtALze4flaAqXq4pkE6Oj4RLLsXJ5j/Uqqw+e2Lvikypj53lMVU86+kc8UH Njjw== X-Gm-Message-State: ACgBeo2QBLQn0nMsqmS8Ph+WqHcnt0mhORDfBbWl7oyl0zaRv3VJWfvL VFbdE+yR0VUgM9hljuhXH9utKvdDE0w= X-Google-Smtp-Source: AA6agR6FQmqaQAM4kqCtU92y8F1SDmBsuHTws7BgPoOGcqD0R4g7/fDopN8uLrNpmBj5+qpVqI87GA== X-Received: by 2002:a17:907:75f0:b0:73d:c3ca:6731 with SMTP id jz16-20020a17090775f000b0073dc3ca6731mr699666ejc.470.1661344879301; Wed, 24 Aug 2022 05:41:19 -0700 (PDT) Received: from localhost.localdomain ([2a02:ab88:7509:f780:ed82:a496:f55:e07b]) by smtp.gmail.com with ESMTPSA id f2-20020a17090631c200b006fee7b5dff2sm1114628ejf.143.2022.08.24.05.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 05:41:18 -0700 (PDT) From: Attila Lendvai Date: Wed, 24 Aug 2022 14:40:42 +0200 Message-Id: <20220824124042.10959-5-attila@lendvai.name> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220824124042.10959-1-attila@lendvai.name> References: <20220824124042.10959-1-attila@lendvai.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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=1661344996; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=EuEvu/m9vTXP1uhe7xfafXSMjQnu6BZ8kJH9HxLCMIg=; b=HzlFnBdK7xyangnniFU0IPsWqm+CDfn3tyLknOk5xZGkoxAwhyr3CvM2uTt3zGVU4Ukk7U 44a+s182/5WvYWBZNz2yY7e81l6o2EebmFDvR6awRC5xM69UliaVx6PAsgN39yANz8NIvT guZ4/izd8kfDajVRzLNTfMqu6l6SGSoEsg/mGAltviWJ5FLxpvY73KVoyrk+COuR592Kmf 1lEDjSxCZFpNKvQ9MKf/QQ/gG3qdgzsl0XkHLpNT/xdFIiLIWC5lj3YFkqkCATxfevx4h4 BydK3iFUp0lvuFpab5QNBTK96ahyaNWBO5X8YbIQrnJ1GPYJZMzIWLIPt55rLQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661344996; a=rsa-sha256; cv=none; b=Y660k7rsMSfAHif6zbbHPAKDOVDE4yu8I6kpUPMvVohafolcJjHa4PsN7IanpjLtdSVXy3 +E8QsZqHvCSsZrgli2uJZQ8Tig1Rj9qufLbz/JkpxRtw9C9yFuoio8YDrF9TDIXftqT7oR OzdAw1NYmUysEJ986QHRb9SeO1RVYVoN+jXmWMbeI+d2t0Cm8QEjW+GFQ9zf06iZVd3IKL vm4yn9o9JMhhvzmoR2nludlLEpxd/Kc6Yqmc49ovH3uvsO88XPmxyqi406wDNR+hlSMoGX vRRsR7l4alQM4EthEsSZEQiVsNz6F9sMDgA/sBdmspY6CGe+4HJZX7EsPBLF9Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=chTo7j83; 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: 4.19 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=chTo7j83; 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: 3903B164BC X-Spam-Score: 4.19 X-Migadu-Scanner: scn1.migadu.com X-TUID: pIanKmY8cuyx The new value of %unset-value sticks out more when something goes wrong, and is also more unique; i.e. easier to search for. --- gnu/services/configuration.scm | 5 +++-- gnu/services/messaging.scm | 2 +- tests/services/configuration.scm | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm index 60965486a7..83da63c1b3 100644 --- a/gnu/services/configuration.scm +++ b/gnu/services/configuration.scm @@ -305,12 +305,13 @@ (define serialize-package empty-serializer) ;; Ideally this should be an implementation detail, but we export it ;; to provide a simpler API that enables unsetting a configuration -;; field that has a maybe type, but also a default value. +;; field that has a maybe type, but also a default value. We give it +;; a value that sticks out to the reader when something goes wrong. ;; ;; An example use-case would be something like a network application ;; that uses a default port, but the field can explicitly be unset to ;; request a random port at startup. -(define %unset-value 'unset) +(define %unset-value '%unset-marker%) (define (maybe-value-set? value) "Predicate to check whether a 'maybe' value was explicitly provided." diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm index 59cb486778..02712ede7c 100644 --- a/gnu/services/messaging.scm +++ b/gnu/services/messaging.scm @@ -95,7 +95,7 @@ (define (make-pred arg) ;; doesn't interfere with ;; define-configuration and define-maybe ;; internals. - #''unset def)) + #''%unset-marker% def)) #'(def ...) #'(target ...))) ((new-doc ...) (map (lambda (doc target) diff --git a/tests/services/configuration.scm b/tests/services/configuration.scm index 8ed4ed4b66..4f8a74dc8a 100644 --- a/tests/services/configuration.scm +++ b/tests/services/configuration.scm @@ -150,7 +150,7 @@ (define-configuration config-with-maybe-symbol (protocol maybe-symbol "")) ;;; Maybe symbol values are currently seen as serializable, because the -;;; unspecified value is 'unset, which is a symbol itself. +;;; unspecified value is '%unset-marker%, which is a symbol itself. ;;; TODO: Remove expected fail marker after resolution. (test-expect-fail 1) (test-equal "symbol maybe value serialization, unspecified" -- 2.35.1