From unknown Fri Jun 20 07:09:33 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#65546 <65546@debbugs.gnu.org> To: bug#65546 <65546@debbugs.gnu.org> Subject: Status: [PATCH] guix: Properly compute progress bar width. Reply-To: bug#65546 <65546@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:09:33 +0000 retitle 65546 [PATCH] guix: Properly compute progress bar width. reassign 65546 guix-patches submitter 65546 Julien Lepiller severity 65546 normal tag 65546 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 26 02:38:41 2023 Received: (at submit) by debbugs.gnu.org; 26 Aug 2023 06:38:41 +0000 Received: from localhost ([127.0.0.1]:41576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZmwT-0001nE-DR for submit@debbugs.gnu.org; Sat, 26 Aug 2023 02:38:41 -0400 Received: from lists.gnu.org ([2001:470:142::17]:60516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZmwO-0001my-Sk for submit@debbugs.gnu.org; Sat, 26 Aug 2023 02:38:40 -0400 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 1qZmwC-0004lI-FV for guix-patches@gnu.org; Sat, 26 Aug 2023 02:38:25 -0400 Received: from lepiller.eu ([2a00:5884:8208::1] helo=localhost) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZmw8-0006VS-2Q for guix-patches@gnu.org; Sat, 26 Aug 2023 02:38:23 -0400 Received: from localhost (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id f6952dbe for ; Sat, 26 Aug 2023 06:37:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:mime-version:content-transfer-encoding; s=dkim; bh=1xlwRh/ihmH4yclBriW/mA/2tgGwt1xRWCBwDoc1+nA=; b=gSZN CdOqCqnfs6mn35neSTApG29XNsNQo8uC3JD0BGyQ9GoIfhd++GHkwE4pH2f4YLpx nE9TnsBSU9glTiG8E5fD0M7IWHGyszntZCN7TyCgyM9OLNp9gfQfUoVNBVTZR70Q EXH28mKFKyzDALDXGnipVqdrI3BHDKgkfwndt2V6tc4cQb8VC23wCIDy3RqzkStQ 1ROKyxtrPRT+ximrnzPcpEijdkPkGGboq2QViEokDuPFjR67cmJ1lFihDDu6/BCC PAa44i1YT8NbUBRbtBIeu06D4k1p5ktsRfZ/ZcJE6xQr2Fe0jir5mQenGOBW5GE6 i8QH4jC7/XjlRRbylg== Received: by localhost (OpenSMTPD) with ESMTPSA id e76155e3 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Sat, 26 Aug 2023 06:37:09 +0000 (UTC) From: Julien Lepiller To: guix-patches@gnu.org Subject: [PATCH] guix: Properly compute progress bar width. Date: Sat, 26 Aug 2023 08:36:55 +0200 Message-ID: <20230826063655.2227-1-julien@lepiller.eu> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:5884:8208::1; envelope-from=julien@lepiller.eu; helo=localhost X-Spam_score_int: 17 X-Spam_score: 1.7 X-Spam_bar: + X-Spam_report: (1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FSL_HELO_NON_FQDN_1=0.001, HELO_LOCALHOST=3.828, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) * guix/progress.scm (terminal-width): New procedure. (progress-reporter/bar): Use it to compute progress bar width. * guix/git.scm (show-progress): Use it to compute progress bar width. --- guix/git.scm | 2 +- guix/progress.scm | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/guix/git.scm b/guix/git.scm index dbc3b7caa7..870045cddf 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -153,7 +153,7 @@ (define % ;; TODO: Both should be handled & exposed by the PROGRESS-BAR API instead. (define width (max (- (current-terminal-columns) - (string-length label) 7) + (terminal-width label) 7) 3)) (define grain diff --git a/guix/progress.scm b/guix/progress.scm index 33cf6f4a1a..8a84bcd1b0 100644 --- a/guix/progress.scm +++ b/guix/progress.scm @@ -24,6 +24,7 @@ (define-module (guix progress) #:use-module (srfi srfi-19) #:use-module (rnrs io ports) #:use-module (rnrs bytevectors) + #:use-module (system foreign) #:use-module (ice-9 format) #:use-module (ice-9 match) #:export ( @@ -47,6 +48,7 @@ (define-module (guix progress) progress-bar byte-count->string current-terminal-columns + terminal-width dump-port*)) @@ -166,6 +168,28 @@ (define current-terminal-columns ;; Number of columns of the terminal. (make-parameter 80)) +(define (terminal-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." + (define get-wchar-ffi + (pointer->procedure int + (dynamic-func "mbstowcs" (dynamic-link)) + (list '* '* size_t))) + (define terminal-width-ffi + (pointer->procedure int + (dynamic-func "wcswidth" (dynamic-link)) + (list '* size_t))) + (define (get-wchar str) + (let ((wchar (make-bytevector (* (+ (string-length str) 1) 4)))) + (get-wchar-ffi (bytevector->pointer wchar) + (string->pointer str) + (string-length str)) + wchar)) + (terminal-width-ffi + (bytevector->pointer (get-wchar str)) + (string-length str))) + (define-record-type* progress-bar-style make-progress-bar-style progress-bar-style? (start progress-bar-style-start) @@ -307,7 +331,7 @@ (define (draw-bar) (if (string-null? prefix) (display (progress-bar ratio (current-terminal-columns)) port) (let ((width (- (current-terminal-columns) - (string-length prefix) 3))) + (terminal-width prefix) 3))) (display prefix port) (display " " port) (display (progress-bar ratio width) port))) -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 09 09:48:37 2023 Received: (at 65546) by debbugs.gnu.org; 9 Sep 2023 13:48:37 +0000 Received: from localhost ([127.0.0.1]:46460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeyKD-0002RI-8n for submit@debbugs.gnu.org; Sat, 09 Sep 2023 09:48:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeyK9-0002Qp-8K for 65546@debbugs.gnu.org; Sat, 09 Sep 2023 09:48:35 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeyK0-0005Cf-SI; Sat, 09 Sep 2023 09:48:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=T0XyricgZn+OrJlvvkUXDPqhA9+HdFxt7lJjiNvEICM=; b=NDnabhOKZCulImFQXbmt Dzl5nd2uGRbLjoh3irHz0aCmQl6ry+iTzFCp5TGa7Q0C7HF1Ls8oV1Zlf0pMjClCPM7aHRNEwThcJ U61JZrnYP1KHgF1P2cYQaDEupJ5BZ3LeVcp4yFOLbUwiIDW57YJA4wTcPiZ5yE4zFpVN7F0gEyIqE C6QF2P+wTp1X+MkyXtmhYJbXl+h3B/b7G7zV5A7HvQviNOH/5+9uzCZW6t70grMexgOD5+h7L/bQM Kow/mxdnI0cJFzKY62Ak4nl5M7j1NoJvBeBJbvr6PQZmqoDHDBZRVD0fLghNQIJlBorfnodSJr79/ iveKUTD4HADyjA==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Julien Lepiller Subject: Re: bug#65546: [PATCH] guix: Properly compute progress bar width. References: <20230826063655.2227-1-julien@lepiller.eu> Date: Sat, 09 Sep 2023 15:48:23 +0200 In-Reply-To: <20230826063655.2227-1-julien@lepiller.eu> (Julien Lepiller's message of "Sat, 26 Aug 2023 08:36:55 +0200") Message-ID: <87wmwzwj88.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65546 Cc: 65546@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Julien, Julien Lepiller skribis: > * guix/progress.scm (terminal-width): New procedure. > (progress-reporter/bar): Use it to compute progress bar width. > * guix/git.scm (show-progress): Use it to compute progress bar width. [...] > +(define (terminal-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, su= ch as > +CJK double-width characters." > + (define get-wchar-ffi > + (pointer->procedure int > + (dynamic-func "mbstowcs" (dynamic-link)) > + (list '* '* size_t))) > + (define terminal-width-ffi > + (pointer->procedure int > + (dynamic-func "wcswidth" (dynamic-link)) > + (list '* size_t))) > + (define (get-wchar str) > + (let ((wchar (make-bytevector (* (+ (string-length str) 1) 4)))) > + (get-wchar-ffi (bytevector->pointer wchar) > + (string->pointer str) > + (string-length str)) > + wchar)) > + (terminal-width-ffi > + (bytevector->pointer (get-wchar str)) > + (string-length str))) Neat! However, could you move it to (guix build syscalls), next to =E2=80=98terminal-columns=E2=80=99 (making sure =E2=80=98pointer->procedure= =E2=80=99 is called only once rather than once per call), and with a test or two in =E2=80=98tests/syscalls.scm=E2=80=99? For clarity, perhaps rename it to =E2=80=98terminal-string-width=E2=80=99? TIA! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 09 13:21:11 2023 Received: (at 65546) by debbugs.gnu.org; 9 Sep 2023 17:21:11 +0000 Received: from localhost ([127.0.0.1]:48426 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qf1du-00055h-GZ for submit@debbugs.gnu.org; Sat, 09 Sep 2023 13:21:11 -0400 Received: from lepiller.eu ([89.234.186.109]:38870 helo=localhost) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qf1dn-00054p-Rw for 65546@debbugs.gnu.org; Sat, 09 Sep 2023 13:21:08 -0400 Received: from localhost (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id b9fbc2d9 for <65546@debbugs.gnu.org>; Sat, 9 Sep 2023 17:20:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=dkim; bh=LdVX5+Zv4Rb6amxuYAWgI3Jlg YdOr/3k39cfQLfcH6w=; b=LJcrGwU2VC6XS58O0qsgk1ryi+al8UjYeQoAPvrRG iWC5eRDpNMNn8e9t0JvBOSF/2zomItRZq1kXhG+cWkTpDvzyg3kE7HuLUKAB9YzK 5HkHyjgIiPSjkijfuAQugdP2QZdT8cgYR515h7OQgcr3vgLLIfVAXi2nn1W/CCKT mELSKiK/VE7z/bkGkJpNNCeQaTiYJWJnrP6m0TMSYsba8nkfJLRRWjf4MyFrW9nJ 2zGzpaoP0adiNuZqzDyR89S+2ZC+QfFeTj8nhbVuAjkxej/KG80LBLIP/p7IjrlT bIk/N+taMsFrei1MlJPbFWmpl7OdU6k99UKoodjiTBIhg== Received: by localhost (OpenSMTPD) with ESMTPSA id b600ca53 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <65546@debbugs.gnu.org>; Sat, 9 Sep 2023 17:20:57 +0000 (UTC) From: Julien Lepiller To: 65546@debbugs.gnu.org Subject: [PATCH v2] guix: Properly compute progress bar width. Date: Sat, 9 Sep 2023 19:20:42 +0200 Message-ID: <20230909172047.6254-1-julien@lepiller.eu> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.6 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * 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 [...] Content analysis details: (3.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FSL_HELO_NON_FQDN_1 No description available. 3.6 HELO_LOCALHOST No description available. -0.0 SPF_PASS SPF: sender matches SPF record X-Debbugs-Envelope-To: 65546 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.6 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * 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 [...] Content analysis details: (2.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FSL_HELO_NON_FQDN_1 No description available. 3.6 HELO_LOCALHOST No description available. -0.0 SPF_PASS SPF: sender matches SPF record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * 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. --- guix/build/syscalls.scm | 24 ++++++++++++++++++++++++ guix/git.scm | 4 +++- guix/progress.scm | 5 ++++- tests/syscalls.scm | 6 ++++++ 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index d947b010d3..a1365cc68c 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -192,6 +192,7 @@ (define-module (guix build syscalls) terminal-window-size terminal-columns terminal-rows + terminal-string-width openpty login-tty @@ -2335,6 +2336,29 @@ (define* (terminal-rows #:optional (port (current-output-port))) always a positive integer." (terminal-dimension window-size-rows port (const 25))) +(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." + (define (get-wchar str) + (let ((wchar (make-bytevector (* (+ (string-length str) 1) 4)))) + (get-wchar-ffi (bytevector->pointer wchar) + (string->pointer str) + (string-length str)) + wchar)) + (terminal-string-width-ffi + (bytevector->pointer (get-wchar str)) + (string-length str))) + (define openpty (let ((proc (syscall->procedure int "openpty" '(* * * * *) #:library "libutil"))) diff --git a/guix/git.scm b/guix/git.scm index 1cb87a4560..728b761e62 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -29,6 +29,8 @@ (define-module (guix git) #:use-module (gcrypt hash) #:use-module ((guix build utils) #:select (mkdir-p delete-file-recursively)) + #:use-module ((guix build syscalls) + #:select (terminal-string-width)) #:use-module (guix store) #:use-module (guix utils) #:use-module (guix records) @@ -153,7 +155,7 @@ (define % ;; TODO: Both should be handled & exposed by the PROGRESS-BAR API instead. (define width (max (- (current-terminal-columns) - (string-length label) 7) + (terminal-string-width label) 7) 3)) (define grain diff --git a/guix/progress.scm b/guix/progress.scm index 33cf6f4a1a..e7cf7e168a 100644 --- a/guix/progress.scm +++ b/guix/progress.scm @@ -21,9 +21,12 @@ (define-module (guix progress) #:use-module (guix records) + #:use-module ((guix build syscalls) + #:select (terminal-string-width)) #:use-module (srfi srfi-19) #:use-module (rnrs io ports) #:use-module (rnrs bytevectors) + #:use-module (system foreign) #:use-module (ice-9 format) #:use-module (ice-9 match) #:export ( @@ -307,7 +310,7 @@ (define (draw-bar) (if (string-null? prefix) (display (progress-bar ratio (current-terminal-columns)) port) (let ((width (- (current-terminal-columns) - (string-length prefix) 3))) + (terminal-string-width prefix) 3))) (display prefix port) (display " " port) (display (progress-bar ratio width) port))) diff --git a/tests/syscalls.scm b/tests/syscalls.scm index c9e011f453..eb85b358c4 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm @@ -583,6 +583,12 @@ (define perform-container-tests? (test-assert "terminal-rows" (> (terminal-rows) 0)) +(test-assert "terminal-string-width English" + (= (terminal-string-width "hello") 5)) + +(test-assert "terminal-string-width Japanese" + (= (terminal-string-width "今日は") 6)) + (test-assert "openpty" (let ((head inferior (openpty))) (and (integer? head) (integer? inferior) -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 26 04:42:27 2023 Received: (at 65546) by debbugs.gnu.org; 26 Sep 2023 08:42:27 +0000 Received: from localhost ([127.0.0.1]:47212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ql3eE-0005Fs-VZ for submit@debbugs.gnu.org; Tue, 26 Sep 2023 04:42:27 -0400 Received: from sender3-of-o59.zoho.com ([136.143.184.59]:21978) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ql3eB-0005Fh-DH for 65546@debbugs.gnu.org; Tue, 26 Sep 2023 04:42:25 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1695717727; cv=none; d=zohomail.com; s=zohoarc; b=jvSHUOZAcHpLkWBIwR8mFjuomJ3rSi7rs7Dt5F2kDbh8Ij8zE+AQgb5K7YfI2bsEKZPyKeZY9B7xx63Wqgu3TTTY7rLPicq4VGhki/fIG9IYVfakqGNVZE0BmKydz5SFex61s4n2UlaxPEwgFDSGmUXfCUpQUt9rUJCYTwspG6U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695717727; h=Content-Type:Date:From:MIME-Version:Message-ID:Subject:To; bh=/c+TPfKoJz+zr+A3SV5YG5eUI0YiC+mE/aP3FG5WasM=; b=gNEW4MrImk0Jxl49KOERaA4SooIPnCZZgvpRcHQDZQL5VpIXDkhLxhRrNL5/dIFH6RxHQpGvhZ9hZEJ8ia3yIRaDjxmmPJULrdIvwdFy72DYb3RCTiE5txziV3TrMCQV60ntsPjWS8HhzuJ3UmgjMECMG5HLucw1VxxNfDXTZQE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1695717727; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:From:To:To:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Type:Message-Id:Reply-To:Cc; bh=/c+TPfKoJz+zr+A3SV5YG5eUI0YiC+mE/aP3FG5WasM=; b=OLrrg6xi1EIGBwD7Rw13y20bCMadKDWm6tQEjKcUQzmf3Ii4aqy71JbXhtZ8FAmO Fdk9znHz9TpDqyQsfmS133Jo3sxnC7MyV7kVIt8ceLjYPOvoV/FxgzykclBxYD1apu/ dtDQeS3icNRefqrLY/l/Xagk2ZNQloPBsN7iZ0Ro= Received: from localhost (233-111-142-46.pool.kielnet.net [46.142.111.233]) by mx.zohomail.com with SMTPS id 1695717726302708.7971086979254; Tue, 26 Sep 2023 01:42:06 -0700 (PDT) User-agent: mu4e 1.10.7; emacs 29.0.92 From: Ricardo Wurmus To: 65546@debbugs.gnu.org Subject: [PATCH] guix: Properly compute progress bar width. Date: Tue, 26 Sep 2023 10:40:56 +0200 Message-ID: <87bkdp497o.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain X-ZohoMailClient: External X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65546 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Julien, this v2 of your patch looks good to me. Please push! -- Ricardo From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 27 00:03:38 2023 Received: (at 65546) by debbugs.gnu.org; 27 Sep 2023 04:03:38 +0000 Received: from localhost ([127.0.0.1]:50205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qlLlx-0000RQ-Nr for submit@debbugs.gnu.org; Wed, 27 Sep 2023 00:03:37 -0400 Received: from mx.kolabnow.com ([212.103.80.154]:42640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qlLlv-0000RC-1C for 65546@debbugs.gnu.org; Wed, 27 Sep 2023 00:03:37 -0400 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id 68DFA20B364F for <65546@debbugs.gnu.org>; Wed, 27 Sep 2023 06:03:15 +0200 (CEST) Authentication-Results: ext-mx-out011.mykolab.com (amavis); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-disposition:content-type:content-type:mime-version :message-id:subject:subject:from:from:date:date:received :received:received; s=dkim20160331; t=1695787394; x=1697601795; bh=21RnSCzA1wjk7BxmiRLpZle/1KeEovMddGjl6ydQHf8=; b=OVn+fKB+3Ofo Wn359Xbp21XHB6gC5HdabR3J00HYjwSyV170Y+bv3dTScw6Uywv6FJmRvadXbmxi A2sSzQCZE9/TGT5/fTYHw4NlYdid/iYvF1oKmdP1PIZNw4Jb84EPSMen8F71LuO0 nDHgz9if041iwR0krY6nxx4j6NLHTVFBDsean5uF6oKJrZWdyieQUfBkTSM6vhDi mJ2k8O79aNAZ3F8QeSHa7K/cbQCLKyuOJ3NO2DBRekVZndUF4+Hi5foPZEZTtP90 O8AV7ZeP5uGpP3bYJ3E2Xxn4vavVkPubn4hNr7lYkjXTUea7KYwpKbAn+BEAq8h2 PWT8kmmbTBIkzpSjl26kmRHHNi+OhXLkEagwaZCoE6xxxDHDulIRlRYBPhYQbRW3 8Z71sQarU6PJbfN504IyjTHMYz3a2cXa1bMoB78ENnHtAsJVQYBfJrM+3wYdZIp7 i1kfSt0p1NuMTEY6zGIFotuQ+PwpoNqXy5CQlCdxQkxEIfh3do2vrFb2TTMTghZE GE9X1YqMG41mmcKLLeD4qBJPOQNgZzJZQd9W5JisKWZKlxRsFeoSexdGbGF5G9iA HeOkAQjYr3fM8K4NjlUy4p/sSc22fqpS8uqCgjVzmFEgv2I93JdnTf3mnLChnwyX +YYktOgewQpm27gt35z/9gJDEb0bSGg= X-Virus-Scanned: amavis at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-10 required=5 tests=[ALL_TRUSTED=-1] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out011.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id 2s6ztXTEUy0I for <65546@debbugs.gnu.org>; Wed, 27 Sep 2023 06:03:14 +0200 (CEST) Received: from int-mx009.mykolab.com (unknown [10.9.13.9]) by mx.kolabnow.com (Postfix) with ESMTPS id 74E5320B3644 for <65546@debbugs.gnu.org>; Wed, 27 Sep 2023 06:03:14 +0200 (CEST) Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx009.mykolab.com (Postfix) with ESMTPS id D733C20D2635 for <65546@debbugs.gnu.org>; Wed, 27 Sep 2023 06:03:13 +0200 (CEST) Date: Tue, 26 Sep 2023 21:02:32 -0700 From: chris To: 65546@debbugs.gnu.org Subject: I have this page bookmarked Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65546 Cc: chris@bumblehead.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This page is bookmarked here and when this patch is applied it will be a happy thing :) From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 11 16:05:32 2023 Received: (at 65546) by debbugs.gnu.org; 11 Oct 2023 20:05:32 +0000 Received: from localhost ([127.0.0.1]:40111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqfSW-00049F-Bd for submit@debbugs.gnu.org; Wed, 11 Oct 2023 16:05:32 -0400 Received: from mx.kolabnow.com ([212.103.80.154]:40578) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqfST-00048e-8F for 65546@debbugs.gnu.org; Wed, 11 Oct 2023 16:05:30 -0400 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id CD86F20B365B for <65546@debbugs.gnu.org>; Wed, 11 Oct 2023 22:05:00 +0200 (CEST) Authentication-Results: ext-mx-out011.mykolab.com (amavis); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-disposition:content-type:content-type:mime-version :message-id:subject:subject:from:from:date:date:received :received:received; s=dkim20160331; t=1697054700; x=1698869101; bh=ZinIo9V2PNZV5Nwwd6xoEeTqPCYDgP5dssO6n96lJcQ=; b=dfKqFnK1OTjC Bzz0H0BWiF38SKjIpFTCU5Fr1ZJCDZf8QgjrV9/pyfw6vVpGbekA3py/2d+OyTfg XzwQFHRKgvgl9bgOckT8cJe37HR7Itr7Z75Cr8NBInBhA0hzLKE0GYmMFDMY7XW4 NYq6Hu1jiTtwGtiW9/rE1zNhiBjxq+jOOrd16XPYRQl50w1ZH17gWkDJVbUQaf9p 7ubCOUEVnCqfA9D/jYwnnwCnsfm7wkj4BRr5X0x8wgaZO/nWVAyzlctNfAZkVPr2 Fjye+nnPswb408vwUkXi3pp9Y4qeoxd1xhpGOp/wzvz2JjJM8QXPdL74vbfYxw/J y6iCbAzqSoMtpbcn1ZBxuHRYJ7YbKxiaKzrFLiVLB1I9Ro3/q72+i7C4NkWTJJGn MJTXLqsRNgjgfUwDAQQVV8s6JHXPibY3NnVd1bwbZ3RPMjAkLupLvvslyM/jsGyW +OTG7rQdrDbuCAEX7/L0HGFXEHvsaYsVqjdWRy9M0bobwAumWsgZcNFJ+CctpO8P VUaLmT3o/uO6u4pJ4UxrslBX9WTxZVYPGSWnPbWG83mNTF+xtUc4DZy2P+jUP+9J TqJ7lHjaxaRqaii+G0mZHhhU0xPvxOvt5MBfaeqVVR/4RF2fBSkCQqcobTKlWp6k 8u4lBluHQanwYm2Q/UkPxDDIA4WBams= X-Virus-Scanned: amavis at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-10 required=5 tests=[ALL_TRUSTED=-1] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out011.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id Dpuwn2eGDJHJ for <65546@debbugs.gnu.org>; Wed, 11 Oct 2023 22:05:00 +0200 (CEST) Received: from int-mx009.mykolab.com (unknown [10.9.13.9]) by mx.kolabnow.com (Postfix) with ESMTPS id F371720B3668 for <65546@debbugs.gnu.org>; Wed, 11 Oct 2023 22:04:59 +0200 (CEST) Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx009.mykolab.com (Postfix) with ESMTPS id 6FB7720AB037 for <65546@debbugs.gnu.org>; Wed, 11 Oct 2023 22:04:59 +0200 (CEST) Date: Wed, 11 Oct 2023 13:04:14 -0700 From: chris To: 65546@debbugs.gnu.org Subject: please apply this patch :) Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65546 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) please apply this patch :) From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 11 17:00:59 2023 Received: (at 65546) by debbugs.gnu.org; 11 Oct 2023 21:00:59 +0000 Received: from localhost ([127.0.0.1]:40143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqgKB-0006t4-Be for submit@debbugs.gnu.org; Wed, 11 Oct 2023 17:00:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqgK6-0006sL-Cb for 65546@debbugs.gnu.org; Wed, 11 Oct 2023 17:00:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqgJa-0000bV-Ho; Wed, 11 Oct 2023 17:00:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=8diD0x38rM4xyOAc7a6oy/XSuSMcGd3c2I2Zq6uK1R0=; b=fTjFRYPmmWrg3s9+gVPz VTSzI1WHK4l5Rt00ytO8VAtbvxu8d1/dOpWVveRiVg1tX0A8o+wMET+R7yLPA/UHjwyFj2AXW9ZU6 ORNwelxXfijuHQmAmtITKGSYZJVApmTKGSCyRZunyRPuWZ/975OfhYjfdp+FhFuy6zPBBOmNJFwPE pwm7hychznElTlIFwFIz7nKVBvOq1gWZ7nPTOjyYdX16VDwW68mwHEPnuokd/GppizpHIOxVAAPlv +qwWvInSL6J4moT5Yj/4Bj4aqjPJlw24cZn3SloiuRHi67LorwrD/Hir87KFniuDxnTGIhtQPlqnZ ITOakOXqwt1w2g==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Julien Lepiller Subject: Re: [bug#65546] [PATCH v2] guix: Properly compute progress bar width. In-Reply-To: <20230909172047.6254-1-julien@lepiller.eu> (Julien Lepiller's message of "Sat, 9 Sep 2023 19:20:42 +0200") References: <20230826063655.2227-1-julien@lepiller.eu> <20230909172047.6254-1-julien@lepiller.eu> Date: Wed, 11 Oct 2023 23:00:07 +0200 Message-ID: <8734ygswmg.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65546 Cc: Ricardo Wurmus , 65546@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Julien, Julien Lepiller skribis: > * 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. Others have already said =E2=80=9CLGTM=E2=80=9D, and I concur. I=E2=80=99l= l 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 :-)). > +(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, su= ch as > +CJK double-width characters." I=E2=80=99d suggest following the style of the rest of the file, which is t= o do something like: (define terminal-string-width (let ((mbstowcs (syscall->procedure =E2=80=A6)) (wcswidth (syscall->procedure =E2=80=A6))) (lambda (str) =E2=80=A6))) Ideally the syscalls.scm changes would be in a commit separate from the progress.scm changes. 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: https://issues.guix.gnu.org/66055 https://issues.guix.gnu.org/66054 Time to create a branch? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 13 11:54:25 2023 Received: (at control) by debbugs.gnu.org; 13 Oct 2023 15:54:25 +0000 Received: from localhost ([127.0.0.1]:47225 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrKUb-0007gD-3n for submit@debbugs.gnu.org; Fri, 13 Oct 2023 11:54:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrKUZ-0007ft-Bl for control@debbugs.gnu.org; Fri, 13 Oct 2023 11:54:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrKU5-0006zo-7v for control@debbugs.gnu.org; Fri, 13 Oct 2023 11:53:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:Subject:From:To:Date:in-reply-to: references; bh=k3k06c/w/I9HCYjasFq0b+BbqgQkAqO/rQSbZSfKmbU=; b=mYDAubsKvnov83 UrPzjZId6kE+r/vLybwEPTxm+0vIhA4RMPju8lyvHSInNFrMXwIfidipwjJJ1Ix4TMjs4VjlobG2e bU0BMSed6PXzYgvQYpRWDcCOT87KKWb/BcuW0zoYq1itLMQaNJ0QFwH2cL+Qj7oQr9+axEseILa+P ZJC6d13N4AvPeeE+tn5GvA3H/gpjZQr1hZBZwZ2WliINeVhlM1bdUB82WhJ5Hub0/XFPk7TLgNeY2 4TzaCiQ9uJsPoIFVm4P5Gto0e9zs8sPD/4kZWiDgFt3iuDn3OBx7XCLi54X4X/dkBUEcUnl0nl19t 7zDGyENpkHS9In9R4lLA==; Date: Fri, 13 Oct 2023 17:53:51 +0200 Message-Id: <87sf6eikmo.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #65546 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) block 65546 by 66525 quit From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 28 23:51:45 2023 Received: (at 65546) by debbugs.gnu.org; 29 Oct 2023 03:51:45 +0000 Received: from localhost ([127.0.0.1]:40016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwwq0-0000FP-Tx for submit@debbugs.gnu.org; Sat, 28 Oct 2023 23:51:45 -0400 Received: from mx.kolabnow.com ([212.103.80.154]:51920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwwpv-0000F7-Go for 65546@debbugs.gnu.org; Sat, 28 Oct 2023 23:51:43 -0400 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id E29E120B3645 for <65546@debbugs.gnu.org>; Sun, 29 Oct 2023 04:51:00 +0100 (CET) Authentication-Results: ext-mx-out011.mykolab.com (amavis); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-disposition:content-type:content-type:mime-version :message-id:subject:subject:from:from:date:date:received :received:received; s=dkim20160331; t=1698551460; x=1700365861; bh=HWBZBk/i84BaBuVtNOAX3H7w30zTqE0zUz3MbDClJGw=; b=AQ2GsV37sgDq PjIOo741xYKFoAascHwGpRvPZroIvQjYKZvvW1IatXoKRoz49+BHxOshp2SVKFPB 44vKNiJO60x1Il3VsCW4r1Jvkj/DkODQn7UhfzrEvcbY3ZzxyfvsuYgcYsyuYa6b XFJMNYJb9O2Dx84gcTVFJOlYLtEoVfG4M2Hf+I0aU+ldFb8eGz9Lz4kosygjb/ys 2fqHaCZN4OhoBzf5CgL25Gr5XM7P7cX0CmpPKWt7SLcywt9jFuRSMS/ZTtCh2MSf t4hiMtJTfXTz7iZ2qMLhUmQMFTCQYNxVUqS6a+J5GDwxKugg/5XQpUxBUR0VQ3AD IGOnaKuSUKpTDKg5cYIsslf7d4++ZutcDLjKDo9PLF3DI9vJsjO0pPvs6U2zaSRk UGZ4QWQjzSn0Sb8G9fOXNyETF71N+d7dl2jh2LLLVhuR+5tHlQtia5uC37yiNJO0 Uz/5OphxXQKvwSl/kExK6IhQ7rA+vcQ40/+alJGMAGxB7etgUFc7fHu92RUNpMY9 Vegcb0QyhaK3mhWd/VeM7/JDgxlurunoZSauEly+S7hnaAEnPr7F6eqMCt9EZYfF jsU9x6jx2OP5bXxb5l0M5BVfP3RS+vdosq4qUTxb4LymodFEEMqMo6A0XWB++mnY CdiO7GHOJQ8umVXQYisKyQOyB+LLCmk= X-Virus-Scanned: amavis at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-10 required=5 tests=[ALL_TRUSTED=-1] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out011.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id 6QRSdowCWp6R for <65546@debbugs.gnu.org>; Sun, 29 Oct 2023 04:51:00 +0100 (CET) Received: from int-mx011.mykolab.com (unknown [10.9.13.11]) by mx.kolabnow.com (Postfix) with ESMTPS id D792F20B2772 for <65546@debbugs.gnu.org>; Sun, 29 Oct 2023 04:50:59 +0100 (CET) Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx011.mykolab.com (Postfix) with ESMTPS id 153B2312B22F for <65546@debbugs.gnu.org>; Sun, 29 Oct 2023 04:50:59 +0100 (CET) Date: Sat, 28 Oct 2023 20:50:10 -0700 From: chris To: 65546@debbugs.gnu.org Subject: [PATCH] guix: Properly compute progress bar width. Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65546 Cc: chris@bumblehead.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Please merge this patch :) From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 09 05:56:16 2023 Received: (at 65546) by debbugs.gnu.org; 9 Nov 2023 10:56:17 +0000 Received: from localhost ([127.0.0.1]:46853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r12hs-0004NC-Np for submit@debbugs.gnu.org; Thu, 09 Nov 2023 05:56:16 -0500 Received: from mx.kolabnow.com ([212.103.80.154]:57640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r12hq-0004Mx-4O for 65546@debbugs.gnu.org; Thu, 09 Nov 2023 05:56:15 -0500 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id 7C4FA303DFD2 for <65546@debbugs.gnu.org>; Thu, 9 Nov 2023 11:55:28 +0100 (CET) Authentication-Results: ext-mx-out013.mykolab.com (amavis); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= in-reply-to:content-transfer-encoding:content-disposition :content-type:content-type:mime-version:references:message-id :subject:subject:from:from:date:date:received:received:received; s=dkim20160331; t=1699527327; x=1701341728; bh=KtiaVEySaeTqmQgb 2Wg/PHp+Nw7qFS1ZCglJUG0hY3o=; b=cTvc4SLZHWasZwN3uHYwNFPu7dsc6rJ7 9+1x4FHm3TlRToT593MEAMGKYNL4U0DKY0nHRIChcpV1kx+smb5GXkLc9y/Esz1D 6J1tGQlvuRIcN+8tGBHECJ2QTYrsJQ7L26FZaC14G27Co/fLTOd9Wcpf8i3exPc3 6CxaUPoGOBHDOyoEboJgMlLJ2dU5FONKGP7NEJOuEvDud+uRVazR6ZRwqqoAHrjz iWva2ayvuyhInJOy2CJ++brl4cpCW4uFwB2OxaG1U29mEmc7DzrlLJuF82murzYW hqgAntv/oxsvg4SY4+BOc/bC/2VYQWacNpoK09PMze0QlGzraSlyjBVQ9JMGpLVU txz4J8pz7CJnMjwCPg9HYUNMCPSmoTUwRtwn352tDYE+nc83dLO/aqPVs9rfkzUS c8DDSUgYgbol0hC516csLTjZ8oXHuNdwvB/fLsYgAzZyiYuu5Ems40AWP2S+qEN/ hR+U50JFKxa61uO9BU6Nc8t6Gi6xiOymxv9G+YJSHvCxLVANjPvu2OIGUqHAhzPk Ld65zvo+KIwfJXsN15nbc7gHdsuGjUKhw2K/ksgjjhcgymflrAls92KzoiyGzfBV cVeatsj7dkybYd08qMZnL3kJc8QM7CcWKJ7hWqqFZBlJNEuXbkuVJxIGrfC2GTjc L2eIPWVI9eM= X-Virus-Scanned: amavis at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-10 required=5 tests=[ALL_TRUSTED=-1] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out013.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id iYCzkyJ3xt-J for <65546@debbugs.gnu.org>; Thu, 9 Nov 2023 11:55:27 +0100 (CET) Received: from int-mx011.mykolab.com (unknown [10.9.13.11]) by mx.kolabnow.com (Postfix) with ESMTPS id A07A0302338B for <65546@debbugs.gnu.org>; Thu, 9 Nov 2023 11:55:27 +0100 (CET) Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx011.mykolab.com (Postfix) with ESMTPS id 1EA1B30E7DEF for <65546@debbugs.gnu.org>; Thu, 9 Nov 2023 11:55:27 +0100 (CET) Date: Thu, 9 Nov 2023 02:54:36 -0800 From: chris To: 65546@debbugs.gnu.org Subject: Re: [PATCH] guix: Properly compute progress bar width. Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65546 Cc: chris@bumblehead.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 10月28日 土, chris wrote: > Please merge this patch :) Please apply this patch! :) From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 11 05:11:56 2023 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 To: Ludovic =?UTF-8?B?Q291cnTDqHM=?= Subject: Re: [bug#65546] [PATCH v2] guix: Properly compute progress bar width. 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-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65546-done Cc: Ricardo Wurmus , 65546-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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! From unknown Fri Jun 20 07:09:33 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 09 Dec 2023 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator