all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 45146@debbugs.gnu.org
Subject: [bug#45146] [PATCH] scripts: substitute: Improve fetch-narinfos progress reporting.
Date: Thu, 24 Dec 2020 17:26:50 +0000	[thread overview]
Message-ID: <87v9cr9kth.fsf@cbaines.net> (raw)
In-Reply-To: <87mtyk43y7.fsf@gnu.org>

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


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

> Christopher Baines <mail@cbaines.net> skribis:
>
>> At least in guix weather, these changes make the progress bar actually appear.
>>
>> * guix/scripts/substitute.scm (fetch-narinfos): Use (guix progress) for
>> progress reporting.
>
> Cool.  I noticed that something was wrong with ‘guix weather’, but I
> suspected it had to do with the order in which the erase-line sequence
> and \r are sent.
>
>> -      (lambda ()
>> -        (display "\r\x1b[K" (current-error-port)) ;erase current line
>> -        (force-output (current-error-port))
>> -        (format (current-error-port)
>> -                (G_ "updating substitutes from '~a'... ~5,1f%")
>> -                url (* 100. (/ done total)))
>> -        (set! done (+ 1 done)))))
>> +  (define fetch-narinfos-progress-reporter
>> +    (progress-reporter/bar (length paths)))
>
> The problem here is that we’d see a progress bar without knowing what it
> represents.
>
> Besides, currently output from ‘guix substitute’ is printed as is by
> client commands, regardless of whether stdout is a tty.  The problem
> already exists but it would become a bit more visible as logs get filled
> with progress bars.

Maybe it's best to circle back to fixing guix weather after trying to
restructure some of the guix substitute code.

I've made an initial attempt at moving things around in [1]. If the
underlying code can live in a module, and then the substitute, weather
and challenge scripts use that code with whatever UI stuff they want,
maybe that will allow for better addressing this weather specific issue.

1: https://issues.guix.info/45409

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

  reply	other threads:[~2020-12-24 17:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09 18:57 [bug#45146] [PATCH] scripts: substitute: Improve fetch-narinfos progress reporting Christopher Baines
2020-12-11 18:01 ` Ludovic Courtès
2020-12-24 17:26   ` Christopher Baines [this message]
2021-02-24 20:44     ` Christopher Baines
2021-03-09 20:29       ` bug#45146: " Christopher Baines
2021-02-24 20:34 ` [bug#45146] [PATCH 1/2] guix: substitutes: Make progress reporting configurable Christopher Baines
2021-02-24 20:34   ` [bug#45146] [PATCH 2/2] weather: Call lookup-narinfos with a custom progress reporter Christopher Baines

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v9cr9kth.fsf@cbaines.net \
    --to=mail@cbaines.net \
    --cc=45146@debbugs.gnu.org \
    --cc=ludo@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 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.