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 aDgwGwPMCmGJLwAAgWs5BA (envelope-from ) for ; Wed, 04 Aug 2021 19:18:59 +0200 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 gAu9FgPMCmEzeQAAB5/wlQ (envelope-from ) for ; Wed, 04 Aug 2021 17:18:59 +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 C4A941192C for ; Wed, 4 Aug 2021 19:18:58 +0200 (CEST) Received: from localhost ([::1]:50052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBKXh-0005eH-I3 for larch@yhetil.org; Wed, 04 Aug 2021 13:18:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBIgg-00051S-Di for guix-patches@gnu.org; Wed, 04 Aug 2021 11:20:13 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33396) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mBIgc-0004Jw-3k for guix-patches@gnu.org; Wed, 04 Aug 2021 11:20:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mBIgb-0008JO-SO for guix-patches@gnu.org; Wed, 04 Aug 2021 11:20:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49671] [PATCH] guix: records: Improve error reporting. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 04 Aug 2021 15:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49671 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Julien Lepiller Cc: 49671@debbugs.gnu.org Received: via spool by 49671-submit@debbugs.gnu.org id=B49671.162809040131937 (code B ref 49671); Wed, 04 Aug 2021 15:20:01 +0000 Received: (at 49671) by debbugs.gnu.org; 4 Aug 2021 15:20:01 +0000 Received: from localhost ([127.0.0.1]:44942 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBIga-0008J3-Nu for submit@debbugs.gnu.org; Wed, 04 Aug 2021 11:20:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBIgY-0008Ir-Ou for 49671@debbugs.gnu.org; Wed, 04 Aug 2021 11:19:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34204) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBIgQ-0004C3-P3; Wed, 04 Aug 2021 11:19:50 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=43036 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBIgP-0001un-Is; Wed, 04 Aug 2021 11:19:50 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20210721014047.3878a0c7@tachikoma.lepiller.eu> Date: Wed, 04 Aug 2021 17:19:47 +0200 In-Reply-To: <20210721014047.3878a0c7@tachikoma.lepiller.eu> (Julien Lepiller's message of "Wed, 21 Jul 2021 01:40:47 +0200") Message-ID: <87bl6dp78s.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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628097539; 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; bh=hqbzkIP6KkcqI7xcZ0F4Y7nI9KhF5oIWm5L18VSwqPo=; b=W3Usr1vspWA/JSLgOqClZThKDGCg9kpsTwSV2XI4ey1AkvlXK1K33YysJuZPSZC2tlECva SIm2kuoCdZCO+RXpVWDOXhtNC2zhxlHC23Qbl/KalMscfZC+7Zp5xai/DW5Bd4SAAtuSVt kqoey0T6/zh3XkQUyh6Gulm7ygrBJhHCdjNMWVAXRTFl8MqK/4PG58FX7fpS6fYBkQbe04 3BKSiM52cAxzUQI1zpUem1JGaITv51QYNPCT2vS1Ai/NSUK9mEXoyscRj/WkBDmV8mNVsF z6nJaI90spRHPctYkk2UaOlR6mI12S2wxJHCCXjS/sjyVreI3zN8/eEUDpvNtg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628097539; a=rsa-sha256; cv=none; b=UhOsLt+G+yFAiK/4UGvcTf8r3R7O0Znkj1TCs6IN9jer9mqWkyXQCTX79SpW/xA56cxqj9 Fbh/wk6i6T9txQbX4OYmkzhqpIwqQ0YN+4x1vgJjWRQmAnlbUfKZBkS+ILm0cffIK7HuXT AxmQhOAGMXI2hOfAKa9s1MtbL6hf+TH37j80CqGEFDJpVVq6H7V+5+Nc3nqPw6zYCLdSQK 9zcWrfFmDH4C69CDeKk6C13ZHFVhQ5mAXEvM0Xm0mFTSpYyzqihVu9TfnhWRjv+r0r0MrO BVJAK93F41oKKWvB2tn8fxD3g43CzRV83XCeItVHg+mShBmiZxkuFcDR8agK5g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -1.41 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: C4A941192C X-Spam-Score: -1.41 X-Migadu-Scanner: scn1.migadu.com X-TUID: nvgY4cpsklNl Hello! Julien Lepiller skribis: > Here are the cases that are handled and the associated message: > > (operating-system > services) > guix system: error: services: invalid field specifier. The format of a > field is `(services value)' > > (operating-system > (services)) > test.scm:2:2: error: (services): Value missing in field specifier. The > format of a field is `(services value)'. > > (operating-system > (services 1 2 3)) > test.scm:2:2: error: (services 1 2 3): multiple values in field > specifier. Got 3 values associated with key services. Values are: > 1 > 2 > 3 > > (operating-system > ()) > guix system: error: (): invalid field specifier. The format of a field > is `(field value)' > > (operating-system > ((services %desktop-services))) > test.scm:2:2: error: ((services %desktop-services)): invalid field > specifier. (services %desktop-services) is not a valid field name. > > > Of course, we can improve these error messages, and internationalize > them. I like the idea! I would prefer for error messages to be plain errors, without hints, so: test.scm:2:2: error: (services 1 2 3): multiple values in field specifier (Not a sentence, no period.) But I=E2=80=99d also like to have hints, and ideally all hints should be reported consistently, via =E2=80=98&fix-hint=E2=80=99 or similar. Thankfully, we can do that via (guix diagnostics) + SRFI-35/34: (raise (condition (&syntax (form 'x) (subform 'y)) (&fix-hint (hint "Consider fixing this.")))) =E2=80=98call-with-error-handling=E2=80=99 in (guix ui) might need to be ad= justed. The only downside is that (guix records) would now depend on another Guix modules, which I tried to avoid so far so it could be more easily reused elsewhere. But that=E2=80=99s the price to pay to get consistent er= ror reports, and I think it=E2=80=99s okay. Note that =E2=80=98tests/guix-system.sh=E2=80=99 and a couple of other file= s test exact error reports, so we=E2=80=99ll have to make sure it still works and possib= ly augment the tests. WDYT? Thanks, Ludo=E2=80=99.