Hi,

Attached is the patch I used for trying to update python 3 to 3.5. I disabled 
a test and added an exception handler for some code calling pwd.getpwuid(0) 
and the group equivalent.

It builds outside of the python.scm module but if I change the version in 
python.scm python-minimal ends up with a link error.

*** WARNING: renaming "_ctypes" since importing it failed: build/lib.linux-
x86_64-3.5/_ctypes.cpython-35m-x86_64-linux-gnu.so: cannot open shared object 
file: No such file or directory
error: [Errno 2] No such file or directory: 'build/lib.linux-
x86_64-3.5/_ctypes.cpython-35m-x86_64-linux-gnu.so' -> 'build/lib.linux-
x86_64-3.5/_ctypes.cpython-35m-x86_64-linux-gnu_failed.so'
Makefile:608: recipe for target 'sharedmods' failed

I'm currently pretty baffled by the link error as if I do --keep-failed I can 
get it to build with:
cd /tmp/nix-builc-python-minimal-3.5.1.drv
chown -R me .
guix environment python-minimal
cd Python-3.5.1
make

Diane
>From 834e5073580c9584b8daf533da6735d9402049b8 Mon Sep 17 00:00:00 2001
From: Diane Trout <di...@ghic.org>
Date: Fri, 26 Feb 2016 16:12:31 -0800
Subject: [PATCH] Update python 3 to 3.5.1. Disabling a test that depended on
 home and adding exception handling for get{pwu,grg}id(0)

---
 gnu/packages/patches/python-fix-tests.patch | 33 +++++++++++++++++++++++++++++
 gnu/packages/python.scm                     |  4 ++--
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/patches/python-fix-tests.patch b/gnu/packages/patches/python-fix-tests.patch
index 82c1998..1762531 100644
--- a/gnu/packages/patches/python-fix-tests.patch
+++ b/gnu/packages/patches/python-fix-tests.patch
@@ -1,6 +1,18 @@
 See the discussion about the issues fixed here at:
 http://bugs.python.org/issue20868 .
 
+--- Lib/test/test_pathlib.py     2014-03-01 03:02:36.088311000 +0100
++++ Lib/test/test_pathlib.py     2014-03-01 04:56:37.768311000 +0100
+@@ -1986,8 +1986,9 @@
+         expect = set() if not support.fs_is_case_insensitive(BASE) else given
+         self.assertEqual(given, expect)
+         self.assertEqual(set(p.rglob("FILEd*")), set())
+ 
++    @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")
+     def test_expanduser(self):
+         P = self.cls
+         support.import_module('pwd')
+         import pwd
 --- Lib/test/test_shutil.py     2014-03-01 03:02:36.088311000 +0100
 +++ Lib/test/test_shutil.py     2014-03-01 04:56:37.768311000 +0100
 @@ -1053,6 +1053,7 @@
@@ -64,6 +76,27 @@ http://bugs.python.org/issue20868 .
      @unittest.skipUnless(support.is_resource_enabled('network'),
                           'network is not enabled')
      def test_idna(self):
+
+--- Lib/test/test_tarfile.py        2016-02-24 19:22:52.597208055 +0000
++++ Lib/test/test_tarfile.py     2016-02-24 20:50:48.941950135 +0000
+@@ -2305,11 +2305,14 @@
+     try:
+         import pwd, grp
+     except ImportError:
+         return False
+-    if pwd.getpwuid(0)[0] != 'root':
+-        return False
+-    if grp.getgrgid(0)[0] != 'root':
++    try:
++        if pwd.getpwuid(0)[0] != 'root':
++            return False
++        if grp.getgrgid(0)[0] != 'root':
++            return False
++    except KeyError:
+         return False
+     return True
+ 
+     
 --- Lib/test/_test_multiprocessing.py	2014-04-06 23:12:27.575235000 +0200
 +++ Lib/test/_test_multiprocessing.py	2014-04-06 23:13:04.827235000 +0200
 @@ -1016,6 +1016,7 @@
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index b67aed0..03cc549 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -260,7 +260,7 @@ data types.")
 
 (define-public python
   (package (inherit python-2)
-    (version "3.4.3")
+    (version "3.5.1")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://www.python.org/ftp/python/";
@@ -274,7 +274,7 @@ data types.")
               (patch-flags '("-p0"))
               (sha256
                (base32
-                "1f4nm4z08sy0kqwisvv95l02crv6dyysdmx44p1mz3bn6csrdcxm"))))
+                "1j95yx32ggqx8jf13h3c8qfp34ixpyg8ipqcdjmn143d6q67rmf6"))))
     (arguments (substitute-keyword-arguments (package-arguments python-2)
                  ((#:tests? _) #t)))
     (native-search-paths
-- 
2.6.3

Reply via email to