From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id OEKsKWBTT2XCLgAAauVa8A:P1 (envelope-from ) for ; Sat, 11 Nov 2023 11:11:44 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id OEKsKWBTT2XCLgAAauVa8A (envelope-from ) for ; Sat, 11 Nov 2023 11:11:44 +0100 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 51187464F1 for ; Sat, 11 Nov 2023 11:11:44 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b="oCe/P+rY"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1699697504; 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: content-transfer-encoding:content-transfer-encoding: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:dkim-signature; bh=DX3BDmW0jRP0Zlh5xFoJjNFbepw88msHRM9+VbfdVxg=; b=kCDSJwlmeGtgOgCSmbCzLUy9q3zjBWXSXXUcGnBpaon94ItHnelc41uY2HcBQFh7q9Zz/w XWbPYPX6IIFJ+tG6Q5LRtnSaY4yaU2y5+t8LmNwSc0FVWuuhr8z1WcrRKXjqkMRnoqRddv ZXvewGx/fUuvHfGyxnduyPc3QD1CQfjp2xhAgpPkPS65VaX97/EUdQEGiwoaQVYTNxhyI5 37jwvpXcBadTcgkSAyOKlCvWQ9on3qUX24dyY2HVwVJlrnEXNid9Zgy0f210qOITSXIyVj 0Uu2yGLXuJ+dgAuFCkhTvOo+Er6Is6sZZSQsdMwwQFnGeOsqcIQblL423gIE/g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b="oCe/P+rY"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1699697504; a=rsa-sha256; cv=none; b=nOvkqQOEdx1/KY5AF90c+E26pab6FMpSkV1ePLUIpspuoIYZuDjZguskLRFjjLiZNrWY8F yEU+FUNelOg7KdhL5v/tIm/cwIX/1aLD8AwVEuPkwQ4ZHrgTrVXVVlC+pXZc3St+TJL39N ImYlNHfMZE5i+RZ/++5PE3CHCJzFjQ1+pZnPsq1SY7vwi+8vCVGwozz5uABFE6miwDiaFA sbYDT6LFlUfTCEQNIuF6yDmlFQK3KsHFeLxuUdihcbd46VCHwCGXAnSEZDTTMqQIyrRuA0 HcuDfkHZsGyAw4Fbnm2ZkjDbIkiyVD1Xs3CVKgGF6rYWMtW1cp40olqAGwkPjA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1kxY-0002GA-4r; Sat, 11 Nov 2023 05:11:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1kxW-0002FU-9t for guix-patches@gnu.org; Sat, 11 Nov 2023 05:11:22 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r1kxW-00072O-1k for guix-patches@gnu.org; Sat, 11 Nov 2023 05:11:22 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r1kyA-0003zs-1n for guix-patches@gnu.org; Sat, 11 Nov 2023 05:12:02 -0500 Subject: bug#65546: [PATCH v2] guix: Properly compute progress bar width. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Sat, 11 Nov 2023 10:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 65546 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Ricardo Wurmus , 65546-done@debbugs.gnu.org Mail-Followup-To: 65546@debbugs.gnu.org, julien@lepiller.eu, julien@lepiller.eu Received: via spool by 65546-done@debbugs.gnu.org id=D65546.169969751615349 (code D ref 65546); Sat, 11 Nov 2023 10:12:01 +0000 Received: (at 65546-done) by debbugs.gnu.org; 11 Nov 2023 10:11:56 +0000 Received: from localhost ([127.0.0.1]:52074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1ky3-0003zU-IQ for submit@debbugs.gnu.org; Sat, 11 Nov 2023 05:11:56 -0500 Received: from lepiller.eu ([89.234.186.109]:50258 helo=hermes.lepiller.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1kxy-0003zJ-FD for 65546-done@debbugs.gnu.org; Sat, 11 Nov 2023 05:11:54 -0500 Received: from hermes.lepiller.eu (localhost [127.0.0.1]) by hermes.lepiller.eu (OpenSMTPD) with ESMTP id 7caf0868; Sat, 11 Nov 2023 10:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=m8bDpsAUPvRY bmXYj0grD816lzYwVUe81mkEXveQtTo=; b=oCe/P+rYmmgaFxED4ygysYnNEhzj UtGx0/R+Lac/pJD6SVCrV+wQDHIvxXNiBlCkvz6K3pR7nXytk+VGS0RG0IVG0bNM Qcbp5TjJs0ojkTspigIPH6AaQ/6M1ZbPfUOv8oChft1mtlumkrfRZHE7LLGBm7fe tJid3AtVir1vQFydqR13qWjvFrzpS3TkmIJ5q0Lu6egXHiDpPUaZROnZ71PhJD17 dU5vGaxizyi3576nYjBGk6U1P6b7903V21rKZJN7xJDUOX/LpEqSkqVsoG8mUVwm HBxTPZqyR2a5QHkehlMzVrfKFR/Ub35MZqb5+yK2q9QEuF7+mN5BJEs26g== Received: by hermes.lepiller.eu (OpenSMTPD) with ESMTPSA id 6f903406 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 11 Nov 2023 10:11:07 +0000 (UTC) Date: Sat, 11 Nov 2023 11:11:06 +0100 From: Julien Lepiller Message-ID: <20231111111106.790e92b7@lepiller.eu> In-Reply-To: <8734ygswmg.fsf@gnu.org> References: <20230826063655.2227-1-julien@lepiller.eu> <20230909172047.6254-1-julien@lepiller.eu> <8734ygswmg.fsf@gnu.org> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-pc-linux-gnu) 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 2.89 X-Spam-Score: 2.89 X-Migadu-Queue-Id: 51187464F1 X-Migadu-Scanner: mx13.migadu.com X-TUID: tXYK/OMv/KNl Le Wed, 11 Oct 2023 23:00:07 +0200, Ludovic Court=C3=A8s a =C3=A9crit : > Hi Julien, >=20 > Julien Lepiller skribis: >=20 > > * guix/build/syscalls.scm (terminal-width): New procedure. > > * guix/progress.scm (progress-reporter/bar): Use it to compute > > progress bar width. > > * guix/git.scm (show-progress): Use it to compute progress bar > > width. > > * tests/syscalls.scm: Add tests. =20 >=20 > Others have already said =E2=80=9CLGTM=E2=80=9D, and I concur. I=E2=80= =99ll still make a > couple of minor suggestions but that shoudln=E2=80=99t stop you from going > ahead (everyone=E2=80=99s waiting for it :-)). >=20 > > +(define get-wchar-ffi > > + (pointer->procedure int > > + (dynamic-func "mbstowcs" (dynamic-link)) > > + (list '* '* size_t))) > > +(define terminal-string-width-ffi > > + (pointer->procedure int > > + (dynamic-func "wcswidth" (dynamic-link)) > > + (list '* size_t))) > > + > > +(define (terminal-string-width str) > > + "Return the width of a string as it would be printed on the > > terminal. This +procedure accounts for characters that have a > > different width than 1, such as +CJK double-width characters." =20 >=20 > I=E2=80=99d suggest following the style of the rest of the file, which is= to > do something like: >=20 > (define terminal-string-width > (let ((mbstowcs (syscall->procedure =E2=80=A6)) > (wcswidth (syscall->procedure =E2=80=A6))) > (lambda (str) > =E2=80=A6))) >=20 > Ideally the syscalls.scm changes would be in a commit separate from > the progress.scm changes. >=20 > Now we have the problem that OpenJDK unfortunately depends on (guix > build syscalls), which makes this change half-of-the-world-rebuild. > There=E2=80=99s another pending syscalls.scm change: >=20 > https://issues.guix.gnu.org/66055 > https://issues.guix.gnu.org/66054 >=20 > Time to create a branch? >=20 > Ludo=E2=80=99. It seems OpenJDK and other packages don't depend on syscalls anymore (and the blocking bug was marked as done), so pushed to master as 28ca80717da67f90a3b33491e9807a053cf09c2d. I tried to follow your advice and split the patch in two. Thanks!