unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: 57850@debbugs.gnu.org
Subject: [bug#57850] [PATCH 1/2] marionette: Make it easier to debug REPL read failures.
Date: Fri, 16 Sep 2022 09:32:35 +0200	[thread overview]
Message-ID: <20220916073236.23634-1-mail@cbaines.net> (raw)
In-Reply-To: <87h717kccw.fsf@cbaines.net>

Log the remaining contnet written to the REPL, so that there's more to go on
than:

  socket:5:14: Unknown # object: "#<"

* gnu/build/marionette.scm (marionette-eval): Catch exceptions from read and
log the remainder of the content from the REPL.
---
 gnu/build/marionette.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm
index 06b699bd7b..fd59a4c72f 100644
--- a/gnu/build/marionette.scm
+++ b/gnu/build/marionette.scm
@@ -178,7 +178,18 @@ (define (marionette-eval exp marionette)
     (($ <marionette> command pid monitor (= force repl))
      (write exp repl)
      (newline repl)
-     (read repl))))
+     (with-exception-handler
+         (lambda (exn)
+           (simple-format
+            (current-error-port)
+            "error reading marionette response: ~A
+  remaining response: ~A\n"
+            exn
+            (get-line repl))
+           (raise-exception exn))
+       (lambda ()
+         (read repl))
+       #:unwind? #t))))
 
 (define* (wait-for-file file marionette
                         #:key (timeout 10) (read 'read))
-- 
2.37.3





  reply	other threads:[~2022-09-16  7:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16  7:26 [bug#57850] Marionette fix + improvement Christopher Baines
2022-09-16  7:32 ` Christopher Baines [this message]
2022-09-16  7:32   ` [bug#57850] [PATCH 2/2] marionette: Avoid read error when wait-for-file file is empty Christopher Baines
2022-09-16  8:38     ` [bug#57850] Marionette fix + improvement Mathieu Othacehe
2022-09-16 10:40       ` bug#57850: " Christopher Baines
2022-09-16  8:37   ` [bug#57850] " Mathieu Othacehe

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20220916073236.23634-1-mail@cbaines.net \
    --to=mail@cbaines.net \
    --cc=57850@debbugs.gnu.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.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).