[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
215/216: REMOVEME gnu: python2, pytchon2-minimal: Avoid world rebuild.
From: |
guix-commits |
Subject: |
215/216: REMOVEME gnu: python2, pytchon2-minimal: Avoid world rebuild. |
Date: |
Sat, 4 Jan 2025 07:27:46 -0500 (EST) |
janneke pushed a commit to branch core-packages-team
in repository guix.
commit b0baafcf56a58cfa52c35f3605a3a5011d59aba7
Author: Janneke Nieuwenhuizen <janneke@gnu.org>
AuthorDate: Wed Jan 1 16:14:22 2025 +0100
REMOVEME gnu: python2, pytchon2-minimal: Avoid world rebuild.
* gnu/packages/python.scm (python-2.7): Move CFLAGS to original position.
(%original-python2-configure-flags): New variable.
(python-3.10)[arguments]: Use it.
(python2-minimal)[arguments]: Likewise.
Change-Id: Ia616ec7fb3f5bdbbc478e89fcb5e319d962029ba
---
gnu/packages/python.scm | 70 ++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 60 insertions(+), 10 deletions(-)
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index ffcb785ca6..2cc1b98bc2 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -183,14 +183,7 @@
(list
#:test-target "test"
#:configure-flags
- #~(list ;; -fno-semantic-interposition reinstates some optimizations by
gcc
- ;; leading to around 15% speedup. This is the default starting
from
- ;; python 3.10.
- ;; XXX FIXME: How to add
"-Wno-error=implicit-function-declaration"
- ;; *only* for *this* python-2 package? It's not needed for any
- ;; package inheriting from us.
- "CFLAGS=-Wno-error=incompatible-pointer-types
-fno-semantic-interposition"
- "--enable-shared" ;allow embedding
+ #~(list "--enable-shared" ;allow embedding
"--with-system-expat" ;for XML support
"--with-system-ffi" ;build ctypes
"--with-ensurepip=install" ;install pip and setuptools
@@ -214,6 +207,13 @@
"ac_cv_file__dev_ptmx=no"
"ac_cv_file__dev_ptc=no")
#~())
+ ;; -fno-semantic-interposition reinstates some optimizations by
gcc
+ ;; leading to around 15% speedup. This is the default starting
from
+ ;; python 3.10.
+ ;; XXX FIXME: How to add
"-Wno-error=implicit-function-declaration"
+ ;; *only* for *this* python-2 package? It's not needed for any
+ ;; package inheriting from us.
+ "CFLAGS=-Wno-error=incompatible-pointer-types
-fno-semantic-interposition"
(string-append "LDFLAGS=-Wl,-rpath="
(assoc-ref %outputs "out") "/lib"
" -fno-semantic-interposition")
@@ -454,6 +454,52 @@ data types.")
;; Current 2.x version.
(define-public python-2 python-2.7)
+(define %original-python2-configure-flags
+ #~(list "--enable-shared" ;allow embedding
+ "--with-system-expat" ;for XML support
+ "--with-system-ffi" ;build ctypes
+ "--with-ensurepip=install" ;install pip and setuptools
+ "--with-computed-gotos" ;main interpreter loop optimization
+ "--enable-unicode=ucs4"
+
+ ;; FIXME: These flags makes Python significantly faster, but
+ ;; leads to non-reproducible binaries.
+ ;; "--with-lto" ;increase size by 20MB, but 15% speedup
+ ;; "--enable-optimizations"
+
+ ;; Prevent the installed _sysconfigdata.py from retaining a reference
+ ;; to coreutils.
+ "INSTALL=install -c"
+ "MKDIR_P=mkdir -p"
+
+ ;; Disable runtime check failing if cross-compiling, see:
+ ;;
https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html
+ #$@(if (%current-target-system)
+ #~("ac_cv_buggy_getaddrinfo=no"
+ "ac_cv_file__dev_ptmx=no"
+ "ac_cv_file__dev_ptc=no")
+ #~())
+ ;; -fno-semantic-interposition reinstates some optimizations by gcc
+ ;; leading to around 15% speedup. This is the default starting from
+ ;; python 3.10.
+ "CFLAGS=-fno-semantic-interposition"
+ (string-append "LDFLAGS=-Wl,-rpath="
+ (assoc-ref %outputs "out") "/lib"
+ " -fno-semantic-interposition")
+ ;; Add a reference to libxcrypt in LIBS so that the sysconfigdata
+ ;; file records it and propagates it to programs linking against
+ ;; Python.
+ (let ((libxcrypt
+ (false-if-exception
+ (dirname
+ (search-input-file %build-inputs
+ "lib/libcrypt.so.1")))))
+ (string-append
+ "LIBS="
+ (if libxcrypt
+ (string-append "-L" libxcrypt)
+ "")))))
+
(define-public python-3.10
(package
(inherit python-2)
@@ -487,7 +533,7 @@ data types.")
(arguments
(substitute-keyword-arguments (package-arguments python-2)
((#:configure-flags flags)
- #~(append #$flags
+ #~(append #$%original-python2-configure-flags
;; XXX Use quote to avoid world rebuild at this time
'("--without-static-libpython")))
((#:make-flags _)
@@ -1081,7 +1127,11 @@ data types.")
;; is invoked upon 'make install'. 'pip' also expects 'ctypes' and thus
;; libffi. Expat is needed for XML support which is expected by a lot
;; of libraries out there.
- (inputs (list expat libffi zlib))))
+ (inputs (list expat libffi zlib))
+ (arguments
+ (substitute-keyword-arguments (package-arguments python-2)
+ ((#:configure-flags flags '())
+ %original-python2-configure-flags)))))
(define-public python-minimal
(package/inherit python
- 188/216: gnu: aria2: Fix build., (continued)
- 188/216: gnu: aria2: Fix build., guix-commits, 2025/01/04
- 190/216: gnu: libedit: Fix build with gcc-14., guix-commits, 2025/01/04
- 193/216: gnu: gnome-font-viewer: Fix build with gcc-14., guix-commits, 2025/01/04
- 195/216: gnu: Add gettext-minimal-0.21., guix-commits, 2025/01/04
- 200/216: gnu: python-pydantic: Fix build., guix-commits, 2025/01/04
- 181/216: Revert "gnu: perl-tk: Fix build with gcc-14.", guix-commits, 2025/01/04
- 199/216: gnu: python-bokeh: Fix build., guix-commits, 2025/01/04
- 202/216: gnu: python-traittypes: Fix tests., guix-commits, 2025/01/04
- 209/216: DRAFT gnu: gcc: Update gcc, gcc-toolchain, libgccjit to 14., guix-commits, 2025/01/04
- 213/216: gnu: clang-runtime-17: Build with gcc-13., guix-commits, 2025/01/04
- 215/216: REMOVEME gnu: python2, pytchon2-minimal: Avoid world rebuild.,
guix-commits <=
- 109/216: gnu: json-c: Update to 0.18; fixes build with gcc-14., guix-commits, 2025/01/04
- 134/216: gnu: lpsolve: Fix build with gcc-14., guix-commits, 2025/01/04
- 137/216: gnu: firebird: Update to 3.0.12; fixes build with gcc-14., guix-commits, 2025/01/04
- 143/216: gnu: libunwind: Fix build with gcc-14., guix-commits, 2025/01/04
- 147/216: gnu: chmlib: Fix build with gcc-14., guix-commits, 2025/01/04
- 160/216: gnu: python-pypairix: Update to 0.3.8 and fix buildi with gcc-14., guix-commits, 2025/01/04
- 164/216: gnu: portmidi: Fix build with gcc-14., guix-commits, 2025/01/04
- 176/216: gnu: python-pyicu: Update to 2.14; fixes build., guix-commits, 2025/01/04
- 201/216: gnu: beancount: Fix build., guix-commits, 2025/01/04
- 204/216: gnu: Add python-tiny-proxy., guix-commits, 2025/01/04