gnu: Python: Move arm-alignment.patch to a native-input + phase.
This follows up 67ca82e6dd
which was ineffective
when running 'guix build --system=armhf-linux python' on e.g. x86_64-linux
because the conditional would always return the native system.
* gnu/packages/python.scm (python-3.8)[native-inputs]: Add "arm-alignment.patch".
[arguments]: Add phase to apply it.
[source](patches): Remove it.
* gnu/packages/commencement.scm (python-boot0): Prevent inheriting the phase.
This commit is contained in:
parent
67ca82e6dd
commit
3cff86db8a
2 changed files with 42 additions and 18 deletions
|
@ -3182,7 +3182,17 @@ the bootstrap environment."
|
||||||
;; Python package won't interfere with this one.
|
;; Python package won't interfere with this one.
|
||||||
((#:make-flags _ ''()) ''())
|
((#:make-flags _ ''()) ''())
|
||||||
((#:phases phases)
|
((#:phases phases)
|
||||||
`(modify-phases ,phases
|
;; Remove the 'apply-alignment-patch' phase if present to avoid
|
||||||
|
;; rebuilding this package. TODO: for the next rebuild cycle,
|
||||||
|
;; consider inlining all the arguments instead of inheriting to
|
||||||
|
;; make it easier to patch Python without risking a full rebuild.
|
||||||
|
;; Or better yet, change to 'python-on-guile'.
|
||||||
|
`(modify-phases ,@(list (match phases
|
||||||
|
(('modify-phases original-phases
|
||||||
|
changes ...
|
||||||
|
('add-after unpack apply-alignment-patch _))
|
||||||
|
`(modify-phases ,original-phases ,@changes))
|
||||||
|
(_ phases)))
|
||||||
(add-before 'configure 'disable-modules
|
(add-before 'configure 'disable-modules
|
||||||
(lambda _
|
(lambda _
|
||||||
(substitute* "setup.py"
|
(substitute* "setup.py"
|
||||||
|
|
|
@ -354,22 +354,11 @@ data types.")
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append "https://www.python.org/ftp/python/"
|
(uri (string-append "https://www.python.org/ftp/python/"
|
||||||
version "/Python-" version ".tar.xz"))
|
version "/Python-" version ".tar.xz"))
|
||||||
(patches (append
|
(patches (search-patches
|
||||||
;; 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-fix-tests.patch"
|
||||||
"python-3.8-fix-tests.patch"
|
"python-3.8-fix-tests.patch"
|
||||||
"python-3-deterministic-build-info.patch"
|
"python-3-deterministic-build-info.patch"
|
||||||
"python-3-search-paths.patch")))
|
"python-3-search-paths.patch"))
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"1ps5v323cp5czfshqjmbsqw7nvrdpcbk06f62jbzaqik4gfffii6"))
|
"1ps5v323cp5czfshqjmbsqw7nvrdpcbk06f62jbzaqik4gfffii6"))
|
||||||
|
@ -394,6 +383,7 @@ data types.")
|
||||||
" test_socket")))
|
" test_socket")))
|
||||||
((#:phases phases)
|
((#:phases phases)
|
||||||
`(modify-phases ,phases
|
`(modify-phases ,phases
|
||||||
|
|
||||||
(add-before 'check 'set-TZDIR
|
(add-before 'check 'set-TZDIR
|
||||||
(lambda* (#:key inputs native-inputs #:allow-other-keys)
|
(lambda* (#:key inputs native-inputs #:allow-other-keys)
|
||||||
;; test_email requires the Olson time zone database.
|
;; test_email requires the Olson time zone database.
|
||||||
|
@ -432,9 +422,33 @@ data types.")
|
||||||
,file)))
|
,file)))
|
||||||
(find-files out "\\.py$")))
|
(find-files out "\\.py$")))
|
||||||
(list '() '("-O") '("-OO")))
|
(list '() '("-O") '("-OO")))
|
||||||
#t)))))))
|
#t)))
|
||||||
|
;; XXX: Apply patch on ARM platforms only to avoid a full rebuild.
|
||||||
|
;; Remove this phase in the next rebuild cycle.
|
||||||
|
,@(let ((system (or (%current-target-system)
|
||||||
|
(%current-system))))
|
||||||
|
(if (any (cute string-prefix? <> system)
|
||||||
|
'("arm" "aarch64"))
|
||||||
|
'((add-after 'unpack 'apply-alignment-patch
|
||||||
|
(lambda* (#:key native-inputs inputs #:allow-other-keys)
|
||||||
|
(invoke "patch" "-p1" "--force" "--input"
|
||||||
|
(assoc-ref (or native-inputs inputs)
|
||||||
|
"arm-alignment.patch")))))
|
||||||
|
'()))))))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("tzdata" ,tzdata-for-tests)
|
`(("tzdata" ,tzdata-for-tests)
|
||||||
|
|
||||||
|
;; 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: make this a regular patch in the next rebuild cycle.
|
||||||
|
,@(let ((system (or (%current-target-system)
|
||||||
|
(%current-system))))
|
||||||
|
(if (any (cute string-prefix? <> system)
|
||||||
|
'("arm" "aarch64"))
|
||||||
|
`(("arm-alignment.patch" ,(search-patch "python-3-arm-alignment.patch")))
|
||||||
|
'()))
|
||||||
|
|
||||||
,@(if (%current-target-system)
|
,@(if (%current-target-system)
|
||||||
`(("python3" ,this-package))
|
`(("python3" ,this-package))
|
||||||
'())
|
'())
|
||||||
|
|
Reference in a new issue