all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#34249] [PATCH] guix package: Avoid spinner at end of output.
@ 2019-01-29 19:50 Christopher Baines
  2019-01-29 20:16 ` Danny Milosavljevic
  0 siblings, 1 reply; 7+ messages in thread
From: Christopher Baines @ 2019-01-29 19:50 UTC (permalink / raw)
  To: 34249

Often guix package will report something like the following when performing
operations, for example:

  guix package -i hello
  ...
  building /gnu/store/wiwqmbi66gcr27dac3qqgrc8imyp1344-profile.drv...
  -117 packages in profile

Now there aren't -117 packages in this profile, it's just the spinner running
in to the output from Guix package. I'm not sure if this is a proper solution
for this issue, but it does work.

* guix/scripts/package.scm (build-and-use-profile): Erase the spinner before
output.
---
 guix/scripts/package.scm | 1 +
 1 file changed, 1 insertion(+)

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
                (format #t (N_ "~a package in profile~%"
                               "~a packages in profile~%"
                               count)
-- 
2.20.1

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

* [bug#34249] [PATCH] guix package: Avoid spinner at end of output.
  2019-01-29 19:50 [bug#34249] [PATCH] guix package: Avoid spinner at end of output Christopher Baines
@ 2019-01-29 20:16 ` Danny Milosavljevic
  2019-01-29 22:46   ` bug#33470: " Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Danny Milosavljevic @ 2019-01-29 20:16 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 34249

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

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.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* bug#33470: [bug#34249] [PATCH] guix package: Avoid spinner at end of output.
  2019-01-29 20:16 ` Danny Milosavljevic
@ 2019-01-29 22:46   ` Ludovic Courtès
  2019-02-06 13:16       ` bug#34249: " Christopher Baines
  0 siblings, 1 reply; 7+ 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] 7+ messages in thread

* bug#33470: [bug#34249] [PATCH] guix package: Avoid spinner at end of output.
  2019-01-29 22:46   ` bug#33470: " Ludovic Courtès
@ 2019-02-06 13:16       ` Christopher Baines
  0 siblings, 0 replies; 7+ 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] 7+ messages in thread

* bug#34249: [PATCH] guix package: Avoid spinner at end of output.
@ 2019-02-06 13:16       ` Christopher Baines
  0 siblings, 0 replies; 7+ 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] 7+ messages in thread

* bug#33470: bug#34249: [PATCH] guix package: Avoid spinner at end of output.
  2019-02-06 13:16       ` bug#34249: " Christopher Baines
  (?)
@ 2019-02-06 14:32       ` Ricardo Wurmus
  2019-02-07 16:09         ` Ludovic Courtès
  -1 siblings, 1 reply; 7+ 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] 7+ messages in thread

* bug#33470: bug#34249: [PATCH] guix package: Avoid spinner at end of output.
  2019-02-06 14:32       ` bug#33470: " Ricardo Wurmus
@ 2019-02-07 16:09         ` Ludovic Courtès
  0 siblings, 0 replies; 7+ 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] 7+ messages in thread

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-29 19:50 [bug#34249] [PATCH] guix package: Avoid spinner at end of output Christopher Baines
2019-01-29 20:16 ` Danny Milosavljevic
2019-01-29 22:46   ` bug#33470: " Ludovic Courtès
2019-02-06 13:16     ` Christopher Baines
2019-02-06 13:16       ` bug#34249: " Christopher Baines
2019-02-06 14:32       ` bug#33470: " Ricardo Wurmus
2019-02-07 16:09         ` Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.