all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Sent <richard@freakingpenguin.com>
To: 70226@debbugs.gnu.org
Cc: "Richard Sent" <richard@freakingpenguin.com>,
	"Christopher Baines" <guix@cbaines.net>,
	"Josselin Poiret" <dev@jpoiret.xyz>,
	"Ludovic Courtès" <ludo@gnu.org>,
	"Mathieu Othacehe" <othacehe@gnu.org>,
	"Ricardo Wurmus" <rekado@elephly.net>,
	"Simon Tournier" <zimon.toutoune@gmail.com>,
	"Tobias Geerinckx-Rice" <me@tobias.gr>
Subject: [bug#70226] [PATCH] scripts: package: Disable searching with the empty string
Date: Fri,  5 Apr 2024 21:05:53 -0400	[thread overview]
Message-ID: <64c782009b2c286cc72513a4a7735bbad650052f.1712365552.git.richard@freakingpenguin.com> (raw)

Reported in <https://issues.guix.gnu.org/70223>.

* guix/scripts/package.scm (process-query): search operating no longer passes
empty strings to make-regexp to avoid unbounded memory usage.

Change-Id: I8194591f0428c4f88fb101c0226b98f593a55709
---
Hi Guix!

Not sure of the usefulness of small patches like this, but figure it
gives me an excuse to trawl the repo and it's better to send it and
not be needed than the inverse.

I considered adding a --force flag to forcefully allow "" searches,
but since multiple scripts use package.scm and there's a lot of CLI
flags already it didn't seem appropriate to add another one,
particularly if it just results in a system freeze.

 guix/scripts/package.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index a489e06e73..66e5384ddc 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -891,6 +891,8 @@ (define (process-query opts)
 
       (('search _)
        (let* ((patterns (filter-map (match-lambda
+                                      ;; https://issues.guix.gnu.org/70223
+                                      (('query 'search "") #f)
                                       (('query 'search rx) rx)
                                       (_                   #f))
                                     opts))

base-commit: 886ed061d7c57eb9d707b2af2c87402b86becf70
-- 
2.41.0





         reply	other threads:[~2024-04-06  1:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05 20:16 bug#70223: Search for empty string uses excessive memory Athena Martin via Bug reports for GNU Guix
2024-04-06  1:13 ` Richard Sent
2024-04-30 17:46 ` bug#70223: I haven't been able to trigger this bug Dale Mellor
2024-04-06  1:05   ` Richard Sent [this message]
2024-04-30 17:54     ` [bug#70226] Fwd: " Dale Mellor
2024-04-30 20:20       ` Richard Sent
2024-04-30 17:55   ` bug#70223: Scratch: " Dale Mellor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=64c782009b2c286cc72513a4a7735bbad650052f.1712365552.git.richard@freakingpenguin.com \
    --to=richard@freakingpenguin.com \
    --cc=70226@debbugs.gnu.org \
    --cc=dev@jpoiret.xyz \
    --cc=guix@cbaines.net \
    --cc=ludo@gnu.org \
    --cc=me@tobias.gr \
    --cc=othacehe@gnu.org \
    --cc=rekado@elephly.net \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.