Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: gdb-patches@sourceware.org
Subject: [PATCH 4/4] gdb/testsuite: Pipe the dg-extract-results file list via stdin
Date: Thu, 23 Jul 2026 18:51:31 +0100	[thread overview]
Message-ID: <20260723175131.266112-5-pedro@palves.net> (raw)
In-Reply-To: <20260723175131.266112-1-pedro@palves.net>

The parallel-testing targets combine the per-test result files into a
single gdb.sum / gdb.log pair with the DG_EXTRACT_RESULTS macro, which
passes the whole list to contrib/dg-extract-results.sh on the command
line, one positional argument per file:

 $(SHELL) .../dg-extract-results.sh \
   `find $(1) -name gdb.sum -print` > $(2)/gdb.sum

A parallel run writes one gdb.sum (and one gdb.log) per .exp, so with
GDB's testsuite the whole list is thousands of paths.  On Windows with
native Windows Python that overflows the command-line length limit
(~32 KB), and the run dies while combining the results:

 $ make check-parallel
 ...
 .../dg-extract-results.sh: line 39: /ucrt64/bin/python3: Argument list too long
 make: *** [Makefile:274: check-parallel] Error 2
 ...
 $ find outputs/ -name gdb.sum | wc -l
 2657

An earlier commit taught dg-extract-results.sh/dg-extract-results.py a
-f option that reads the file list from a file, or from standard input
when the argument is "-", so we can now fix this by piping the find
output into dg-extract-results.sh via stdin instead, so the command
line length limit no longer applies.

Change-Id: I5d8c94332eda9bf49c9b0144dabb846de1102f57
---
 gdb/testsuite/Makefile.in | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
index f671e90e125..11782a860db 100644
--- a/gdb/testsuite/Makefile.in
+++ b/gdb/testsuite/Makefile.in
@@ -257,11 +257,18 @@ check-single-racy:
 # Combine the individual gdb.sum / gdb.log files found anywhere under
 # directory $(1) into a single gdb.sum / gdb.log pair in directory
 # $(2), using contrib/dg-extract-results.sh.
+#
+# The file list is piped in via "-f -" rather than expanded onto the
+# command line: a parallel run writes one gdb.sum/gdb.log per .exp, so
+# the list can hold thousands of paths and overflow the command-line
+# length limit (notably on Windows, where the limit is ~32 KB).
 define DG_EXTRACT_RESULTS
-	$(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh \
-	  `find $(1) -name gdb.sum -print` > $(2)/gdb.sum; \
-	$(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh -L \
-	  `find $(1) -name gdb.log -print` > $(2)/gdb.log
+	find $(1) -name gdb.sum -print \
+	  | $(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh -f - \
+	  > $(2)/gdb.sum; \
+	find $(1) -name gdb.log -print \
+	  | $(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh -L -f - \
+	  > $(2)/gdb.log
 endef
 
 check-parallel:
-- 
2.54.0


      parent reply	other threads:[~2026-07-23 17:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23 17:51 [PATCH 0/4] Avoid command-line length limit combining test results Pedro Alves
2026-07-23 17:51 ` [PATCH 1/4] dg-extract-results.{sh, py}: Optionally read file list from stdin/file Pedro Alves
2026-07-23 17:51 ` [PATCH 2/4] gdb/testsuite: Factor out dg-extract-results.sh calls Pedro Alves
2026-07-23 17:51 ` [PATCH 3/4] gdb/testsuite: Add extract-results make target Pedro Alves
2026-07-23 17:51 ` Pedro Alves [this message]

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=20260723175131.266112-5-pedro@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox