From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 f4btHqnMgmOJ6gAAbAwnHQ (envelope-from ) for ; Sun, 27 Nov 2022 03:34:17 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 6LgTHqnMgmNkdgAAauVa8A (envelope-from ) for ; Sun, 27 Nov 2022 03:34:17 +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 089DEF40F for ; Sun, 27 Nov 2022 03:34:16 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oz7UZ-0004aQ-I4; Sat, 26 Nov 2022 21:34:03 -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 1oz7UY-0004Yw-I2 for bug-guix@gnu.org; Sat, 26 Nov 2022 21:34:02 -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 1oz7UY-0006C2-6F for bug-guix@gnu.org; Sat, 26 Nov 2022 21:34:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oz7UX-00022v-TB for bug-guix@gnu.org; Sat, 26 Nov 2022 21:34:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#59423: Invalid 'location' field generated in dovecot configuration Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 27 Nov 2022 02:34:01 +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: Pierre Langlois Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 59423@debbugs.gnu.org Received: via spool by 59423-submit@debbugs.gnu.org id=B59423.16695164257859 (code B ref 59423); Sun, 27 Nov 2022 02:34:01 +0000 Received: (at 59423) by debbugs.gnu.org; 27 Nov 2022 02:33:45 +0000 Received: from localhost ([127.0.0.1]:41768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oz7UG-00022h-Dl for submit@debbugs.gnu.org; Sat, 26 Nov 2022 21:33:44 -0500 Received: from mail-qv1-f53.google.com ([209.85.219.53]:41864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oz7UC-00022b-5N for 59423@debbugs.gnu.org; Sat, 26 Nov 2022 21:33:43 -0500 Received: by mail-qv1-f53.google.com with SMTP id d13so5189759qvj.8 for <59423@debbugs.gnu.org>; Sat, 26 Nov 2022 18:33:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=d03yTBxTt/bXODYVZpUz2nfBSwL9TLEVvY/rFuIVMh8=; b=pob8KIQuT8tDlYGkci37nEQaD18kNr1MOUWnK7LrBSz0une3o4+vLluZCBW0Ry/T7X MFoP3p9w3rQfqfjUcstbflIysWk5KxoyPbE3S2ES76nQJ3EE1pQt8//V3zAP5HRd0l6h 0ATilRenrBTMQJfiBcmv7gXLmsNSsCo1R/+2nclDUqjjFD74m5KKH8QrTkKoRhrELDna gVdrP9kU2Th8XfeRLeB+4U9DPJSvikdEN+LR/dkE9cYMSZkXp5i8WGfYMTEm/Ck2cq9z E5DU6amlMtphjHTNo5N72DeXiXt1/kAgHEUGDCcHS71PP28LyhnwqhHrtcml1wKJ/Pyy Db0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=d03yTBxTt/bXODYVZpUz2nfBSwL9TLEVvY/rFuIVMh8=; b=v9zs2II1jyxzWLnBJRF1W8boWYRIaNmy1+l5vieL0Qc/F0oCjzCqOpwJ0vMh2jxyVP WCBo4atd6MMVFEj+z/k8ZXDLVXRSDB8f7NQU5+nRw3qirWRkdMabMEHoQSEpEmz5EtLr xr7R5HQJD0j5o+/tLhf3DX4XRypQVDG2Bna+23kv/buAIJqh0zWnKJz7/IzvwJibUrWX 4i/mICNGwMtvUVf56KWH6F9oypeNK6avWQ6PMIv7X7+cl/oY8XsoXinKpufljxvD3Uhl Ufu0/Xp+nkV+P/fhaXUl3dkVtkaEIEunDaAwse3vwXGMQadfuIylec8xn/YriRwazJLI 1PIg== X-Gm-Message-State: ANoB5pm0GkIK9xPgKxRIJ1GvC3t6Xa1cqI4MjCN7GH9NB23tU9xY7DSt kBPXpJdnGj/EAq2QPZhXNE8= X-Google-Smtp-Source: AA0mqf65xU9M8ryEmAONsdVEMdPcoXHzpdPH4Qkj1sCRFt7l6w1MTsatAoKr7uRmyFayFQnWlzDv3w== X-Received: by 2002:a0c:fec9:0:b0:4c6:91b5:27c3 with SMTP id z9-20020a0cfec9000000b004c691b527c3mr39519275qvs.97.1669516414394; Sat, 26 Nov 2022 18:33:34 -0800 (PST) Received: from hurd (dsl-151-252.b2b2c.ca. [66.158.151.252]) by smtp.gmail.com with ESMTPSA id m17-20020a05620a291100b006fa8299b4d5sm5718338qkp.100.2022.11.26.18.33.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Nov 2022 18:33:33 -0800 (PST) From: Maxim Cournoyer 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> Date: Sat, 26 Nov 2022 21:33:32 -0500 In-Reply-To: <87cz995wwu.fsf@gmx.com> (Pierre Langlois's message of "Sat, 26 Nov 2022 19:32:37 +0000") Message-ID: <87o7stw2gz.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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=1669516457; 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: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=d03yTBxTt/bXODYVZpUz2nfBSwL9TLEVvY/rFuIVMh8=; b=JSJd6o2fcvwR/TAn6gKs67WjztciNZYtewZNBz18qh++Y2UYAUXVTJLSjMV3gjBScGY20k g4cXE7Ami8ACnDy2iOH4zR4FmyZTOuB7ubBnpo0BjLHQ2T2RhQaXfNZVpcZ4BiTAhJ3QTK NquG8MiutfrhMLspq0nLq2phF2rNOgUZhUA6+ESBecx2UewXWW1kpanoWR1Ffl7Vg0Cqj0 A8KWC/xeOSmKhYwd7Yn+XklzP975AZP2147JNDWY6jal4TrpBqmR6wYw0H/HmXfO7bZpHx uYewpNaSzsSI70tWievYqspqfea7RhYqG5S9fYJKBvTKMUPkCsDRlkA+STxuFA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669516457; a=rsa-sha256; cv=none; b=nQijN7IvCzja9qUWEj10kit/VRK/cqtxZq6ovxTrL5lgpupanuSiKzsPqTh7zP88KPoq6S 7LZNqy91Seqmp/mvYmiBqvC7oH5xIAMIu0LK5Y0+Bt1SPw7KuOeQdYApEaYResEVrzOtX+ Li41NmR2F0zCRUp6r0oQng19iAB2P2VSvcsI6iU627Wy5IBbhURKS0zkl/54T4VkUzkcsF 4gNH7CHkAYYRxBG1WMUtjcdIf+OxneY5oND78SGd6uzdQDV+SL0xBEuai4Hoje4OxlsI2L fFtfjJhR7x2ciCoAnRHia/7ppHB4Pqxfhxo8EL8YTtPVgO+S38IxFFaV+RDfBQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=pob8KIQu; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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.74 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=pob8KIQu; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 089DEF40F X-Spam-Score: 4.74 X-Migadu-Scanner: scn0.migadu.com X-TUID: lqw3oGtXKa4O Hi Pierre, Pierre Langlois writes: > Hi Maxim, > > Maxim Cournoyer writes: [...] >> The change was reinstated as part of the mcron update, in >> 44554e7133aa60e1b453436be1e80394189cabd9. The bit that seems to cause >> the issue here (still not clearly understood) is probably this one: >> >> diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm >> index 636c49ccba..dacfc52ba9 100644 >> --- a/gnu/services/configuration.scm >> +++ b/gnu/services/configuration.scm >> @@ -242,17 +242,17 @@ (define-record-type* #,(id #'stem #'< #'stem #'>) >> stem >> #,(id #'stem #'make- #'stem) >> #,(id #'stem #'stem #'?) >> - (%location #,(id #'stem #'stem #'-location) >> - (default (and=> (current-source-location) >> - source-properties->location)) >> - (innate)) >> #,@(map (lambda (name getter def) >> #`(#,name #,getter (default #,def) >> (sanitize >> #,(id #'stem #'validate- #'stem #'- name)))) >> #'(field ...) >> #'(field-getter ...) >> - #'(field-default ...))) >> + #'(field-default ...)) >> + (%location #,(id #'stem #'stem #'-location) >> + (default (and=> (current-source-location) >> + source-properties->location)) >> + (innate))) >> >> (define #,(id #'stem #'stem #'-fields) >> (list (configuration-field >> >> >> Reverting it would likely fix the issue (haven't tried), but it'd be >> nice to have a clear understanding of what's going on. It may have >> unmasked a bug waiting to bite. >> >> The issue seems to be with the serialization of the >> object nested in the >> record. I tried this at the REPL: >> >> scheme@(guile-user)> ,m (gnu services mail) >> scheme@(gnu services mail)> (namespace-configuration (name "inbox")) >> $8 = #< name: "inbox" type: "private" separator: "" prefix: "" location: "" inbox?: #f hidden?: #f list?: #t subscriptions?: #t mailboxes: () %location: #f> >> scheme@(gnu services mail)> (serialize-configuration $8 namespace-configuration-fields) >> name=inbox >> type=private >> separator= >> prefix= >> location=#f > > The location here should probably be empty rather than `#f' no? It looks > as though the value is coming from the internal %location, rather than > the user-provided location. Good eye! Perhaps my earlier simple session was able to reproduce after all! #f sure doesn't read as a successfully serialized value :-). It probably came from %location, which is set to #f when working at the REPL. > If the two fields can shadow each other, > then indeed, that looks like an existing bug that was exposed by the > reordering, rather than a bug with the reorder itself. > > I'll if I can find anything the macro, it looks quite complex to me :-). It's not only to you, if that helps. It's rather... intimidating ^^'. Looking at it again, the problem is not so mysterious after all... The %location field has its accessor set to be: --8<---------------cut here---------------start------------->8--- (%location #,(id #'stem #'stem #'-location) (default (and=> (current-source-location) source-properties->location)) (innate))) --8<---------------cut here---------------end--------------->8--- #,(id #'stem #'stem #'-location) which gets expanded to namespace-configuration-location, which shadows that of the now preceding "location" field. The bug in the previous condition would have been reversed; the source location would have been shadowed by the "location" field value. Ludovic, would you have an idea of where the %location field or its CONFIGURATION-location accessor come into play? I tried tracing it in the source, but I only see it being set and the location being pulled from the sanitizer via "(datum->syntax #'value (syntax-source #'value)" in (gnu services configuration) around line 227, which is the location that would get printed in the error handler CALL-WITH-ERROR-HANDLING from (guix ui): --8<---------------cut here---------------start------------->8--- ((formatted-message? c) (apply report-error (and (error-location? c) (error-location c)) (gettext (formatted-message-string c) %gettext-domain) (formatted-message-arguments c)) (when (fix-hint? c) (display-hint (condition-fix-hint c))) (exit 1)) --8<---------------cut here---------------end--------------->8--- I could be wrong, but since the "location" of a field appears to be an "intrinsic" property rather than something explicitly attached to it, perhaps there's no need for a "location" accessor? Or it could be named differently, such as "%location" to reduce the risk of clashing with user-defined fields. Does that make sense? -- Thanks, Maxim