guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch core-updates updated: gnu: Python: Fix test failure on ARMv7.


From: guix-commits
Subject: branch core-updates updated: gnu: Python: Fix test failure on ARMv7.
Date: Wed, 01 Apr 2020 07:01:00 -0400

This is an automated email from the git hooks/post-receive script.

mbakke pushed a commit to branch core-updates
in repository guix.

The following commit(s) were added to refs/heads/core-updates by this push:
     new 67ca82e  gnu: Python: Fix test failure on ARMv7.
67ca82e is described below

commit 67ca82e6ddc9f1c87fa8c033729a1f53b7c2b3ba
Author: Marius Bakke <address@hidden>
AuthorDate: Wed Apr 1 12:58:32 2020 +0200

    gnu: Python: Fix test failure on ARMv7.
    
    * gnu/packages/patches/python-3-arm-alignment.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Adjust accordingly.
    * gnu/packages/python.scm (python-3.8)[source](patches): Add it when the
    current system is ARM.
---
 gnu/local.mk                                      |  1 +
 gnu/packages/patches/python-3-arm-alignment.patch | 21 ++++++++++++++++++
 gnu/packages/python.scm                           | 27 +++++++++++++++++------
 3 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 208e255..1599b09 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1344,6 +1344,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/python-2.7-search-paths.patch           \
   %D%/packages/patches/python-2.7-site-prefixes.patch          \
   %D%/packages/patches/python-2.7-source-date-epoch.patch      \
+  %D%/packages/patches/python-3-arm-alignment.patch            \
   %D%/packages/patches/python-3-deterministic-build-info.patch \
   %D%/packages/patches/python-3-search-paths.patch             \
   %D%/packages/patches/python-3-fix-tests.patch                        \
diff --git a/gnu/packages/patches/python-3-arm-alignment.patch 
b/gnu/packages/patches/python-3-arm-alignment.patch
new file mode 100644
index 0000000..065c1a7
--- /dev/null
+++ b/gnu/packages/patches/python-3-arm-alignment.patch
@@ -0,0 +1,21 @@
+Ensure memory accesses in the sha3 module are aligned on ARM as it causes
+problems when running 32-bit code on a 64-bit kernel.
+
+Patch taken from upstream bug report:
+https://bugs.python.org/issue36515
+
+--- a/Modules/_sha3/sha3module.c
++++ b/Modules/_sha3/sha3module.c
+@@ -64,6 +64,12 @@
+ #define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
+ #endif
+ 
++/* Bus error on 32-bit ARM due to un-aligned memory accesses; 64-bit ARM
++ * doesn't complain but un-aligned memory accesses are sub-optimal */
++#if defined(__arm__) || defined(__aarch64__)
++#define NO_MISALIGNED_ACCESSES
++#endif
++
+ /* mangle names */
+ #define KeccakF1600_FastLoop_Absorb _PySHA3_KeccakF1600_FastLoop_Absorb
+ #define Keccak_HashFinal _PySHA3_Keccak_HashFinal
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 8e28265..e9a20dc 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -26,7 +26,7 @@
 ;;; Copyright © 2016, 2017 ng0 <address@hidden>
 ;;; Copyright © 2016 Dylan Jeffers <sapientech@address@hidden>
 ;;; Copyright © 2016 David Craven <address@hidden>
-;;; Copyright © 2016, 2017, 2018, 2019 Marius Bakke <address@hidden>
+;;; Copyright © 2016, 2017, 2018, 2019, 2020 Marius Bakke <address@hidden>
 ;;; Copyright © 2016, 2017 Stefan Reichör <address@hidden>
 ;;; Copyright © 2016 Dylan Jeffers <sapientech@address@hidden>
 ;;; Copyright © 2016, 2017 Alex Vong <address@hidden>
@@ -92,7 +92,9 @@
   #:use-module (guix download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
-  #:use-module (guix build-system trivial))
+  #:use-module (guix build-system trivial)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26))
 
 (define-public python-2.7
   (package
@@ -352,11 +354,22 @@ data types.")
               (method url-fetch)
               (uri (string-append "https://www.python.org/ftp/python/";
                                   version "/Python-" version ".tar.xz"))
-              (patches (search-patches
-                        "python-3-fix-tests.patch"
-                        "python-3.8-fix-tests.patch"
-                        "python-3-deterministic-build-info.patch"
-                        "python-3-search-paths.patch"))
+              (patches (append
+                        ;; Disable unaligned accesses in the sha3 module on 
ARM as
+                        ;; it causes a test failure when building 32-bit 
Python on a
+                        ;; 64-bit kernel.  See 
<https://bugs.python.org/issue36515>.
+                        ;; TODO: Remove the conditional on the next rebuild 
cycle.
+                        (let ((system (or (%current-target-system)
+                                          (%current-system))))
+                          (if (any (cute string-prefix? <> system)
+                                   '("arm" "aarch64"))
+                              (list (search-patch 
"python-3-arm-alignment.patch"))
+                              '()))
+                        (search-patches
+                         "python-3-fix-tests.patch"
+                         "python-3.8-fix-tests.patch"
+                         "python-3-deterministic-build-info.patch"
+                         "python-3-search-paths.patch")))
               (sha256
                (base32
                 "1ps5v323cp5czfshqjmbsqw7nvrdpcbk06f62jbzaqik4gfffii6"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]