GNU bug report logs -
#34249
[PATCH] guix package: Avoid spinner at end of output.
Previous Next
Reported by: Christopher Baines <mail <at> cbaines.net>
Date: Tue, 29 Jan 2019 19:51:01 UTC
Severity: normal
Tags: patch
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 34249 in the body.
You can then email your comments to 34249 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#34249
; Package
guix-patches
.
(Tue, 29 Jan 2019 19:51:01 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
.
(Tue, 29 Jan 2019 19:51:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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
Information forwarded
to
guix-patches <at> gnu.org
:
bug#34249
; Package
guix-patches
.
(Tue, 29 Jan 2019 20:17:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 34249 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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.
[Message part 2 (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#34249
; Package
guix-patches
.
(Tue, 29 Jan 2019 22:47:04 GMT)
Full text and
rfc822 format available.
Message #11 received at 34249 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Danny Milosavljevic <dannym <at> 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’.
[Message part 2 (text/x-patch, inline)]
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 sent
to
Christopher Baines <mail <at> cbaines.net>
:
You have taken responsibility.
(Wed, 06 Feb 2019 13:17:03 GMT)
Full text and
rfc822 format available.
Notification sent
to
Christopher Baines <mail <at> cbaines.net>
:
bug acknowledged by developer.
(Wed, 06 Feb 2019 13:17:03 GMT)
Full text and
rfc822 format available.
Message #16 received at 34249-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:
> Danny Milosavljevic <dannym <at> 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
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#34249
; Package
guix-patches
.
(Wed, 06 Feb 2019 14:33:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 34249-done <at> debbugs.gnu.org (full text, mbox):
Christopher Baines <mail <at> 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
Information forwarded
to
guix-patches <at> gnu.org
:
bug#34249
; Package
guix-patches
.
(Thu, 07 Feb 2019 16:10:04 GMT)
Full text and
rfc822 format available.
Message #22 received at 34249-done <at> debbugs.gnu.org (full text, mbox):
Hi!
Ricardo Wurmus <rekado <at> elephly.net> skribis:
> Christopher Baines <mail <at> 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’.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 08 Mar 2019 12:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 6 years and 108 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.