unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: 33470@debbugs.gnu.org, 34249@debbugs.gnu.org
Subject: bug#33470: [bug#34249] [PATCH] guix package: Avoid spinner at end of output.
Date: Tue, 29 Jan 2019 23:46:03 +0100	[thread overview]
Message-ID: <8736pbm6ac.fsf@gnu.org> (raw)
In-Reply-To: <20190129211645.08cdbd2d@scratchpost.org> (Danny Milosavljevic's message of "Tue, 29 Jan 2019 21:16:45 +0100")

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

Danny Milosavljevic <dannym@scratchpost.org> skribis:

> Hi Christopher,
>> diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
>> index a633d2ee6d..4db0e72e9b 100644
>> --- a/guix/scripts/package.scm
>> +++ b/guix/scripts/package.scm
>> @@ -159,6 +159,7 @@ hooks\" run when building the profile."
>>                 (switch-symlinks profile (basename name))
>>                 (unless (string=? profile %current-profile)
>>                   (register-gc-root store name))
>> +               (display "\r") ; erase the spinner
>
> In order to actually erase it, might want to do (display "\r\x1b[K") instead.

And to do that, you can use (erase-current-line port).

Though actually I think this should be done in ‘print-build-event’ in
(guix status).  Probably something like the patch below, but I haven’t
been able to quickly reproduce the initial problem.

Could you give it a spin (ah ha!) and report back?

If it doesn’t solve the issue, we should strace the thing to see why it
keeps spinning after everything is “done” basically.

Thanks,
Ludo’.


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

diff --git a/guix/status.scm b/guix/status.scm
index e3375816c5..7a330525b0 100644
--- a/guix/status.scm
+++ b/guix/status.scm
@@ -465,8 +465,14 @@ addition to build events."
             (_
              (spin! port))))))
 
-  (unless print-log?
-    (display "\r" port))                          ;erase the spinner
+  (define erase-current-line*
+    (if (isatty?* port)
+        (lambda (port)
+          (erase-current-line port)
+          (force-output port))
+        (const #t)))
+
+  (erase-current-line* port)                      ;clear the spinner
   (match event
     (('build-started drv . _)
      (let ((properties (derivation-properties

       reply	other threads:[~2019-01-29 22:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190129195031.21496-1-mail@cbaines.net>
     [not found] ` <20190129211645.08cdbd2d@scratchpost.org>
2019-01-29 22:46   ` Ludovic Courtès [this message]
2019-02-06 13:16     ` bug#33470: [bug#34249] [PATCH] guix package: Avoid spinner at end of output Christopher Baines
2019-02-06 14:32       ` bug#33470: bug#34249: " Ricardo Wurmus
2019-02-07 16:09         ` 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=8736pbm6ac.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=33470@debbugs.gnu.org \
    --cc=34249@debbugs.gnu.org \
    --cc=dannym@scratchpost.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).