From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qPP5CrG7018ZXAAA0tVLHw (envelope-from ) for ; Fri, 11 Dec 2020 18:34:25 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id wL3GBrG701/1GAAAB5/wlQ (envelope-from ) for ; Fri, 11 Dec 2020 18:34:25 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E18889404C7 for ; Fri, 11 Dec 2020 18:34:24 +0000 (UTC) Received: from localhost ([::1]:54036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knnFG-000214-NY for larch@yhetil.org; Fri, 11 Dec 2020 13:34:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knmjy-0000m5-FK for guix-patches@gnu.org; Fri, 11 Dec 2020 13:02:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59561) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1knmjy-0003vp-0f for guix-patches@gnu.org; Fri, 11 Dec 2020 13:02:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1knmjx-0007yV-S0 for guix-patches@gnu.org; Fri, 11 Dec 2020 13:02:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45146] [PATCH] scripts: substitute: Improve fetch-narinfos progress reporting. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 11 Dec 2020 18:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45146 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Received: via spool by 45146-submit@debbugs.gnu.org id=B45146.160770970730631 (code B ref 45146); Fri, 11 Dec 2020 18:02:01 +0000 Received: (at 45146) by debbugs.gnu.org; 11 Dec 2020 18:01:47 +0000 Received: from localhost ([127.0.0.1]:42874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1knmjj-0007xz-J2 for submit@debbugs.gnu.org; Fri, 11 Dec 2020 13:01:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1knmjh-0007xm-Gl for 45146@debbugs.gnu.org; Fri, 11 Dec 2020 13:01:45 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51201) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knmjb-0003mv-AZ; Fri, 11 Dec 2020 13:01:39 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=32882 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1knmjZ-0006px-DR; Fri, 11 Dec 2020 13:01:38 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20201209185759.30937-1-mail@cbaines.net> Date: Fri, 11 Dec 2020 19:01:36 +0100 In-Reply-To: <20201209185759.30937-1-mail@cbaines.net> (Christopher Baines's message of "Wed, 9 Dec 2020 18:57:59 +0000") Message-ID: <87mtyk43y7.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 45146@debbugs.gnu.org Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.80 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: E18889404C7 X-Spam-Score: -2.80 X-Migadu-Scanner: scn1.migadu.com X-TUID: ifhs33rZDqV6 Hi, Christopher Baines skribis: > At least in guix weather, these changes make the progress bar actually ap= pear. > > * guix/scripts/substitute.scm (fetch-narinfos): Use (guix progress) for > progress reporting. Cool. I noticed that something was wrong with =E2=80=98guix weather=E2=80= =99, 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=E2=80=99d see a progress bar without knowing wh= at it represents. Besides, currently output from =E2=80=98guix substitute=E2=80=99 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. Ludo=E2=80=99.