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 qLVWGdu6NmAnOwAA0tVLHw (envelope-from ) for ; Wed, 24 Feb 2021 20:45:15 +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 aEEUFdu6NmC4eAAAB5/wlQ (envelope-from ) for ; Wed, 24 Feb 2021 20:45:15 +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 24D6FD004 for ; Wed, 24 Feb 2021 21:45:14 +0100 (CET) Received: from localhost ([::1]:58422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lF121-0001bz-AF for larch@yhetil.org; Wed, 24 Feb 2021 15:45:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lF11t-0001bX-VL for guix-patches@gnu.org; Wed, 24 Feb 2021 15:45:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:52745) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lF11q-0000O0-20 for guix-patches@gnu.org; Wed, 24 Feb 2021 15:45:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lF11p-0006eX-Vr for guix-patches@gnu.org; Wed, 24 Feb 2021 15:45:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45146] [PATCH] scripts: substitute: Improve fetch-narinfos progress reporting. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 24 Feb 2021 20:45: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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 45146@debbugs.gnu.org Received: via spool by 45146-submit@debbugs.gnu.org id=B45146.161419949825551 (code B ref 45146); Wed, 24 Feb 2021 20:45:01 +0000 Received: (at 45146) by debbugs.gnu.org; 24 Feb 2021 20:44:58 +0000 Received: from localhost ([127.0.0.1]:36058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lF11m-0006e3-KM for submit@debbugs.gnu.org; Wed, 24 Feb 2021 15:44:58 -0500 Received: from mira.cbaines.net ([212.71.252.8]:42368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lF11l-0006dv-AL for 45146@debbugs.gnu.org; Wed, 24 Feb 2021 15:44:57 -0500 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id 9A9FE27BC4A; Wed, 24 Feb 2021 20:44:56 +0000 (GMT) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 61539ce8; Wed, 24 Feb 2021 20:44:56 +0000 (UTC) References: <20201209185759.30937-1-mail@cbaines.net> <87mtyk43y7.fsf@gnu.org> <87v9cr9kth.fsf@cbaines.net> User-agent: mu4e 1.4.14; emacs 27.1 From: Christopher Baines In-reply-to: <87v9cr9kth.fsf@cbaines.net> Date: Wed, 24 Feb 2021 20:44:53 +0000 Message-ID: <87y2fdjiuy.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.47 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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: 24D6FD004 X-Spam-Score: -4.47 X-Migadu-Scanner: scn1.migadu.com X-TUID: xklsT4K/WDCd --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Christopher Baines writes: > Ludovic Court=C3=A8s writes: > >> Christopher Baines 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 =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= what it >> represents. >> >> Besides, currently output from =E2=80=98guix substitute=E2=80=99 is prin= ted 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 I've sent a couple of updated patches for this. They're not particularly dependent on the above work to create the (guix substitutes) module, but I based the commits on that. These commits make more careful changes, the substitute script behaviour should remain the same. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmA2usVfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XfR8w/+Ja+e71rNDfGpa19X6X3ERGYBDKYqKa4U xBd6e94Yd1zK4pgPRl2dJ0Ril31RUPREkSEx4QkAtn81cHUWQ6dVEf5L3yu8VBto 3V8K/7JuHLsilmInKOsdHRQUlX2FWnR/hj8hu9ZNpfBRPCHUypHgnGn0ZirOoDyE iURu2waXyBdGuILnECxyIpbz1QpwUi8/HVQZ0YPm/AVUo9D84uWQ7g6A88kS2gBG CjE1K5TIWZUWO9afunMrgMv/4sEzHpuvjm4JFnD6VGVJ3FFw4IEt+qsjuhevBl9g fy31eQWz9dRigWM9/lzVrZJMf2kDSdQ+DGEA9JgDMVcjlbDBkdCYAciXXCajageP OTSNY/3KlrGr0ZkMnXhBYli9HOkArknyV3RG5MEW7GWLH37FjJrW1v5hECuRoIHD prVPribYQI3bjpdv3L75/UL465J0PiuFHaWQZcWFccDynwsCNE7KnEl5ajrvp9kd zobGGXX5yLQcQziMfUElFY2zpVDbrxpd98sLhoIJb/1UiL6kpM/S4tLCSd8vgiij qI1uIesI5Hahwp2Ls2Tjpq906rgGAuRChjqWJ8Qvidb4s+Fy/V5LscgB1F84fJb1 lpQFmS+65t0iWJgPH4ljrzm9hN6BMv5bBkmPKw6baEJ5uqnG370P7828wTBmWQIc gak1OEesTQE= =QXvR -----END PGP SIGNATURE----- --=-=-=--