From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id gIrtB3UzNmX/egAAG6o9tA:P1 (envelope-from ) for ; Mon, 23 Oct 2023 10:48:53 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id gIrtB3UzNmX/egAAG6o9tA (envelope-from ) for ; Mon, 23 Oct 2023 10:48:53 +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 D727735330 for ; Mon, 23 Oct 2023 10:48:52 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=qGrYVyWB; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1698050932; 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=lz0q1rkRLhJ8IGOJFqtMTyIg5K92dX3TvuLH8kSZOoI=; b=Xwckz7U5AYXW0M2zNBhVKUkKGgwM/pdpWxB7AhO7pXVtWbGiukozrHiABIAWEca7Y0qjyO 6oAFkKd690knou4ovanm/TBU9/Hh980K4GLr8vefq+cajzOZ67KUpS+iddkpdg9F/+hT2U 6gEutuQx6D6ze3ag3WI12Cw05ZFiV65KPwKT16kUiO7PPtbFCQt0uCrTD5JI3YUY+e6re3 0TlVgb/qYOLWd7l9+ccNR8HZaMOCup1W4oGAmY+eYR+N91i63LD9pQxM/OCDJ2tN+MV6E+ 8GonCDaPcHK1nwi6MwFQDCPw/nuIqO+WTh9ZWvdP+zbOxcJjFgdT7cBKq1u7tw== 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=qGrYVyWB; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1698050932; a=rsa-sha256; cv=none; b=Yr6zMXqperkJpqkR7U89j2fZnKZeaWOy0jdamF/lPLh83jbNtqoKSkrXMQmna2uzfOJYbM l2vjAt4IjPpvWA/oIh2f45Rhmg7NHQt/Vq5523IsinRCfRq48wXDnfu7xYMc+u1038ceoK SP8jXGyNl33Vj3FW+unlPGdxigL7frY/kxUNoXY1CZ8ouATx1RUZ/v0O8U9QESxwYx/jki JgV6NsoxUEhNIw3QAy/GQ4+PIeN0SdMDwsqkoecCCjoF8P8XcTTjh5epS2b/S7RFUu34Rt veM0I+niajlcFquofLpL3L6ts0Jr3MOjp8PVjKh26KyTgZ1o+jGXcPAfQYBzgw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quqc1-0004JZ-SY; Mon, 23 Oct 2023 04:48:38 -0400 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 1quqby-0004JR-1V for guix-patches@gnu.org; Mon, 23 Oct 2023 04:48:34 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quqbx-0004sJ-M8 for guix-patches@gnu.org; Mon, 23 Oct 2023 04:48:33 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quqcQ-0003AF-Ai for guix-patches@gnu.org; Mon, 23 Oct 2023 04:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42146] [PATCH core-updates 1/?] build: substitute: Don't fail silently. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 23 Oct 2023 08:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42146 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= , 42146@debbugs.gnu.org Received: via spool by 42146-submit@debbugs.gnu.org id=B42146.169805094112156 (code B ref 42146); Mon, 23 Oct 2023 08:49:02 +0000 Received: (at 42146) by debbugs.gnu.org; 23 Oct 2023 08:49:01 +0000 Received: from localhost ([127.0.0.1]:49017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quqcP-00039x-Ce for submit@debbugs.gnu.org; Mon, 23 Oct 2023 04:49:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quqcN-000391-8Y for 42146@debbugs.gnu.org; Mon, 23 Oct 2023 04:49:00 -0400 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 1quqbo-0004qX-PJ; Mon, 23 Oct 2023 04:48:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=lz0q1rkRLhJ8IGOJFqtMTyIg5K92dX3TvuLH8kSZOoI=; b=qGrYVyWB+7PYXJ3LYpyZ LB6ucFe9sHiBadyR/K5At38vGDEv/ljd5+dL87HeNd+sjEqaMC0sdVGDaNgrVyb0VDJ/pUP63dKXS vZSreJ0k4WzJrx0x15Yi49bhHW5EC7tlI/rUEj8gBrHID74xUKnUZhrOBk48vfHcEh+jjd0iRDDJH IZm5P+AV1auW/DWivw8BGIYUXpoSg6itd7w9kL9e35UoqtWc/OgabibEWO62MMlonQdWzngvj8Ae+ +woxasSMUQbEr+TJPTy1hE1S0UQOypSPleEFQUjf0UNiGjVblemwOPr6omBkuGN34mQvcJ0DfliJ2 J8lwLzjIOOTxkA==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: (Maxim Cournoyer's message of "Thu, 19 Oct 2023 20:57:39 -0400") References: Date: Mon, 23 Oct 2023 10:48:12 +0200 Message-ID: <871qdliv1v.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -6.80 X-Spam-Score: -6.80 X-Migadu-Queue-Id: D727735330 X-Migadu-Scanner: mx2.migadu.com X-TUID: X0m2chl6Gm+4 Hi, Maxim Cournoyer skribis: > From: Jakub K=C4=85dzio=C5=82ka > > * guix/build/utils.scm (substitute, substitute*) > [require-matches?]: New argument. > * tests/build-utils.scm ("substitute*"): New test group. > ("substitute*, no match error") > ("substitute*, partial no match error"): New tests. > > Co-authored-by: Maxim Cournoyer > Change-Id: I66ed33d72aa73cd35e5642521efec70bf756f86e [=E2=80=A6] > +(define-condition-type &substitute-error &error > + substitute-error? > + (file substitute-error-file) > + (patterns substitute-error-patterns)) > + > +(define %substitute-requires-matches? > + (make-parameter #t)) [=E2=80=A6] > @@ -1048,9 +1086,19 @@ (define-syntax substitute* > Alternatively, FILE may be a list of file names, in which case they are > all subject to the substitutions. >=20=20 > +By default, SUBSTITUTE* will raise a &message condition if one of the pa= tterns I think it=E2=80=99s =E2=80=98&substitute-error=E2=80=99 rather than =E2=80= =98&message=E2=80=99. > +(define-substitute*-test test-error "substitute*, partial no match error" > + #t ;expected > + "a\0b" ;content > + (("a") "c" > + ("Oops!") "c")) Maybe it=E2=80=99s not all that important here, but I think =E2=80=98test-e= rror=E2=80=99 tests for any exception, whereas we=E2=80=99re looking specifically for a =E2=80=98&substitute-error=E2=80=99 condition filled with the right values. Ludo=E2=80=99.