unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Mathieu Othacehe <othacehe@gnu.org>
Cc: 41668@debbugs.gnu.org, Brice Waegeneire <brice@waegenei.re>
Subject: bug#41668: Failing test: gui-installed-desktop-os-encrypted
Date: Tue, 09 Jun 2020 16:22:02 +0200	[thread overview]
Message-ID: <871rmojp4l.fsf@gnu.org> (raw)
In-Reply-To: <87v9k0o5by.fsf@gnu.org> (Mathieu Othacehe's message of "Tue, 09 Jun 2020 13:18:25 +0200")

[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]

Hi,

Mathieu Othacehe <othacehe@gnu.org> skribis:

> From 18754c8c62eabb341e0f710d83ff435ef950ca8e Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <othacehe@gnu.org>
> Date: Mon, 8 Jun 2020 15:14:49 +0200
> Subject: [PATCH] installer: utils: Dump command output to syslog when testing.
>
> When debugging the installation tests, it can be very handy to be able to read
> "run-command" output, for instance when executing "guix system init".
>
> Introduce a new "invoke-with-log" procedure that is able to log a command
> standard and error outputs to the syslog. Use it, only when running the
> installation tests, to dump "run-command" output.
>
> * gnu/installer/utils.scm (open-pipe-with-stderr, invoke-with-log): New
> procedures,
> (invoke-log-port): new variable,
> (run-command): move to the end of the file and use invoke-with-log when
> running the installation tests.
> ---
>  gnu/installer/utils.scm | 164 +++++++++++++++++++++++++++++-----------
>  1 file changed, 120 insertions(+), 44 deletions(-)

It’s nice, but also a bit complicated just to print stuff on the
screen.  :-)

I found a stash with my debugging hack:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 833 bytes --]

diff --git a/gnu/installer/final.scm b/gnu/installer/final.scm
index 869be8814b..c084123064 100644
--- a/gnu/installer/final.scm
+++ b/gnu/installer/final.scm
@@ -137,7 +137,13 @@ or #f.  Return #t on success and #f on failure."
       (lambda ()
         (start-service 'cow-store (list (%installer-target-dir))))
       (lambda ()
-        (run-command install-command #:locale locale))
+        (with-output-to-file "/dev/console"
+          (lambda ()
+            (with-error-to-file "/dev/console"
+              (lambda ()
+                (setvbuf (current-output-port) 'none)
+                (setvbuf (current-error-port) 'none)
+                (run-command install-command #:locale locale))))))
       (lambda ()
         (stop-service 'cow-store)
         ;; Remove the store overlay created at cow-store service start.

[-- Attachment #3: Type: text/plain, Size: 246 bytes --]


That’s enough to send the ‘guix system init’ output to the console,
since we use “console=ttyS0”.

It’s a gross hack of course, but maybe we can do something along these
lines instead of setting up a pipe?

Thanks,
Ludo’.

  reply	other threads:[~2020-06-09 14:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02 18:52 bug#41668: Failing test: gui-installed-desktop-os-encrypted Brice Waegeneire
2020-06-06 10:16 ` Mathieu Othacehe
2020-06-07 15:28   ` Mathieu Othacehe
2020-06-07 19:54     ` Ludovic Courtès
2020-06-08  8:47       ` Mathieu Othacehe
2020-06-08 13:24         ` Mathieu Othacehe
2020-06-09 11:18           ` Mathieu Othacehe
2020-06-09 14:22             ` Ludovic Courtès [this message]
2020-06-09 16:01               ` Mathieu Othacehe
2020-06-08 14:26       ` Danny Milosavljevic
2020-06-09 14:24         ` Ludovic Courtès
2020-06-14 16:16   ` Mathieu Othacehe
2020-06-14 20:28     ` Ludovic Courtès
2020-06-16 15:40       ` Mathieu Othacehe
2020-06-17 12:33         ` Ludovic Courtès
2020-09-11  7:32           ` Mathieu Othacehe
2020-09-11 14:42             ` Ludovic Courtès

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=871rmojp4l.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=41668@debbugs.gnu.org \
    --cc=brice@waegenei.re \
    --cc=othacehe@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).