From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 UGaaHWsztmLX8wAAbAwnHQ (envelope-from ) for ; Fri, 24 Jun 2022 23:58:03 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id sEuHHWsztmKK7AAA9RJhRA (envelope-from ) for ; Fri, 24 Jun 2022 23:58:03 +0200 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 38060171A5 for ; Fri, 24 Jun 2022 23:58:03 +0200 (CEST) Received: from localhost ([::1]:47810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4rJS-00084S-Bs for larch@yhetil.org; Fri, 24 Jun 2022 17:58:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4r5u-00005b-UZ for guix-patches@gnu.org; Fri, 24 Jun 2022 17:44:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o4r5u-0006uh-K6 for guix-patches@gnu.org; Fri, 24 Jun 2022 17:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o4r5u-0003KO-HX for guix-patches@gnu.org; Fri, 24 Jun 2022 17:44:02 -0400 Subject: bug#56075: [PATCH 0/2] Report location of invalid configuration field values Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Fri, 24 Jun 2022 21:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 56075 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 56075-done@debbugs.gnu.org Mail-Followup-To: 56075@debbugs.gnu.org, ludo@gnu.org, ludo@gnu.org Received: via spool by 56075-done@debbugs.gnu.org id=D56075.165610703912772 (code D ref 56075); Fri, 24 Jun 2022 21:44:02 +0000 Received: (at 56075-done) by debbugs.gnu.org; 24 Jun 2022 21:43:59 +0000 Received: from localhost ([127.0.0.1]:43737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4r5q-0003Jw-Vr for submit@debbugs.gnu.org; Fri, 24 Jun 2022 17:43:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4r5p-0003Jf-SM for 56075-done@debbugs.gnu.org; Fri, 24 Jun 2022 17:43:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43230) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4r5k-0006uU-Hc; Fri, 24 Jun 2022 17:43:52 -0400 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=uEmXLFvCqRVnY0KFQhQ7/r+zJnvTy/0JLmy5Z0yujds=; b=KVVJw1DURCGnOTOvLa6N Gpq4LmvMSRv58xBMRd0/718UTzEhnLzwNyv6lT7KC7CMi7vV7gD8SJ76mUDoQ7eNPm6Eo1dR9ZwuC 4AWV0r7Ry4C8My1VJ7hmuhb8x9mtuX4bQLhgSRuoqfSn16kSOBorIH7ovOhmUGk4TY173ENhpD6aJ oem/WvSuLAAwcx0ZRE2AZlkx2q/biIDvXdRf9uSEM+FDyUtaW1jNL/jn5Kou88qUuldNsiWwYJH7H TBTtWGQvhUWR/ODAskzp4bG2GeLI4FmXsZ89ePscvknSB3OWnwItyKzxhl0PvUxKPQ+FAT5IAzI+W zWMe6TwLwo/T8Q==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:61327 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4r5k-0007fe-5g; Fri, 24 Jun 2022 17:43:52 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220618213640.25039-1-ludo@gnu.org> <20220618213832.25165-1-ludo@gnu.org> <87y1xn2wn7.fsf@gmail.com> Date: Fri, 24 Jun 2022 23:43:50 +0200 In-Reply-To: <87y1xn2wn7.fsf@gmail.com> (Maxim Cournoyer's message of "Thu, 23 Jun 2022 12:05:16 -0400") Message-ID: <87czexu489.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (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-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1656107883; 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=uEmXLFvCqRVnY0KFQhQ7/r+zJnvTy/0JLmy5Z0yujds=; b=jjVk0AnDUWUeVYHKK1W5sO+7KwmXwqJD1GIyrhqYUVxxFq9axaR16a8Xd9UrKkk3GnUX/8 DfdGaCwrf6adGthvk1BJEYAIhDJVmXkL0b08PUaBK6TLBB/DPTqVT5KokELJYKzSlt3n7W SEPiZK1MhkBMxw5Q4gvCF+TSazpBxQgHQEn+xlFUUvesihCMXcenQ8ugNwekH9nSJbqpiK yr8/l5yfb/urIeIdSYMZ/HeN+3QfcRTLYWCvincpYyN2NbqXL48J2GB7jdl0tXSC6XQ7H5 4BTehnKm6yG+yRVayDITeDePI1Fx/VfnewLJIJzOHCfHkM/uKsZ+0yZYdpzKVA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1656107883; a=rsa-sha256; cv=none; b=IkAscIhkdZNHHCXzUAHSABTb6e30zbZY85tdNpj5iHzj5KYlJNpIegSKwit7bwkHtjpl4z GkxCm5dvM4ZdDuYdeSa7StFGyyNtakOpSyzkMrDS4USbhCt9H+goMD4kXvKMhS+FnBeEuW SWSAy8f4D+RfswTte8OhqdmxDttgbjOPDoUHJwk4xjgVPmeTlO8S/J65IocEyWbo7SskgV mIxeP/TxvEYGObh259phNTNzGChk4TGzuGEKOXMZFT4dw2l3CZ7MD8QlvQJw3n5UFyScim RDtMCXmKJ8oJGJ1ZxHzazwNzSlHvvbTVZ/lIQyePQgIm3GdnHAeHZBcpvU0K2g== 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=KVVJw1DU; dmarc=pass (policy=none) header.from=gnu.org; 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: -3.86 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=KVVJw1DU; dmarc=pass (policy=none) header.from=gnu.org; 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: 38060171A5 X-Spam-Score: -3.86 X-Migadu-Scanner: scn1.migadu.com X-TUID: 5P/3HQQio8bA Hi, Maxim Cournoyer skribis: > Very nice! I had been meaning to look at what define-configure could be > improved w.r.t. the recently added sanitizers; I felt perhaps > `define-configure' would perhaps loose its relevance, but I'm happy to > see you saw value in upgrading it! Yeah, the mechanism that =E2=80=98define-configuration=E2=80=99 had had bec= ome redundant. > The first part LGTM, although I so rarely dabble with syntax-case that > it looks a bit alien to my eyes now. Well, =E2=80=98define-configuration=E2=80=99 is a bit hairy. :-) >> +++ b/tests/services/configuration.scm >> @@ -19,6 +19,7 @@ > > You forgot to add your copyright notice line. Fixed. >> +(test-equal "wrong type for a field" >> + '("configuration.scm" 56 11) ;error location >> + (guard (c ((configuration-error? c) >> + (let ((loc (error-location c))) >> + (list (basename (location-file loc)) >> + (location-line loc) >> + (location-column loc))))) >> + (port-configuration >> + ;; This is line 55; the test relies on line/column numbers! >> + (port "This is not a number!")))) >> + > > It seems fragile to rely on the line/column number, but if we truly need > to test that, I don't see a better options. Yeah; there is another option, which is to read code from a string port and to simulate its location, but it=E2=80=99s more lines of code for little IMO. Pushed, thanks! 6505f727e1 services: configuration: Remove 'validate-configuration'. fb7e6ccba7 services: configuration: Report the location of field type err= ors. Ludo=E2=80=99.