mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-20 05:37:34 -05:00
gnu: Python: Fix bytecode compilation.
* gnu/packages/python.scm (python-3.9)[arguments]: In the rebuild-bytecode phase, actully run Python instead of defining an anonymous procedure. While at it, create all optimization levels with the same command instead of running once for each level.
This commit is contained in:
parent
ea562aba69
commit
7c2c698862
1 changed files with 12 additions and 17 deletions
|
@ -533,23 +533,18 @@ (define-public python-3.9
|
|||
;; Disable hash randomization to ensure the generated .pycs
|
||||
;; are reproducible.
|
||||
(setenv "PYTHONHASHSEED" "0")
|
||||
(for-each
|
||||
(lambda (opt)
|
||||
(format #t "Compiling with optimization level: ~a\n" opt)
|
||||
(lambda (file)
|
||||
(apply invoke
|
||||
`(,,(if (%current-target-system)
|
||||
"python3"
|
||||
'(string-append out
|
||||
"/bin/python3"))
|
||||
,opt
|
||||
"-m" "compileall"
|
||||
"-o" "0" "-o" "1" "-o" "2"
|
||||
"-f" ; force rebuild
|
||||
"--invalidation-mode=unchecked-hash"
|
||||
;; Don't build lib2to3, because it's Python 2 code.
|
||||
"-x" "lib2to3/.*"
|
||||
,out))))
|
||||
(list "none" "-O" "-OO")))))
|
||||
,out)))))
|
||||
(replace 'install-sitecustomize.py
|
||||
,(customize-site version))))))
|
||||
(native-inputs
|
||||
|
|
Loading…
Reference in a new issue