From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 EHzEGJMphWPSPgAAbAwnHQ (envelope-from ) for ; Mon, 28 Nov 2022 22:35:15 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id cPGZGJMphWN7RwAAauVa8A (envelope-from ) for ; Mon, 28 Nov 2022 22:35:15 +0100 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 E8E1A4D03 for ; Mon, 28 Nov 2022 22:35:14 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozlmK-0005Jd-Sq; Mon, 28 Nov 2022 16:35:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozlmJ-0005JV-F2 for bug-guix@gnu.org; Mon, 28 Nov 2022 16:35:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ozlmJ-0005FQ-2E for bug-guix@gnu.org; Mon, 28 Nov 2022 16:35:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ozlmI-0002jJ-Fl for bug-guix@gnu.org; Mon, 28 Nov 2022 16:35:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#59423: Invalid 'location' field generated in dovecot configuration Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 28 Nov 2022 21:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59423 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Maxim Cournoyer Cc: Pierre Langlois , 59423@debbugs.gnu.org Received: via spool by 59423-submit@debbugs.gnu.org id=B59423.166967124810481 (code B ref 59423); Mon, 28 Nov 2022 21:35:02 +0000 Received: (at 59423) by debbugs.gnu.org; 28 Nov 2022 21:34:08 +0000 Received: from localhost ([127.0.0.1]:51005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozllP-0002iz-P2 for submit@debbugs.gnu.org; Mon, 28 Nov 2022 16:34:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozllN-0002ib-8Z for 59423@debbugs.gnu.org; Mon, 28 Nov 2022 16:34:05 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozllH-0005AR-SS; Mon, 28 Nov 2022 16:33:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=tEJNm2VniQSxmGysFu5MdQFhtIPGhTqsOJD9KmtQD48=; b=nxy9QR6oaRtaARbzu280 +gbDk5JSkIcXMcaLiVJEPHffkMzfMHbsS9Y/JS0kmfS/WCCTQ0uXpJ+MjZL8hD9eHfVCBf6Cg5MTO zhUPLq0nFlzscm0B88LPXgcyOMN16qrrPi1cOmd3LY1WXLa8B30kfEMpDS37gHuXxca6aBVw2jHIm tyZs4XQsV9u9r3Sz2wOIKbbo/uYszTkfMuP1ezAYs70AlIMFpgd/aKTXFuZcgH9RoQPgLMr/kqCEe z3yimUJmG7utIjNwCLKt8NV0w5Nsf7CdRJZx76V6rJK4taTn3KM/7FrcPwHzE6mDTVAQfLxPKMyxX VM0KjhY51eoXTw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozllH-0005OA-Fs; Mon, 28 Nov 2022 16:33:59 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87y1s5wa4p.fsf@gmx.com> <87v8n2iytp.fsf@gmail.com> <875yf293ph.fsf@gmx.com> <87y1ry7o69.fsf@gmx.com> <87cz9a7n4y.fsf@gmx.com> <87fse6fmrq.fsf@gmail.com> <87cz995wwu.fsf@gmx.com> <87o7stw2gz.fsf@gmail.com> <87pmd7ceck.fsf@gnu.org> <87sfi2svb9.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Octidi 8 Frimaire an 231 de la =?UTF-8?Q?R=C3=A9volution, ?= jour du Miel X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 28 Nov 2022 22:33:57 +0100 In-Reply-To: <87sfi2svb9.fsf@gmail.com> (Maxim Cournoyer's message of "Mon, 28 Nov 2022 15:00:58 -0500") Message-ID: <8735a2ahmi.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669671315; 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=tEJNm2VniQSxmGysFu5MdQFhtIPGhTqsOJD9KmtQD48=; b=TjHliKfztjTrJCm5AHcQpkVz5VIoUamiX18hr00oX+ytalwvufLApdqDWeZ47AcbEIG4lB 2yCQYaQn+Y8U5MZS8pNqkpkEu74pMAo+iVfB17KnUD2mJLNQ6undk1bWq4fy/es8IOyCIg Wj40MUOhlykEn9GL9jlU+SVRq4cT8x+Va2rw731Cu93nrM18rr8FA0jAAHrjt9fLndADlU 0/lpGXN0ozYuDB7yTeXMIwX3fuGnrQHiRLUnui4q8vzjh9IMY4o3PVBm2CkFz+ah3iO6aa Hx2J4SNmthmqY3LJAqLE5C/tTUj4VmHeBAznBExtalfwMAeOEoOMcGnoSw4BFg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669671315; a=rsa-sha256; cv=none; b=UZ2rzEI0it8duzUbbsg5sd7e1i4iwLLcH1GvzegWoefeqXlkRXLFLnZcV09LIsfVTlyAJF eq+9GF6Rk96Py1jjf0SxsHrU30xCovBqUsry1QdWIa8DwiyS/DFE+GRlMK/pTGcByUh4Qz RtpyCdg4qF/+47za/JNxo/9MIkvMq7MYrM5sBVvyO5LTHfbRsoBlYTPWpEfUy9PDr/zVkf x0J6qHj07WdwzGN1rf9Ul+dTP9+yiaY30E+ZMW4ALyw+z0bLa8ujVi9FYcN4W6XOHzPb32 3GsyteO6j2edngP/TJ2hG9U+vtZm3f7BMQHBDBjm9Oo5zNKut6s63IXTzeGHcA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=nxy9QR6o; dmarc=pass (policy=none) header.from=gnu.org; 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.46 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=nxy9QR6o; dmarc=pass (policy=none) header.from=gnu.org; 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: E8E1A4D03 X-Spam-Score: -4.46 X-Migadu-Scanner: scn0.migadu.com X-TUID: w6nTDdNW4Rpn Hi Maxim, Maxim Cournoyer skribis: >> We have this: >> >> (define-record-type* #,(id #'stem #'< #'stem #'>) >> stem >> #,(id #'stem #'make- #'stem) >> #,(id #'stem #'stem #'?) >> #,@(map (lambda (name getter def) >> #`(#,name #,getter (default #,def) >> (sanitize >> #,(id #'stem #'validate- #'stem #'- name= )))) >> #'(field ...) >> #'(field-getter ...) >> #'(field-default ...)) >> (%location #,(id #'stem #'stem #'-location) >> (default (and=3D> (current-source-location) >> source-properties->location)) >> (innate))) >> >> That generates two accessors called =E2=80=98namespace-configuration-loc= ation=E2=80=99. >> The second one shadows the first one. > > Yes. You didn't address my question directly though, so let me ask it > again: where is this %location field access (named "location") used? When doing something like this: --8<---------------cut here---------------start------------->8--- scheme@(guix-user)> ,m(gnu services mail) scheme@(gnu services mail)> (namespace-configuration (name "inbox")) $1 =3D #< name: "inbox" type: "private" separator:= "" prefix: "" location: "" inbox?: #f hidden?: #f list?: #t subscriptions?= : #t mailboxes: () %location: #f> scheme@(gnu services mail)> (serialize-configuration $1 namespace-configura= tion-fields) name=3Dinbox type=3Dprivate separator=3D prefix=3D location=3D#f inbox=3Dno hidden=3Dno list=3Dyes subscriptions=3Dyes $2 =3D # --8<---------------cut here---------------end--------------->8--- =E2=80=A6 the field is accessed via its accessor, =E2=80=98name-configuration-location=E2=80=99. We can kinda see it here: --8<---------------cut here---------------start------------->8--- scheme@(gnu services mail)> ,pp namespace-configuration-fields $1 =3D (#< name: name type: string getter: # predicate: # serializer: # default-v= alue-thunk: # doc= umentation: "Name for this namespace."> #< name: type type: string getter: # predicate: # = serializer: # default-value-th= unk: # documentat= ion: "Namespace type: @samp{private}, @samp{shared} or @samp{public}."> [=E2=80=A6] #< name: location type: string getter: # predicate: # serializer: # default-= value-thunk: # do= cumentation: "Physical location of the mailbox. This is in same format as\n= mail_location, which is also the default for it."> [=E2=80=A6] --8<---------------cut here---------------end--------------->8--- Each record has a =E2=80=98getter=E2=80=99 field that= refers to the accessor. In the case of =E2=80=98location=E2=80=99, that=E2=80=99s th= e =E2=80=9Cwrong=E2=80=9D accessor=E2=80=94the accessor of =E2=80=98%location=E2=80=99. I hope that addresses your question! >> What do you think of reverting 44554e7133aa60e1b453436be1e80394189cabd9? > > No. If we revert something, it won't be that whole commit, but just the > moving of the field in the define-configuration produced record. Yes, that=E2=80=99s what I meant; sorry for the confusion. >> After that we can work on renaming the =E2=80=98location=E2=80=99 field = of >> while preserving backward compatibility. > > Why do we have to massage the user facing record > (namespace-configuration) instead of the underlying mechanics? The > macro should serve us, not the other way around :-). See my idea to > simply rename/remove that automatically produced "location" accessor > which appears unused to me. Would that work? What would need renaming in this case is the accessor, not the field. In you proposed renaming the accessor to *-source-location instead of *-location. That sounds like a good idea to me. We should get unbound-variable warnings in modules that use the previous name, so we=E2=80=99ll see if that breaks something. The only downside is that the convention elsewhere in the code is -location, not -source-location. So the other option is to rename =E2=80=98location=E2=80=99 in . That also has the advantage of being less intrusive. WDYT? Ludo=E2=80=99.