From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id BjYcO07hR2CXZgAA0tVLHw (envelope-from ) for ; Tue, 09 Mar 2021 20:57:50 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id gPtSNk7hR2DjWgAA1q6Kng (envelope-from ) for ; Tue, 09 Mar 2021 20:57:50 +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 341001C074 for ; Tue, 9 Mar 2021 21:57:50 +0100 (CET) Received: from localhost ([::1]:41166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJjQL-0005gP-8A for larch@yhetil.org; Tue, 09 Mar 2021 15:57:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJizS-0005BQ-Rg for guix-patches@gnu.org; Tue, 09 Mar 2021 15:30:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:36492) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJizS-0001eG-He for guix-patches@gnu.org; Tue, 09 Mar 2021 15:30:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lJizS-0006oB-Dp for guix-patches@gnu.org; Tue, 09 Mar 2021 15:30:02 -0500 Subject: bug#45146: [PATCH] scripts: substitute: Improve fetch-narinfos progress reporting. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Tue, 09 Mar 2021 20:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 45146 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45146-done@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Mail-Followup-To: 45146@debbugs.gnu.org, mail@cbaines.net, mail@cbaines.net Received: via spool by 45146-done@debbugs.gnu.org id=D45146.161532178726122 (code D ref 45146); Tue, 09 Mar 2021 20:30:02 +0000 Received: (at 45146-done) by debbugs.gnu.org; 9 Mar 2021 20:29:47 +0000 Received: from localhost ([127.0.0.1]:48035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJizD-0006nG-Cb for submit@debbugs.gnu.org; Tue, 09 Mar 2021 15:29:47 -0500 Received: from mira.cbaines.net ([212.71.252.8]:44942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJizB-0006n7-Is for 45146-done@debbugs.gnu.org; Tue, 09 Mar 2021 15:29:46 -0500 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id 6AC8E27BC50; Tue, 9 Mar 2021 20:29:44 +0000 (GMT) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id b46b8627; Tue, 9 Mar 2021 20:29:43 +0000 (UTC) References: <20201209185759.30937-1-mail@cbaines.net> <87mtyk43y7.fsf@gnu.org> <87v9cr9kth.fsf@cbaines.net> <87y2fdjiuy.fsf@cbaines.net> User-agent: mu4e 1.4.15; emacs 27.1 From: Christopher Baines In-reply-to: <87y2fdjiuy.fsf@cbaines.net> Date: Tue, 09 Mar 2021 20:29:40 +0000 Message-ID: <87r1ko9ikr.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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615323470; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-to:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=U08koeAvV8ZKk8Wwzj2hD3opcKwGz4ndjNLvG7qLMkA=; b=cfYfePl+OANQTV1R8A84eAonez4cDGIHEW6SsgX5s4Lmb1/CvcWf0AjdlwB4oAezQxO8V2 FiSR8mhPLiuhBBEeeKor6Kvm+RO3wA/TjXaB/72RWTVT98dNmja+fxjZA+dwqaTMSEah4V oTvEFJNu1nMoCQ/vHkoWkzoHDkC3EIWhtXK7HDZJ1rGWgDit4Awbqkg6WZ8UnGj3Jf8cnf 017CsR6PiDPDdwmGhn6svhYXJCNH2QZPNhYOQYOuPsM97tvbOvPwAsufS3PLx4eVBj4Jeh waWB6FecNYabVnLlbwEbDzHMqnLFtgfQ4cNq2Jk3ySlV8dxG97Wtq4+sKHMG/A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615323470; a=rsa-sha256; cv=none; b=sMJ9G0pspvHvegRZLw4A4MIR9igWHUjJeGcPb8iu+ut+jVOrf5QfCSzKUqU2PowAvq3mny Sn4YP+zJAx6P+ZjrO7O2foYHUc+tZDxewhLHTQ11/BM5Pxd63fg60b5k0Y3txBNxClrTAN kvPlwdezXFw46/7uD6pclgiZlysioxpMWxgIHE3AKPzZXhjE9+3KtmlX9J4bsgYr8wLCau 3x65ytJ/lGdPyf3QvuLe38z9W33QSuI4UD6t5nEqBGfSrVQwgKTRTY9vqUIKgp/bgLpLkZ Tjz4hst4RqMTyxyBZ7KHkq5ICyvQqh4AwEfGoxYT44h0yKTDsccP9ru8A6eWFw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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-Spam-Score: -4.48 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: 341001C074 X-Spam-Score: -4.48 X-Migadu-Scanner: scn0.migadu.com X-TUID: t+dPAUOph9uZ --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Christopher Baines writes: > 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 knowin= g what it >>> represents. >>> >>> Besides, currently output from =E2=80=98guix substitute=E2=80=99 is pri= nted 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. I've gone ahead and pushed these patches now as f5ffb3bd9cd59cfff5b4625d6d65e8d116d0a25b. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmBH2rRfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XdQMhAAgiNV2SY/UBsSmZ2UYhRslrWwWZwUQMVQ mPEX9n9FlYXH1fQI1ozVJucBLsbLzTuv8n1wYDi7dYgTr9U3U7tBV2NwZjeYwU+j x2Y3jp06U1L+H/n+s9k74Eevu3Pcr3EGBfUZwQIjFTScmDvVkdaWO9aPMcFxAcL4 eDt9zh6cWUYBW+cRMKWQP+FK0FuBRH6tMG/BOdx9Ns627RPatokwjhNROzf17/tA y5AwYC49WI/5MNat14b23wfkrv77xd3kZ/A06ZripXyVxlwqQ75ZXu78TRQ1BwsV ojtYmLKDiJFzOoirBLZTtAUUZUXVZLsCvLdFQYFw9820fhL5eO7ec3pKdkW0yhmw ghgSvFkPA6Z7oBdtokPcrZAKbLIKw8DUuVXiAGLUJ8QBVSWwj7eiu5W+ZUIzrOk7 4YrmOec7Qn32vfxdsTBiG+n27UcRIZmT3nYEAFUs3n14fcR/oB9XFokM7RnD7a8k 87wq2PDwvwKUYFgFABn2WGx+lMPcwkuuT4rw4Tz3yIfd8FD48//mHjgepC2bOm51 7+mm1s+rVXnGoAlwOuSLc/S/Pp1CYXkSjIi2C5/xYc9tqZhmEjXxanx3QoynTOrM 5mumL21El1E/eNnHQ5Pt7JqGac/EUxoB+dliNYGrjp+5ZpqV7PpkSVqoG+ZuD0TL 3xtoZ6HvTsk= =rT0w -----END PGP SIGNATURE----- --=-=-=--