unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33470: [bug#34249] [PATCH] guix package: Avoid spinner at end of output.
       [not found] ` <20190129211645.08cdbd2d@scratchpost.org>
@ 2019-01-29 22:46   ` Ludovic Courtès
  2019-02-06 13:16     ` Christopher Baines
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2019-01-29 22:46 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: 33470, 34249

[-- 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#33470: [bug#34249] [PATCH] guix package: Avoid spinner at end of output.
  2019-01-29 22:46   ` bug#33470: [bug#34249] [PATCH] guix package: Avoid spinner at end of output Ludovic Courtès
@ 2019-02-06 13:16     ` Christopher Baines
  2019-02-06 14:32       ` bug#33470: bug#34249: " Ricardo Wurmus
  0 siblings, 1 reply; 4+ messages in thread
From: Christopher Baines @ 2019-02-06 13:16 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 34249-done, 33470-done

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


Ludovic Courtès <ludo@gnu.org> writes:

> 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’.
>
> 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

I've tried out the change you pushed here [1], and it looks good to me
:) I can't see anything odd in the output now.

1: https://git.savannah.gnu.org/cgit/guix.git/commit/?id=7473bce207af846312d5167a398f5f20bbf3e896

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#33470: bug#34249: [PATCH] guix package: Avoid spinner at end of output.
  2019-02-06 13:16     ` Christopher Baines
@ 2019-02-06 14:32       ` Ricardo Wurmus
  2019-02-07 16:09         ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Ricardo Wurmus @ 2019-02-06 14:32 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 34249-done, 33470-done


Christopher Baines <mail@cbaines.net> writes:

> I've tried out the change you pushed here [1], and it looks good to me
> :) I can't see anything odd in the output now.
>
> 1: https://git.savannah.gnu.org/cgit/guix.git/commit/?id=7473bce207af846312d5167a398f5f20bbf3e896

With this change I see that there are now two empty lines between
“downloading” lines.  The updating line flickers, too.

I wonder if maybe too much is deleted.  I can’t give specifics, but it
did seem a little weird when I observed the output on my i686 machine.

--
Ricardo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#33470: bug#34249: [PATCH] guix package: Avoid spinner at end of output.
  2019-02-06 14:32       ` bug#33470: bug#34249: " Ricardo Wurmus
@ 2019-02-07 16:09         ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2019-02-07 16:09 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 34249-done, 33470-done, 33470

Hi!

Ricardo Wurmus <rekado@elephly.net> skribis:

> Christopher Baines <mail@cbaines.net> writes:
>
>> I've tried out the change you pushed here [1], and it looks good to me
>> :) I can't see anything odd in the output now.
>>
>> 1: https://git.savannah.gnu.org/cgit/guix.git/commit/?id=7473bce207af846312d5167a398f5f20bbf3e896
>
> With this change I see that there are now two empty lines between
> “downloading” lines.  The updating line flickers, too.
>
> I wonder if maybe too much is deleted.  I can’t give specifics, but it
> did seem a little weird when I observed the output on my i686 machine.

Indeed, I noticed it too.  I believe that
024d5275c5cd72c0121b4f70d64c63f859a68f17 fixes it.

Let me know!

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-07 16:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190129195031.21496-1-mail@cbaines.net>
     [not found] ` <20190129211645.08cdbd2d@scratchpost.org>
2019-01-29 22:46   ` bug#33470: [bug#34249] [PATCH] guix package: Avoid spinner at end of output Ludovic Courtès
2019-02-06 13:16     ` Christopher Baines
2019-02-06 14:32       ` bug#33470: bug#34249: " Ricardo Wurmus
2019-02-07 16:09         ` Ludovic Courtès

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).