GNU bug report logs - #42146
[PATCH core-updates 1/?] build: substitute: Don't fail silently.

Previous Next

Package: guix-patches;

Reported by: Jakub Kądziołka <kuba <at> kadziolka.net>

Date: Tue, 30 Jun 2020 22:10:01 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: Jakub Kądziołka <kuba <at> kadziolka.net>, 42146 <at> debbugs.gnu.org
Subject: [bug#42146] [PATCH core-updates 1/?] build: substitute: Don't fail silently.
Date: Mon, 23 Oct 2023 10:48:12 +0200
Hi,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis:

> From: Jakub Kądziołka <kuba <at> kadziolka.net>
>
> * 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 <maxim.cournoyer <at> gmail.com>
> Change-Id: I66ed33d72aa73cd35e5642521efec70bf756f86e

[…]

> +(define-condition-type &substitute-error &error
> +  substitute-error?
> +  (file substitute-error-file)
> +  (patterns substitute-error-patterns))
> +
> +(define %substitute-requires-matches?
> +  (make-parameter #t))

[…]

> @@ -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.
>  
> +By default, SUBSTITUTE* will raise a &message condition if one of the patterns

I think it’s ‘&substitute-error’ rather than ‘&message’.

> +(define-substitute*-test test-error "substitute*, partial no match error"
> +  #t                                  ;expected
> +  "a\0b"                              ;content
> +  (("a") "c"
> +   ("Oops!") "c"))

Maybe it’s not all that important here, but I think ‘test-error’ tests
for any exception, whereas we’re looking specifically for a
‘&substitute-error’ condition filled with the right values.

Ludo’.




This bug report was last modified 1 year and 233 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.