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 KBreOW/P5F/4GgAA0tVLHw (envelope-from ) for ; Thu, 24 Dec 2020 17:27:11 +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 GNi7NW/P5F8TNgAAB5/wlQ (envelope-from ) for ; Thu, 24 Dec 2020 17:27:11 +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 AFFCB9402A5 for ; Thu, 24 Dec 2020 17:27:11 +0000 (UTC) Received: from localhost ([::1]:48426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ksUOM-00020W-LR for larch@yhetil.org; Thu, 24 Dec 2020 12:27:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ksUOF-0001zZ-9o for guix-patches@gnu.org; Thu, 24 Dec 2020 12:27:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ksUOF-0008Cv-2U for guix-patches@gnu.org; Thu, 24 Dec 2020 12:27:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ksUOE-0003oU-Vf for guix-patches@gnu.org; Thu, 24 Dec 2020 12:27:02 -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: Thu, 24 Dec 2020 17:27:02 +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?= Received: via spool by 45146-submit@debbugs.gnu.org id=B45146.160883081914634 (code B ref 45146); Thu, 24 Dec 2020 17:27:02 +0000 Received: (at 45146) by debbugs.gnu.org; 24 Dec 2020 17:26:59 +0000 Received: from localhost ([127.0.0.1]:55983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ksUOA-0003ny-Vk for submit@debbugs.gnu.org; Thu, 24 Dec 2020 12:26:59 -0500 Received: from mira.cbaines.net ([212.71.252.8]:56924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ksUO8-0003nq-Nv for 45146@debbugs.gnu.org; Thu, 24 Dec 2020 12:26:57 -0500 Received: from localhost (188.29.98.108.threembb.co.uk [188.29.98.108]) by mira.cbaines.net (Postfix) with ESMTPSA id EA23117AE0; Thu, 24 Dec 2020 17:26:55 +0000 (GMT) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id b07516c5; Thu, 24 Dec 2020 17:26:53 +0000 (UTC) References: <20201209185759.30937-1-mail@cbaines.net> <87mtyk43y7.fsf@gnu.org> User-agent: mu4e 1.4.13; emacs 27.1 From: Christopher Baines In-reply-to: <87mtyk43y7.fsf@gnu.org> Date: Thu, 24 Dec 2020 17:26:50 +0000 Message-ID: <87v9cr9kth.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: , 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.92 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: AFFCB9402A5 X-Spam-Score: -2.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: EU2yxlrQ9Xwj --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Christopher Baines skribis: > >> At least in guix weather, these changes make the progress bar actually a= ppear. >> >> * 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 print= ed 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl/kz1tfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XfAzw/+MYsnE4+kZ0dDKT+ftnyHxzo4lJ827PXJ ABTntv3qoF7ZhopXURCK5D3Vd5+GhzydEM9cvP7iKkk52i42omBen5rBcsZYxpML PpUVjc6NtMtWcMBEWWnQ+hsP7h46J1vK0iG4wxAfBwl0eL0aZiGyoppVx5jUiyTz M3UyfXl0vScYXcdGUdFA/itUikUXjzdL9TVdbVbNi3sa/AXH21rs1SxOP+r7xG7x g3DUL5ARKhHQuyMSzTlKNTnj1Tu/5W43+kx0qE64d9uJtTG14tMKP5REP/vMCzSV rwBaNnfdsbOpmHaWj9UigIlNLQb0l5jM78N534ofuS3zhINnvD7y8cHeOhBldVPK 2NOsBjf3me2LB+pkUdXH9037vwMkN8f9826YbaYFhhcbYrTsU9RZ3uABFLrVGn/9 RJySJ7feTg0iWuRtaYFSIO1Aa9vhQYdTJ75YQZ5I191cF8Pm5AqxLkjb40rgUCj+ he9/yIV++vdNWCzZwuw+7Gto6P/4mCtWHcxlVmM5qsXWt//bk/73bC9vOuCe79sD xN1hqWc118zJwn3SLgLBqU1+FCbQwOlL8RW23jU1yfBOmPj24IKp1thOaRnnsXNF 4H0X+2Z3kVw0ZIbpVjsVFrSamfgl6eRYGKinHx2QJQxmVMCLoepQR3tF6NPUrCOc BwpTbFwiRcA= =mDMM -----END PGP SIGNATURE----- --=-=-=--