[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
46/49: gnu: Python: Fix bytecode compilation.
From: |
guix-commits |
Subject: |
46/49: gnu: Python: Fix bytecode compilation. |
Date: |
Fri, 23 Jul 2021 11:33:14 -0400 (EDT) |
mbakke pushed a commit to branch core-updates
in repository guix.
commit 7c2c69886275895f6030b47c76078abfe62edf82
Author: Marius Bakke <marius@gnu.org>
AuthorDate: Thu Jul 22 00:01:05 2021 +0200
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.
---
gnu/packages/python.scm | 29 ++++++++++++-----------------
1 file changed, 12 insertions(+), 17 deletions(-)
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 0ec7902..0b763af 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -533,23 +533,18 @@ data types.")
;; 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"
- "-f" ; force rebuild
- "--invalidation-mode=unchecked-hash"
- ;; Don't build lib2to3, because it's Python 2
code.
- "-x" "lib2to3/.*"
- ,out))))
- (list "none" "-O" "-OO")))))
+ (apply invoke
+ `(,,(if (%current-target-system)
+ "python3"
+ '(string-append out
+ "/bin/python3"))
+ "-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)))))
(replace 'install-sitecustomize.py
,(customize-site version))))))
(native-inputs
- 19/49: gnu: Perl: Update cross-compilation code., (continued)
- 19/49: gnu: Perl: Update cross-compilation code., guix-commits, 2021/07/23
- 26/49: gnu: acl: Update to 2.3.1., guix-commits, 2021/07/23
- 28/49: gnu: binutils: Update to 2.37., guix-commits, 2021/07/23
- 31/49: gnu: harfbuzz: Update to 2.8.2., guix-commits, 2021/07/23
- 32/49: gnu: pango: Update to 1.48.7., guix-commits, 2021/07/23
- 35/49: gnu: sqlite: Update to 3.36.0., guix-commits, 2021/07/23
- 36/49: gnu: libtiff: Update to 4.3.0., guix-commits, 2021/07/23
- 37/49: gnu: libxml2: Update to 2.9.12., guix-commits, 2021/07/23
- 41/49: gnu: perl-test-needs: Update to 0.002009., guix-commits, 2021/07/23
- 42/49: gnu: graphviz: Turn arguments into a gexp., guix-commits, 2021/07/23
- 46/49: gnu: Python: Fix bytecode compilation.,
guix-commits <=
- 47/49: gnu: Python: Delete existing compiled files before compiling bytecode., guix-commits, 2021/07/23
- 49/49: gnu: Python: Disable indeterministic optimizations., guix-commits, 2021/07/23
- 45/49: gnu: Python: Do not embed timestamps in wheel files., guix-commits, 2021/07/23
- 48/49: gnu: Python: Compile bytecode in all outputs., guix-commits, 2021/07/23
- 40/49: gnu: libcap: Update to 2.51., guix-commits, 2021/07/23
- 43/49: gnu: graphviz: Don't hard code Guile version., guix-commits, 2021/07/23
- 39/49: gnu: libksba: Update to 1.6.0., guix-commits, 2021/07/23
- 44/49: gnu: graphviz: Update to 2.48.0., guix-commits, 2021/07/23