[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/09: gnu: python: Make 'sys.version' deterministic.
From: |
Ludovic Courtès |
Subject: |
05/09: gnu: python: Make 'sys.version' deterministic. |
Date: |
Sun, 29 Nov 2015 22:01:56 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 9820a6d4a0fb82cd97f62ada764af658a4a3e71d
Author: Ludovic Courtès <address@hidden>
Date: Sun Nov 15 00:25:55 2015 +0100
gnu: python: Make 'sys.version' deterministic.
* gnu/packages/patches/python-2-deterministic-build-info.patch,
gnu/packages/patches/python-3-deterministic-build-info.patch: New
files.
* gnu/packages/python.scm (python-2, python): Use them.
* gnu-system.am (dist_patch_DATA): Add them.
---
gnu-system.am | 2 ++
.../python-2-deterministic-build-info.patch | 17 +++++++++++++++++
.../python-3-deterministic-build-info.patch | 17 +++++++++++++++++
gnu/packages/python.scm | 2 ++
4 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/gnu-system.am b/gnu-system.am
index c7a17a4..71b9144 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -669,8 +669,10 @@ dist_patch_DATA =
\
gnu/packages/patches/pybugz-encode-error.patch \
gnu/packages/patches/pybugz-stty.patch \
gnu/packages/patches/pyqt-configure.patch \
+ gnu/packages/patches/python-2-deterministic-build-info.patch \
gnu/packages/patches/python-2.7-search-paths.patch \
gnu/packages/patches/python-2.7-source-date-epoch.patch \
+ gnu/packages/patches/python-3-deterministic-build-info.patch \
gnu/packages/patches/python-3-search-paths.patch \
gnu/packages/patches/python-disable-ssl-test.patch \
gnu/packages/patches/python-fix-tests.patch \
diff --git a/gnu/packages/patches/python-2-deterministic-build-info.patch
b/gnu/packages/patches/python-2-deterministic-build-info.patch
new file mode 100644
index 0000000..25a079f
--- /dev/null
+++ b/gnu/packages/patches/python-2-deterministic-build-info.patch
@@ -0,0 +1,17 @@
+Always provide the same date and time in 'Py_GetBuildInfo'.
+This is the information shown at the REPL and in 'sys.version'.
+We cannot pass it in CPPFLAGS due to whitespace in the DATE string.
+
+--- a/Modules/getbuildinfo.c
++++ b/Modules/getbuildinfo.c
+@@ -4,6 +4,10 @@
+ #include <stdio.h>
+ #endif
+
++/* Deterministic date and time. */
++#define DATE "Jan 1 1970"
++#define TIME "00:00:01"
++
+ #ifndef DATE
+ #ifdef __DATE__
+ #define DATE __DATE__
diff --git a/gnu/packages/patches/python-3-deterministic-build-info.patch
b/gnu/packages/patches/python-3-deterministic-build-info.patch
new file mode 100644
index 0000000..22c372a
--- /dev/null
+++ b/gnu/packages/patches/python-3-deterministic-build-info.patch
@@ -0,0 +1,17 @@
+Always provide the same date and time in 'Py_GetBuildInfo'.
+This is the information shown at the REPL and in 'sys.version'.
+We cannot pass it in CPPFLAGS due to whitespace in the DATE string.
+
+--- Modules/getbuildinfo.c
++++ Modules/getbuildinfo.c
+@@ -4,6 +4,10 @@
+ #include <stdio.h>
+ #endif
+
++/* Deterministic date and time. */
++#define DATE "Jan 1 1970"
++#define TIME "00:00:01"
++
+ #ifndef DATE
+ #ifdef __DATE__
+ #define DATE __DATE__
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 7f7fa38..fa8f203 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -94,6 +94,7 @@
"1h7zbrf9pkj29hlm18b10548ch9757f75m64l47sy75rh43p7lqw"))
(patches (map search-patch
'("python-2.7-search-paths.patch"
+ "python-2-deterministic-build-info.patch"
"python-2.7-source-date-epoch.patch")))))
(build-system gnu-build-system)
(arguments
@@ -223,6 +224,7 @@ data types.")
'("python-fix-tests.patch"
;; XXX Try removing this patch for python > 3.4.3
"python-disable-ssl-test.patch"
+ "python-3-deterministic-build-info.patch"
"python-3-search-paths.patch")))
(patch-flags '("-p0"))
(sha256
- branch master updated (2605975 -> 02f0c3b), Ludovic Courtès, 2015/11/29
- 01/09: tk: Hardcode path to TK_LIBRARY., Ludovic Courtès, 2015/11/29
- 04/09: gnu: python: Set SOURCE_DATE_EPOCH to 1 instead of 0., Ludovic Courtès, 2015/11/29
- 02/09: gnu: tcl: Produce 'tclIndex' files deterministically., Ludovic Courtès, 2015/11/29
- 03/09: gnu: python-2: Honor 'SOURCE_DATE_EPOCH'., Ludovic Courtès, 2015/11/29
- 09/09: gnu: python: Move tkinter to "tk" output., Ludovic Courtès, 2015/11/29
- 06/09: gnu: python: Factorize configure flags with minimal variants., Ludovic Courtès, 2015/11/29
- 05/09: gnu: python: Make 'sys.version' deterministic.,
Ludovic Courtès <=
- 07/09: gnu: python: Do not record configure flags., Ludovic Courtès, 2015/11/29
- 08/09: gnu: python: Clarify and shorten the list of built-time modules., Ludovic Courtès, 2015/11/29