From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 13 16:13:54 2022 Received: (at submit) by debbugs.gnu.org; 13 Mar 2022 20:13:54 +0000 Received: from localhost ([127.0.0.1]:43339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTUbB-0002yD-Nd for submit@debbugs.gnu.org; Sun, 13 Mar 2022 16:13:54 -0400 Received: from lists.gnu.org ([209.51.188.17]:33352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTUbA-0002y6-Tz for submit@debbugs.gnu.org; Sun, 13 Mar 2022 16:13:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTUbA-0002F9-QH for guix-patches@gnu.org; Sun, 13 Mar 2022 16:13:52 -0400 Received: from mailout3.rbg.tum.de ([131.159.0.8]:41915) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTUb7-0001UP-6y for guix-patches@gnu.org; Sun, 13 Mar 2022 16:13:52 -0400 Received: from mailrelay1.rbg.tum.de (mailrelay1.in.tum.de [131.159.254.14]) by mailout3.rbg.tum.de (Postfix) with ESMTPS id 9F7F81017C8 for ; Sun, 13 Mar 2022 21:08:04 +0100 (CET) Received: by mailrelay1.rbg.tum.de (Postfix, from userid 112) id 9BD6F77; Sun, 13 Mar 2022 21:08:04 +0100 (CET) Received: from mailrelay1.rbg.tum.de (localhost [127.0.0.1]) by mailrelay1.rbg.tum.de (Postfix) with ESMTP id 25B3C76 for ; Sun, 13 Mar 2022 21:08:04 +0100 (CET) Received: from mail.net.in.tum.de (mail.net.in.tum.de [IPv6:2001:4ca0:2001:14:216:3eff:fe52:ed14]) by mailrelay1.rbg.tum.de (Postfix) with ESMTP id 2418875 for ; Sun, 13 Mar 2022 21:08:04 +0100 (CET) Received: from amnesix.net.in.tum.de (amnesix.net.in.tum.de [IPv6:2001:4ca0:2001:11:e2d5:5eff:fea9:55ca]) by mail.net.in.tum.de (Postfix) with ESMTP id 02714282104F; Sun, 13 Mar 2022 21:08:03 +0100 (CET) From: itd To: guix-patches@gnu.org Subject: [PATCH] gnu: python-mypy: Fix test errors on i686-linux. Date: Sun, 13 Mar 2022 21:08:03 +0100 Message-ID: <87r1757h0c.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=131.159.0.8; envelope-from=itd@net.in.tum.de; helo=mailout3.rbg.tum.de X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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: -2.3 (--) >From a8de61a3f6ca50bf4a68222532029e8e9e84c510 Mon Sep 17 00:00:00 2001 * gnu/packages/patches/python-mypy-12332.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/python-check.scm (python-mypy)[source]: Use patch "python-mypy-12332.patch" to avoid overflow issues resulting in test failures. --- Hi, currently, python-mypy on i686-linux does not build [0] due to test errors [1]. To my knowledge, the merged fix [2] is not part of a release yet. But, it [2] fixes the python-mypy build for me. Please consider applying it. Thanks! [0]: https://ci.guix.gnu.org/build/484670/details [1]: https://github.com/python/mypy/issues/11148 [2]: https://github.com/python/mypy/pull/12332 Regards itd gnu/local.mk | 1 + gnu/packages/patches/python-mypy-12332.patch | 68 ++++++++++++++++++++ gnu/packages/python-check.scm | 4 +- 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/python-mypy-12332.patch diff --git a/gnu/local.mk b/gnu/local.mk index 484757b207..05d01c858f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1716,6 +1716,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-versioneer-guix-support.patch \ %D%/packages/patches/python-waitress-fix-tests.patch \ %D%/packages/patches/python-werkzeug-tests.patch \ + %D%/packages/patches/python-mypy-12332.patch \ %D%/packages/patches/qemu-build-info-manual.patch \ %D%/packages/patches/qemu-glibc-2.27.patch \ %D%/packages/patches/qemu-glibc-2.30.patch \ diff --git a/gnu/packages/patches/python-mypy-12332.patch b/gnu/packages/patches/python-mypy-12332.patch new file mode 100644 index 0000000000..d43cf42ed1 --- /dev/null +++ b/gnu/packages/patches/python-mypy-12332.patch @@ -0,0 +1,68 @@ +From 518c864805dd93e62d59439e665a0ce9d6778419 Mon Sep 17 00:00:00 2001 +From: Ekin Dursun +Date: Thu, 10 Mar 2022 22:06:48 +0300 +Subject: [PATCH] mypyc: Fix overflow in id function (CPyTagged_Id) + +In CPython, the id of an object is its address. It's computed by +converting the pointer to an unsigned integer (PyLong_FromVoidPtr). A +similar logic is present here, pointer is converted to a Py_ssize_t and +CPyTagged_FromSsize_t is called with that integer. + +There is a problem with that approach: Py_ssize_t cannot hold every +pointer value. Sometimes overflow happens and CPyTagged_FromSsize_t is +called with a negative integer. + +With the new approach, the number is checked: If it fits in a +Py_ssize_t, CPyTagged_FromSsize_t is called. If not, it is directly +converted to a PyObject using PyLong_FromVoidPtr. +--- + mypyc/lib-rt/CPy.h | 1 + + mypyc/lib-rt/int_ops.c | 9 +++++++++ + mypyc/lib-rt/misc_ops.c | 2 +- + 3 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/mypyc/lib-rt/CPy.h b/mypyc/lib-rt/CPy.h +index 987819154ab..9f5ae52d4e4 100644 +--- a/mypyc/lib-rt/CPy.h ++++ b/mypyc/lib-rt/CPy.h +@@ -121,6 +121,7 @@ static inline size_t CPy_FindAttrOffset(PyTypeObject *trait, CPyVTableItem *vtab + + + CPyTagged CPyTagged_FromSsize_t(Py_ssize_t value); ++CPyTagged CPyTagged_FromVoidPtr(void *ptr); + CPyTagged CPyTagged_FromObject(PyObject *object); + CPyTagged CPyTagged_StealFromObject(PyObject *object); + CPyTagged CPyTagged_BorrowFromObject(PyObject *object); +diff --git a/mypyc/lib-rt/int_ops.c b/mypyc/lib-rt/int_ops.c +index 1275f2c1057..edf06314161 100644 +--- a/mypyc/lib-rt/int_ops.c ++++ b/mypyc/lib-rt/int_ops.c +@@ -26,6 +26,15 @@ CPyTagged CPyTagged_FromSsize_t(Py_ssize_t value) { + } + } + ++CPyTagged CPyTagged_FromVoidPtr(void *ptr) { ++ if ((uintptr_t)ptr > PY_SSIZE_T_MAX) { ++ PyObject *object = PyLong_FromVoidPtr(ptr); ++ return ((CPyTagged)object) | CPY_INT_TAG; ++ } else { ++ return CPyTagged_FromSsize_t((Py_ssize_t)ptr); ++ } ++} ++ + CPyTagged CPyTagged_FromObject(PyObject *object) { + int overflow; + // The overflow check knows about CPyTagged's width +diff --git a/mypyc/lib-rt/misc_ops.c b/mypyc/lib-rt/misc_ops.c +index cebd1cf997f..dcce89d9072 100644 +--- a/mypyc/lib-rt/misc_ops.c ++++ b/mypyc/lib-rt/misc_ops.c +@@ -437,7 +437,7 @@ CPyPickle_GetState(PyObject *obj) + } + + CPyTagged CPyTagged_Id(PyObject *o) { +- return CPyTagged_FromSsize_t((Py_ssize_t)o); ++ return CPyTagged_FromVoidPtr(o); + } + + #define MAX_INT_CHARS 22 diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 05a378601f..5bbe544113 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -1658,7 +1658,9 @@ supported by the MyPy typechecker.") (file-name (git-file-name name version)) (sha256 (base32 - "1v83flrdxh8grcp40qw04q4hzjflih9xwib64078vsxv2w36f817")))) + "1v83flrdxh8grcp40qw04q4hzjflih9xwib64078vsxv2w36f817")) + (patches + (search-patches "python-mypy-12332.patch")))) (build-system python-build-system) (arguments `(#:phases -- 2.30.2 From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 19 18:21:26 2022 Received: (at 54376-done) by debbugs.gnu.org; 19 Mar 2022 22:21:26 +0000 Received: from localhost ([127.0.0.1]:60733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVhRu-0006UE-E5 for submit@debbugs.gnu.org; Sat, 19 Mar 2022 18:21:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVhRs-0006Tu-IZ for 54376-done@debbugs.gnu.org; Sat, 19 Mar 2022 18:21:24 -0400 Received: from [2001:470:142:3::e] (port=40270 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVhRl-0005pD-Se; Sat, 19 Mar 2022 18:21:17 -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=5b43mVJUu6AzYT96sZXVoSLHUDA2HR0sxg2DIeG24gg=; b=eK0KZUtebLldCVHdruuY ed9vKuV+DvCjRenEXxmQPkfDQh+La0S0uzYhUAJrKi4uwiCy20HW5ZB53ckpLVsvKbrMafvdAfMmM 3IG5mbjv1Au5k69kG2Rfbx3j4H85hSej7Rcq2efb/YJi5ZveKpD6pznzeRm2mY2Egs2x+EhTs3tBp 1hUM+kdf6waTZY/JXboXRck5kSaChNVyR/bx4bXNNfNjKS1c1oS1QQClGkhRt7oY+1NRTAtS0IdKl oyEJfAWU7TSblYJLXtskOk9i612Y7AN2o2XOMuxQnRaEBntotrdUdGfWzLYMTpjoWNzl1FeEh117m His2mW+K/zguFg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:58103 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVhRl-0006y2-Fi; Sat, 19 Mar 2022 18:21:17 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: itd Subject: Re: bug#54376: [PATCH] gnu: python-mypy: Fix test errors on i686-linux. References: <87r1757h0c.fsf@localhost> Date: Sat, 19 Mar 2022 23:21:14 +0100 In-Reply-To: <87r1757h0c.fsf@localhost> (itd@net.in.tum.de's message of "Sun, 13 Mar 2022 21:08:03 +0100") Message-ID: <877d8pmvmt.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.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: 54376-done Cc: 54376-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: -3.3 (---) Hi, itd skribis: >>>From a8de61a3f6ca50bf4a68222532029e8e9e84c510 Mon Sep 17 00:00:00 2001 > > * gnu/packages/patches/python-mypy-12332.patch: New patch. > * gnu/local.mk (dist_patch_DATA): Add it. > * gnu/packages/python-check.scm (python-mypy)[source]: Use patch > "python-mypy-12332.patch" to avoid overflow issues resulting in test fail= ures. > --- > Hi, > > currently, python-mypy on i686-linux does not build [0] due to test > errors [1]. To my knowledge, the merged fix [2] is not part of a > release yet. But, it [2] fixes the python-mypy build for me. Please > consider applying it. Thanks! Perfect, applied! Thanks, Ludo=E2=80=99. From unknown Sat Jun 21 05:12:09 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 17 Apr 2022 11:24:06 +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