From 67ca82e6ddc9f1c87fa8c033729a1f53b7c2b3ba Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 1 Apr 2020 12:58:32 +0200 Subject: 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/packages/python.scm | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 8e28265fbe..e9a20dc418 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -26,7 +26,7 @@ ;;; Copyright © 2016, 2017 ng0 ;;; Copyright © 2016 Dylan Jeffers ;;; Copyright © 2016 David Craven -;;; Copyright © 2016, 2017, 2018, 2019 Marius Bakke +;;; Copyright © 2016, 2017, 2018, 2019, 2020 Marius Bakke ;;; Copyright © 2016, 2017 Stefan Reichör ;;; Copyright © 2016 Dylan Jeffers ;;; Copyright © 2016, 2017 Alex Vong @@ -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 . + ;; 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")) -- cgit v1.2.3