From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id oKJUIkqAFGRymQAASxT56A (envelope-from ) for ; Fri, 17 Mar 2023 15:59:22 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id cJlCIkqAFGQC7QAAauVa8A (envelope-from ) for ; Fri, 17 Mar 2023 15:59:22 +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 DC2F63796C for ; Fri, 17 Mar 2023 15:59:21 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679065162; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=e6l+kJANFaBk1jSIPm56k/JIe+qkdUVRBGgkaLOc7CI=; b=lmA4KCC4qXnTvcV9XJqL7TQljzjMqwEUelujuU83RrLUQF5j5xjZ+wfkRvKXJucRa+F27s OrQ1OfkuS5z7Y9S/5ux8x2D/fPeYor3ug1p2nqTyWHQgNBCYVMZ87Jd7e6liJQOOMSDBeQ mWm4nd4fsb4jYnTLvmTMy3vbICkkSZUCHMXkzL9dK22XsxAhGwbDoOs9LPQlIzeBdWt6/h I9OQVJSjHaON4Xgv75A3Z1FRvYoFUZTzGOeQNrZbuwRcIS3mZD8ZgisOPf7ByUTsBlF83D v5nEMEQMksTMJvlFInEl7p6IX72fLgUkRPrCTeIBIOC69QM/UUfGbgikBBzvCw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679065162; a=rsa-sha256; cv=none; b=baKSrEEk9xE7AUGEbG/ki0XN5IlhaZJgimSVypXt9JfTZ7/w+0T6el3kaKcjev2a2ej8Su hrsx39hfQ7P31I/ARWOE1BGNRPWFgbqvrmNQYsH+f2at5K8mCLc7HXQ8EXGS8Ny7QUs8QP z9GMGKaF4JgfCIctt4Rj8zNPLngVSeq7fU51m/8IeJ83r6wq6jZnFd05YlGMOF7frZ2NeO /gCvNuIixCcUmIJKqbvqGZAuTojBBz19R6cF84CW5F2dq6C5aEAQG5PC4G9TgPuSYzsQkR 5mlXCQoAsO2AELoRvjWKwmaNILjP2B16U44scWCzEMtjjSdJsdB1KU3fV3yiLQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pdBXs-0005gT-MG; Fri, 17 Mar 2023 10:59:04 -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 1pdBXq-0005gI-MY for guix-patches@gnu.org; Fri, 17 Mar 2023 10:59:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pdBXq-000081-EZ for guix-patches@gnu.org; Fri, 17 Mar 2023 10:59:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pdBXq-0002qf-Av for guix-patches@gnu.org; Fri, 17 Mar 2023 10:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62243] [PATCH] gnu: guile-3.0-latest: Add patch for invalid unicode handling. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 17 Mar 2023 14:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62243 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62243@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167906511710911 (code B ref -1); Fri, 17 Mar 2023 14:59:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 Mar 2023 14:58:37 +0000 Received: from localhost ([127.0.0.1]:45380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdBXQ-0002pv-GP for submit@debbugs.gnu.org; Fri, 17 Mar 2023 10:58:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:42472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdBXO-0002pn-6B for submit@debbugs.gnu.org; Fri, 17 Mar 2023 10:58:34 -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 1pdBXN-0005cV-Tv for guix-patches@gnu.org; Fri, 17 Mar 2023 10:58:33 -0400 Received: from mira.cbaines.net ([2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pdBXL-00005h-U1 for guix-patches@gnu.org; Fri, 17 Mar 2023 10:58:33 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:54d1:d5d4:280e:f699]) by mira.cbaines.net (Postfix) with ESMTPSA id 0367716E8F for ; Fri, 17 Mar 2023 14:58:29 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 8f1f8136 for ; Fri, 17 Mar 2023 14:58:28 +0000 (UTC) From: Christopher Baines Date: Fri, 17 Mar 2023 14:58:28 +0000 Message-Id: <20230317145828.20404-1-mail@cbaines.net> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: X-Migadu-Queue-Id: DC2F63796C X-Spam-Score: -2.75 X-Migadu-Spam-Score: -2.75 X-Migadu-Scanner: scn0.migadu.com 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-Country: US X-Migadu-Flow: FLOW_IN X-TUID: BGXvwejw/Qvy This patch fixes handling of invalid unicode when using suspendable ports. As the build coordinator agents use suspendable ports, this will fix issues with building things where the log output contains invalid unicode. * gnu/packages/patches/guile-fix-invalid-unicode-handling.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/guile.scm (guile-3.0-latest)[source]: Use it. --- gnu/local.mk | 1 + gnu/packages/guile.scm | 4 +- .../guile-fix-invalid-unicode-handling.patch | 80 +++++++++++++++++++ 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/guile-fix-invalid-unicode-handling.patch diff --git a/gnu/local.mk b/gnu/local.mk index 0a1a5d077f..25e24206e8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1294,6 +1294,7 @@ dist_patch_DATA = \ %D%/packages/patches/guile-fibers-epoll-instance-is-dead.patch \ %D%/packages/patches/guile-fibers-fd-finalizer-leak.patch \ %D%/packages/patches/guile-fibers-wait-for-io-readiness.patch \ + %D%/packages/patches/guile-fix-invalid-unicode-handling.patch \ %D%/packages/patches/guile-gdbm-ffi-support-gdbm-1.14.patch \ %D%/packages/patches/guile-git-adjust-for-libgit2-1.2.0.patch \ %D%/packages/patches/guile-present-coding.patch \ diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 2fd9b711ce..b6db506140 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -398,7 +398,9 @@ (define-public guile-3.0-latest version ".tar.xz")) (sha256 (base32 - "03bm1mnfc9kkg2ls942a0js7bxrdzmcffgrgg6anwdmjfan2a9hs")))) + "03bm1mnfc9kkg2ls942a0js7bxrdzmcffgrgg6anwdmjfan2a9hs")) + (patches (search-patches + "guile-fix-invalid-unicode-handling.patch")))) (arguments (substitute-keyword-arguments (package-arguments guile-3.0) ;; Guile 3.0.9 is bit-reproducible when built in parallel, thanks to diff --git a/gnu/packages/patches/guile-fix-invalid-unicode-handling.patch b/gnu/packages/patches/guile-fix-invalid-unicode-handling.patch new file mode 100644 index 0000000000..97b0f19057 --- /dev/null +++ b/gnu/packages/patches/guile-fix-invalid-unicode-handling.patch @@ -0,0 +1,80 @@ +From 31a1c3c4783e8e66b93500737f23f209d8115f77 Mon Sep 17 00:00:00 2001 +From: Christopher Baines +Date: Fri, 17 Mar 2023 12:48:39 +0000 +Subject: [PATCH] Fix some invalid unicode handling issues with suspendable + ports. + +Based on the implementation in ports.c. I don't understand what this +code is really doing, but the suspendable ports implementation differs +from the similar C code for a couple of inequalities. + +* module/ice-9/suspendable-ports.scm (decode-utf8, bad-utf8-len): Flip a +couple of inequalities. +* test-suite/tests/ports.test ("string ports"): Add additional invalid +UTF-8 test case. +--- + module/ice-9/suspendable-ports.scm | 8 ++++---- + test-suite/tests/ports.test | 7 +++++++ + 2 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/module/ice-9/suspendable-ports.scm b/module/ice-9/suspendable-ports.scm +index a823f1d37..9fac1df62 100644 +--- a/module/ice-9/suspendable-ports.scm ++++ b/module/ice-9/suspendable-ports.scm +@@ -419,7 +419,7 @@ + (= (logand u8_2 #xc0) #x80) + (case u8_0 + ((#xe0) (>= u8_1 #xa0)) +- ((#xed) (>= u8_1 #x9f)) ++ ((#xed) (<= u8_1 #x9f)) + (else #t))) + (kt (integer->char + (logior (ash (logand u8_0 #x0f) 12) +@@ -436,7 +436,7 @@ + (= (logand u8_3 #xc0) #x80) + (case u8_0 + ((#xf0) (>= u8_1 #x90)) +- ((#xf4) (>= u8_1 #x8f)) ++ ((#xf4) (<= u8_1 #x8f)) + (else #t))) + (kt (integer->char + (logior (ash (logand u8_0 #x07) 18) +@@ -462,7 +462,7 @@ + ((< buffering 2) 1) + ((not (= (logand (ref 1) #xc0) #x80)) 1) + ((and (eq? first-byte #xe0) (< (ref 1) #xa0)) 1) +- ((and (eq? first-byte #xed) (< (ref 1) #x9f)) 1) ++ ((and (eq? first-byte #xed) (> (ref 1) #x9f)) 1) + ((< buffering 3) 2) + ((not (= (logand (ref 2) #xc0) #x80)) 2) + (else 0))) +@@ -471,7 +471,7 @@ + ((< buffering 2) 1) + ((not (= (logand (ref 1) #xc0) #x80)) 1) + ((and (eq? first-byte #xf0) (< (ref 1) #x90)) 1) +- ((and (eq? first-byte #xf4) (< (ref 1) #x8f)) 1) ++ ((and (eq? first-byte #xf4) (> (ref 1) #x8f)) 1) + ((< buffering 3) 2) + ((not (= (logand (ref 2) #xc0) #x80)) 2) + ((< buffering 4) 3) +diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.test +index 66e10e3dd..1b30e1a68 100644 +--- a/test-suite/tests/ports.test ++++ b/test-suite/tests/ports.test +@@ -1059,6 +1059,13 @@ + eof)) + + (test-decoding-error (#xf0 #x88 #x88 #x88) "UTF-8" ++ (error ;; 2nd byte should be in the 90..BF range ++ error ;; 88: not a valid starting byte ++ error ;; 88: not a valid starting byte ++ error ;; 88: not a valid starting byte ++ eof)) ++ ++ (test-decoding-error (#xf4 #xa4 #xbd #xa4) "UTF-8" + (error ;; 2nd byte should be in the 90..BF range + error ;; 88: not a valid starting byte + error ;; 88: not a valid starting byte +-- +2.39.1 + -- 2.39.1