GNU bug report logs - #57850
Marionette fix + improvement

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Fri, 16 Sep 2022 07:28:02 UTC

Severity: normal

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57850 in the body.
You can then email your comments to 57850 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#57850; Package guix-patches. (Fri, 16 Sep 2022 07:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christopher Baines <mail <at> cbaines.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 16 Sep 2022 07:28:02 GMT) Full text and rfc822 format available.

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

From: Christopher Baines <mail <at> cbaines.net>
To: guix-patches <at> gnu.org
Subject: Marionette fix + improvement
Date: Fri, 16 Sep 2022 09:26:15 +0200
[Message part 1 (text/plain, inline)]
I think the 2nd patch to avoid the read error helps with the cgit system
test at least.

Christopher Baines (2):
  marionette: Make it easier to debug REPL read failures.
  marionette: Avoid read error when wait-for-file file is empty.

 gnu/build/marionette.scm | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#57850; Package guix-patches. (Fri, 16 Sep 2022 07:33:02 GMT) Full text and rfc822 format available.

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

From: Christopher Baines <mail <at> cbaines.net>
To: 57850 <at> debbugs.gnu.org
Subject: [PATCH 2/2] marionette: Avoid read error when wait-for-file file is
 empty.
Date: Fri, 16 Sep 2022 09:32:36 +0200
Since #<eof> can't be read.

* gnu/build/marionette.scm (wait-for-file): Return "" if file is empty.
---
 gnu/build/marionette.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm
index fd59a4c72f..5ebf783892 100644
--- a/gnu/build/marionette.scm
+++ b/gnu/build/marionette.scm
@@ -198,7 +198,14 @@ (define* (wait-for-file file marionette
   (match (marionette-eval
           `(let loop ((i ,timeout))
              (cond ((file-exists? ,file)
-                    (cons 'success (call-with-input-file ,file ,read)))
+                    (cons 'success
+                          (let ((content
+                                 (call-with-input-file ,file ,read)))
+                            (if (eof-object? content)
+                                ;; #<eof> can't be read, so convert to the
+                                ;; empty string
+                                ""
+                                content))))
                    ((> i 0)
                     (sleep 1)
                     (loop (- i 1)))
-- 
2.37.3





Information forwarded to guix-patches <at> gnu.org:
bug#57850; Package guix-patches. (Fri, 16 Sep 2022 07:33:02 GMT) Full text and rfc822 format available.

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

From: Christopher Baines <mail <at> cbaines.net>
To: 57850 <at> debbugs.gnu.org
Subject: [PATCH 1/2] marionette: Make it easier to debug REPL read failures.
Date: Fri, 16 Sep 2022 09:32:35 +0200
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





Information forwarded to guix-patches <at> gnu.org:
bug#57850; Package guix-patches. (Fri, 16 Sep 2022 08:38:02 GMT) Full text and rfc822 format available.

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

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 57850 <at> debbugs.gnu.org
Subject: Re: bug#57850: Marionette fix + improvement
Date: Fri, 16 Sep 2022 10:37:07 +0200
Hey Chris,

> Log the remaining contnet written to the REPL, so that there's more to go on
                       ^
                       content

Looks fine!

Mathieu




Information forwarded to guix-patches <at> gnu.org:
bug#57850; Package guix-patches. (Fri, 16 Sep 2022 08:39:01 GMT) Full text and rfc822 format available.

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

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 57850 <at> debbugs.gnu.org
Subject: Re: bug#57850: Marionette fix + improvement
Date: Fri, 16 Sep 2022 10:38:08 +0200
> Since #<eof> can't be read.

You can maybe add:

Partially-Fixes: <https://issues.guix.gnu.org/57827>

Looks also fine,

Thanks,

Mathieu




Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Fri, 16 Sep 2022 10:42:01 GMT) Full text and rfc822 format available.

Notification sent to Christopher Baines <mail <at> cbaines.net>:
bug acknowledged by developer. (Fri, 16 Sep 2022 10:42:02 GMT) Full text and rfc822 format available.

Message #22 received at 57850-done <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 57850-done <at> debbugs.gnu.org
Subject: Re: bug#57850: Marionette fix + improvement
Date: Fri, 16 Sep 2022 12:40:33 +0200
[Message part 1 (text/plain, inline)]
Mathieu Othacehe <othacehe <at> gnu.org> writes:

>> Since #<eof> can't be read.
>
> You can maybe add:
>
> Partially-Fixes: <https://issues.guix.gnu.org/57827>
>
> Looks also fine,

Great, I've pushed these patches as
eb9a39c1b75a60fe3946496bb2eee8f32dbf09cd.

Thanks,

Chris
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 14 Oct 2022 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 195 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.