Subject: Re: [bug#70226] Fwd: I haven't been able to trigger this bug

From: Richard Sent <[email-masked]>
Date: Tue, 30 Apr 2024 16:20:10 -0400

Hi!

Dale Mellor <[email-masked]> writes:

> Can you give a command-line use-case which actually triggers this bug?

Certainly. I've replicated this issue on guix a1ffa8a with:

$ guix search ""

$ guix system search ""

$ guix home search ""

guix search "" takes ~30 seconds before the bug occurs. (Once the first
result is printed to stdout.) system search and home search are
basically instant. That's probably due to the smaller pool of
candidates.

Working on this a bit more the problem isn't the regex search itself.
Instead, I'm confident it has to do with the highlighting performed by
display-search-results when passed a list containing a "" regex. The
issue does not occur for system search with just the following diff:

--8<---------------cut here---------------start------------->8---
modified   guix/scripts/system/search.scm
@@ -189,5 +189,4 @@ (define (guix-system-search . args)
       (leave-on-EPIPE
        (display-search-results matches (current-output-port)
                                #:print service-type->recutils
-                               #:regexps regexps
                                #:command "guix system search")))))
--8<---------------cut here---------------end--------------->8---

V1 of this patch shouldn't be merged. The bug should be fixed in
display-search-results's highlighting logic instead.

-- 
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.