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


Message #59 received at 42146 <at> debbugs.gnu.org (full text, mbox):

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>, Maxim Cournoyer
 <maxim.cournoyer <at> gmail.com>
Cc: Jakub Kądziołka <kuba <at> kadziolka.net>,
 42146 <at> debbugs.gnu.org
Subject: Re: [bug#42146] [PATCH core-updates 1/?] build: substitute: Don't
 fail silently.
Date: Fri, 20 Oct 2023 17:11:05 +0200
Hi Ludo,

On Thu, 19 Oct 2023 at 22:40, Ludovic Courtès <ludo <at> gnu.org> wrote:

>> +;;;
>> +;;; Extend regexp objects with a pattern field.
>> +;;;
>> +(define-record-type <regexp*>
>> +  (%make-regexp* pat flag rx)
>> +  regexp*?
>> +  (pat regexp*-pattern)                 ;the regexp pattern, a string
>> +  (flag regexp*-flag)                   ;regexp flags
>> +  (rx regexp*-rx))                      ;the compiled regexp object
>> +
>> +;;; Work around regexp implementation.
>> +;;; This record allows to track the regexp pattern and then display it.
>> +(define* (make-regexp* pat #:optional (flag regexp/extended))
>
> I’m skeptical about the concrete benefits.  I would not include it in
> (guix build utils), or at least not in this patch series.
>
> (I tend to be super conservative about (guix build utils) because we
> rarely get a chance to change it.)

If I remember correctly, the record was introduced in #58660 [1].
Basically, if you have,

              (make-regexp "^gnu/packages/python(-.+|)\\.scm$")

then you only have access to some #<regexp 7f6315fb3500>.  Other said,
you lost the human-readable "^gnu/packages/python(-.+|)\\.scm$" regexp
pattern.  The workaround just stores this human-readable regexp pattern.
Later, it is thus possible to display it; for debugging or else.

For the location of such feature, I do not have an opinion.  For the
concrete benefits, I have one. :-)

Well, maybe the feature – keep an access to the human-readable regexp
pattern – could be implemented on Guile-side.

Or maybe there is another simpler way that I am not aware of?

Cheers,
simon


1: https://issues.guix.gnu.org/58660




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.