From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KMFnIuI0lWHqXwAAgWs5BA (envelope-from ) for ; Wed, 17 Nov 2021 17:59:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id mAL8HeI0lWEuBQAAB5/wlQ (envelope-from ) for ; Wed, 17 Nov 2021 16:59:14 +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 505C22BB1E for ; Wed, 17 Nov 2021 17:59:14 +0100 (CET) Received: from localhost ([::1]:43320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnOHB-0001Yi-EP for larch@yhetil.org; Wed, 17 Nov 2021 11:59:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnOH1-0001SE-5o for guix-patches@gnu.org; Wed, 17 Nov 2021 11:59:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:50386) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mnOH0-0003bc-D2 for guix-patches@gnu.org; Wed, 17 Nov 2021 11:59:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mnOH0-0006cJ-DC for guix-patches@gnu.org; Wed, 17 Nov 2021 11:59:02 -0500 Subject: bug#51922: [PATCH 0/2] Improve the reported location of configuration warnings Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Wed, 17 Nov 2021 16:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 51922 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Josselin Poiret Cc: 51922-done@debbugs.gnu.org Mail-Followup-To: 51922@debbugs.gnu.org, ludo@gnu.org, dev@jpoiret.xyz Received: via spool by 51922-done@debbugs.gnu.org id=D51922.163716830625373 (code D ref 51922); Wed, 17 Nov 2021 16:59:02 +0000 Received: (at 51922-done) by debbugs.gnu.org; 17 Nov 2021 16:58:26 +0000 Received: from localhost ([127.0.0.1]:33698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnOGQ-0006b8-Aj for submit@debbugs.gnu.org; Wed, 17 Nov 2021 11:58:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38246) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnOGO-0006aq-3s for 51922-done@debbugs.gnu.org; Wed, 17 Nov 2021 11:58:24 -0500 Received: from [2001:470:142:3::e] (port=39628 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnOGI-0003Ua-Q7; Wed, 17 Nov 2021 11:58:18 -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=14UJbrLHFfnh3rfGZGFam742FQ0HeAKwHqii/kSTUh0=; b=C0DYsfTNUMoiGW8MEN5y w8DEQDvfRl8gS43khGbf7JB1916lcyA42X00CBnK/FRG+FIcbri/ySXK+lX/G3Q9Ll3FNiOkCNtkm GPeZrBLTRfsvXTVTN9vXWHt9DUtjUydUhLdoR5a5hJADwpzVMvUtJKE33q0yo8f27qyXqZ5+9xzSJ 5KzBGcQTebQcM+1u2yulExB12KAw8pMQQqZxThSV1/x24oMarkoem6nuOXu7JrB6aC2zZff0XyaaW ecfTPQJb53AUlZ6NO7KS8iLzErJBiLNCK7JayKrfQUjwmq+3D5w2w5BPV5mtmGMWexMatljxfzbkH 5NXhYc6Qu3nmSw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:52282 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnOGH-0001EN-0G; Wed, 17 Nov 2021 11:58:18 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211117144028.16722-1-dev@jpoiret.xyz> Date: Wed, 17 Nov 2021 17:58:14 +0100 In-Reply-To: <20211117144028.16722-1-dev@jpoiret.xyz> (Josselin Poiret's message of "Wed, 17 Nov 2021 14:40:28 +0000") Message-ID: <87sfvuu3bt.fsf@gnu.org> 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" 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=1637168354; 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-to: 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=14UJbrLHFfnh3rfGZGFam742FQ0HeAKwHqii/kSTUh0=; b=FTwHVEBDhZa7Cff5DnT0xWYB4KVJXaRRnSKO39VmLk1oAtCgT+pi05KRgejxB9IqNLXkk+ fKa3Z3Zmj4YrWBpw2Zj7MJ2jMRtX9VXKGZ+WS0avh2IpX02PUDWA5Ur9sZIP0kcCu6Lg0U Xc4O9LWtGBC3lIQfUOJq/gtEGq3+xPZcvijzJs0aczXOZplxS7AdMScbeZpfQzIfQdLVJD OSQdGFUcTPQUywkgTifVecJL0xHxGK4NjCZJKM8drYkTT6/MvDhC2i7aa3oQ4nPZ5m0t28 JZ5n1LnyUl2wtfbPvwA645wS0/E9C5TVKBLsDol9ZLQFkUCVbRenAtmnMrSBeg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637168354; a=rsa-sha256; cv=none; b=ZCjEbyN95eX/IvKk+CvokgsqStMxmBuwQawToeCPOKM+7oEKO2AtQUveFntx6IdrRJNXds cHk5REvS48I8I1EcNrHB83xu7sZy/5yRY9/bGxxMdK7heikVXYlWOC+494PdKq0zZW2unx DHqFjjWQotjSGMKgGQNLqhcShBE+GaqxqDHqDqW7BP31qpOraKVTGpbw9GlyJZNWph7xKp DuBUFcRgsRculnJAF3UD36SlQglYjp5qK1WuYR0bNeFaIsXpAXEXR3zjOCI7aEZMxuihBU 5glofu6BJpeiNcYkYzR3qKXZdWEOwSBUHi6zbWS4aN5P/K61ZW9eV7XkvHYxIQ== 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=C0DYsfTN; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.06 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=C0DYsfTN; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 505C22BB1E X-Spam-Score: -2.06 X-Migadu-Scanner: scn0.migadu.com X-TUID: x6I/uAGBZepY Hi, Josselin Poiret skribis: > While working on the swap-space patch, I noticed that currently, > warnings about deprecated fields in guix records use the location of > the record definition macro, rather than of the invalid value. For > some records such as 'operating-system', this makes it rather user > unfriendly and confusing. > > This patchset first adds the syntax 'define-with-syntax-properties', > which helps avoid boilerplate code to define sanitizers with proper > location reporting. I put it in guix/diagnostics.scm as I thought > this was the place that was most likely to be use-module'd for warning > messages, as this is quite tied to that use. The second patch makes > use of this new helper to update two warnings: the one about 'target' > to 'targets' in bootloader.scm, and the one about setuid-programs. In > both cases, a `guix system reconfigure` now reports the exact location > of the incriminating values, rather than of the > 'bootloader-configuration' or 'operating-system' lines respectively. Neat! That=E2=80=99s a much welcome improvement. > The approach I've taken for the helper was to make something simple > and general enough for most uses. It should correctly report syntax > errors with custom errors messages rather than the generic "source > expression failed to match any pattern ...". Note although that it > isn't possible to do any defines in the body of the macro, as this > doesn't use any lambda-like macros (see the second case for an > example). I think that=E2=80=99s OK, that=E2=80=99s a reasonable approach. > I can see two drawbacks to this macro: > 1) This macro will not help you write expand-time checkers. This > would introduce too much complexity, and I'm not sure the end-user > would notice a significant change. > 2) It doesn't deconstruct values such as lists to get the individual > list values's properties. This would also introduce too much > complexity (eg. checking if the list is literal, deconstructing it, > and falling back to a generic source location if the list is only > available at eval-time). Again, I think that=E2=80=99s fine: this macro solves what it was designed = to address, and if we need something fancier, we can think about it later. > guix: Add syntax to capture arguments' syntax-properties. > gnu: system: Improve location of some configuration warnings. I tweaked the first commit log and applied it. Thank you! Ludo=E2=80=99.