From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iOI/D2ddgGAbyAAAgWs5BA (envelope-from ) for ; Wed, 21 Apr 2021 19:14:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id UMURC2ddgGC7HgAA1q6Kng (envelope-from ) for ; Wed, 21 Apr 2021 17:14:15 +0000 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 E03041B2A0 for ; Wed, 21 Apr 2021 19:14:14 +0200 (CEST) Received: from localhost ([::1]:50116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZGQX-0004ZG-Uk for larch@yhetil.org; Wed, 21 Apr 2021 13:14:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZGQP-0004Z8-1c for guix-devel@gnu.org; Wed, 21 Apr 2021 13:14:05 -0400 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]:40692) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lZGQN-0000Dy-IE; Wed, 21 Apr 2021 13:14:04 -0400 Received: by mail-qt1-x833.google.com with SMTP id o21so3671212qtp.7; Wed, 21 Apr 2021 10:14:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=ZT+PnLv1fU5lQ4gqAExP5/xaxgym1llRIg5x9rbIwBY=; b=pYbxLArAVOE1RkznLtBd2b+4FCKOxuEPB4tPfYYrz9V/AsSGlQBvu5+C2vQJnuOU1z IGKQGMZJNmOUNKSNXL2jASqflb7DRrFOKLWie5++QvvxHM1NR7WFqj6hgKt26zyHGrJ7 CeKhrUXjdsDC79wVxBubzrEsQlr8Ev5/oRg+ISBqsNwJeZY+Tpll3PJmKn653PzrsG15 ojEqWVV7QNzM/eb5y72FLF7RotBYvYZAfuYuCqNhqJF5Pq52mHpqPKDGBXxBUxxeOWIb SmC7oYHmP88W0cQDwSkg+FJPTWuqfduvZGMw1lUqOeJ/70el/CvAlpGHKM02DsjLoLWs lhFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=ZT+PnLv1fU5lQ4gqAExP5/xaxgym1llRIg5x9rbIwBY=; b=Uu4qQcxtqTZARpCw7soc5T/HDQk/CXFcim0Cn039XqPwYeH8sH1WoK96Ryn/E3DOVl fJu8u8OtgMyuSY9OYMPRBGczF1+lk1A8c8W363e1OeiEG5CcalnYEdL5C/MV/iHh58fb xfxTGQoAA8CK4g66fab6JanD1zDDrAK2kYwBlBFKZexnmPSWEsoLtlJ7nhtV8i+huDbQ WApgwa7MkfGPabMvYq2tvhGF78tDLUWxCxyQw/G/NTinP7EWjU7BUEarbcI060Snpt9t Dv/BKglpn0RgAPx0cjx77bhIylGGKHFgSsXqnUdj63yOQWku3VOJ2JwXpcsQelipbmxW aFbA== X-Gm-Message-State: AOAM5317wFJPDCsL1d7h791EJ55UCb8BtpaSo85DXmtpbx8nfwt1IYC1 diaqIx1EZccUpCK0b4tuhiR+nzyr/X8EqA== X-Google-Smtp-Source: ABdhPJxNsUyfG+g1Th3lHJBbKbBx51phh0pZ5ELk39jEGkUSz9yGQI7uL37NMQOwW5r9mMibbeSdDg== X-Received: by 2002:ac8:4b54:: with SMTP id e20mr22962217qts.371.1619025242112; Wed, 21 Apr 2021 10:14:02 -0700 (PDT) Received: from hurd (dsl-10-133-199.b2b2c.ca. [72.10.133.199]) by smtp.gmail.com with ESMTPSA id i12sm2558196qkl.49.2021.04.21.10.14.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Apr 2021 10:14:01 -0700 (PDT) From: Maxim Cournoyer To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: Add a way to disable serialization support to (guix services configuration) References: <878s5ncjaw.fsf@gmail.com> <87fszoswmc.fsf@gnu.org> Date: Wed, 21 Apr 2021 13:14:00 -0400 In-Reply-To: <87fszoswmc.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sat, 17 Apr 2021 18:29:15 +0200") Message-ID: <87eef3d0h3.fsf@gmail.com> 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 Received-SPF: pass client-ip=2607:f8b0:4864:20::833; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x833.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619025255; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=ZT+PnLv1fU5lQ4gqAExP5/xaxgym1llRIg5x9rbIwBY=; b=Q3523RP/gUd9a3o1zcAwDh4IZc27/SqP30bd5Fd0Df+1kIviZwt8ULzLJLYsXlaKNNVbAe rwqRkiu+DbxvGHDH0oBOj3wo7VmQLHaidWHUYuUo5GM6WTGu2a3JVO2Ow93YHGSom9En+q RbaWJWg5yvprsLyGiOpLj9son4MgLC5ZUP533emz9dloJ1cVQTrf0ao1oqvgHv6uJ472DU RHORe7WCjiIvb9x3U2+nQUzKpbZ8A34Hx31v//dFSooo2O4bw6/mRCxQPvJyarnMCdiVXb pQ9IaaxJLjB5viPtZL2SnKJ26XuS84SwcZQsFmwA/+w9t0wTehRhXVMbY/TJ2w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619025255; a=rsa-sha256; cv=none; b=Zc8b4UBkOKZNra27Uzebo5TacXo2nwgfDK09bfAgQaHrcx5gyQHuOMESC3f/2otP29pKO0 Yd6uMwIX4AvleC5OR1qpcXYv6SVU3/Kn7lD6YpmqrwZoiTx/E3E2lagup8NeYQS1KbuQ7f 2kB5NVZnmMmlLXtI+kVClRnZIpMsTnQ7WsqOMFh8SlR6OO3et9bnwLcQJ7Of16vsbb4YH7 AUW4/OkiEzQaD3bM4ehLjE57hAAhxE6VxOAXB1ZdkBc5WgkNviwOccU1845L58q2oHdUbn GFij+KEIzwozcqIbXvfUeqg53wyeu3ZPIY/K8QWvx8/qERLtMoQNggX5dg5Ogg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=pYbxLArA; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -3.14 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=pYbxLArA; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: E03041B2A0 X-Spam-Score: -3.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9xe2Y3nsVwoU Hello again, Ludovic Court=C3=A8s writes: [...] > diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.= scm > index 90f12a8d39..20e1647335 100644 > --- a/gnu/services/configuration.scm > +++ b/gnu/services/configuration.scm > @@ -109,6 +109,9 @@ > (define (serialize-maybe-stem field-name val) > (if (stem? val) (serialize-stem field-name val) "")))))))) > > +(define-syntax-parameter configuration-field-serialization? > + (identifier-syntax #t)) > + > (define-syntax define-configuration > (lambda (stx) > (syntax-case stx () > @@ -123,7 +126,8 @@ > #'(field-type ...))) > ((field-serializer ...) > (map (lambda (type) > - (id #'stem #'serialize- type)) > + #`(and configuration-field-serialization? > + #,(id #'stem #'serialize- type))) > #'(field-type ...)))) > #`(begin > (define-record-type* #,(id #'stem #'< #'stem #'>) > @@ -152,6 +156,16 @@ > #,(id #'stem #'stem #'-fields= )) > conf)))))))) > > +(define-syntax-rule (without-field-serialization definition) > + (syntax-parameterize ((configuration-field-serialization? > + (identifier-syntax #f))) > + definition > + #t)) > + > +(without-field-serialization > + (define-configuration foo > + (bar (integer 123) "doc"))) > + > (define (serialize-package field-name val) > "") Actually, this doesn't seem to work; when exporting the 'without-field-serialization' from this module and using it in another module (wrapping a (define-configuration ...) form), the compiler complains that the 'foo' variable is not defined; perhaps because foo is exported as part of the module definition? If you have an idea why, hints welcome. Maxim