Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 563834 - dev-lang/python: bump to 3.5.0-r1
Summary: dev-lang/python: bump to 3.5.0-r1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-22 23:47 UTC by yegle
Modified: 2015-12-18 10:54 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
python-3.5.1-build.log (build.log.tar.xz,37.86 KB, application/x-xz)
2015-12-14 22:53 UTC, yegle
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yegle 2015-10-22 23:47:32 UTC
I grabbed 3.5.0-r1 from ~x86 portage (is this how we call the *normal* gentoo portage?) and several patch/files needed, then installed on OSX without problem.

Let's bump the version :-)

Reproducible: Always
Comment 1 yegle 2015-12-13 00:17:01 UTC
Now that 3.5.0-r4 is in x86 portage tree, could we get that in prefix portage tree?

Thank you.
Comment 2 Fabian Groffen gentoo-dev 2015-12-14 12:35:14 UTC
I'm working on these patchsets, but unfortunately python doesn't locate ncurses any more, and I haven't yet gotten the time to figure out why.
Comment 3 Fabian Groffen gentoo-dev 2015-12-14 19:28:12 UTC
3.5.1 it will be
Comment 4 Fabian Groffen gentoo-dev 2015-12-14 20:39:59 UTC
committed
Comment 5 yegle 2015-12-14 22:51:35 UTC
It failed on my laptop. Looks like the _struct module is unavailable but I don't see compile error on that module.
Comment 6 yegle 2015-12-14 22:53:55 UTC
Created attachment 419220 [details]
python-3.5.1-build.log
Comment 7 yegle 2015-12-16 06:03:45 UTC
So, the compiled binary on OS X is python.exe, not python. So the following code in ebuild should use python.exe:

    # if not using a cross-compiler, use the fresh binary
    if ! tc-is-cross-compiler; then
        local -x PYTHON=./python.exe
        local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
    else
        vars=( PYTHON "${vars[@]}" )
    fi

After making this change it finished installing.
Comment 8 Fabian Groffen gentoo-dev 2015-12-16 07:40:15 UTC
I already pushed something like that, right?
Comment 9 Fabian Groffen gentoo-dev 2015-12-16 07:41:26 UTC
oh, that was to 2.7.11 only, I see
Comment 10 yegle 2015-12-17 01:42:59 UTC
There's something weird happening. I can see that $EPREFIX/usr/lib/python3.5/lib-dynload is in sys.path and that _struct.cpython-35-darwin.bundle is in that directory, but I cannot import this module (or any other module in that directory).


$ .gentoo/usr/bin/python3
Python 3.5.1 (default, Dec 16 2015, 14:07:22)
[GCC 4.2.1 Compatible Clang 3.7.0 (tags/RELEASE_370/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import _struct
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named '_struct'
>>> import sys
>>> sys.path
['', '/Users/ych/.gentoo/usr/lib/python35.zip', '/Users/ych/.gentoo/usr/lib/python3.5', '/Users/ych/.gentoo/usr/lib/python3.5/plat-darwin', '/Users/ych/.gentoo/usr/lib/python3.5/lib-dynload', '/Users/ych/.gentoo/usr/lib/python3.5/site-packages']
>>> import json
>>> import _json
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named '_json'
>>> import zlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'zlib'
Comment 11 yegle 2015-12-17 01:49:23 UTC
Seems like the python installed from prefix doesn't recognize .cpython-35-darwin.bundle as valid binary module suffix:

$ python3
Python 3.5.1 (default, Dec 16 2015, 14:07:22)
[GCC 4.2.1 Compatible Clang 3.7.0 (tags/RELEASE_370/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import imp
>>> imp.get_suffixes()
[('.cpython-35-darwin.bundle.abi3.bundle', 'rb', 3), ('.bundle', 'rb', 3), ('.py', 'r', 1), ('.pyc', 'rb', 2)]

Renaming the file to _struct.cpython-35-darwin.bundle.abi3.bundle I can import it again.
Comment 12 yegle 2015-12-17 02:22:53 UTC
It looks like 08_all_darwin-bundle.patch is the culprit. Fabian could you update the patch? Thank you!
Comment 13 Fabian Groffen gentoo-dev 2015-12-17 06:46:57 UTC
yeah, but how, .bundle is in there, so I need to understand why it doesn't match it.
Comment 14 yegle 2015-12-18 02:42:35 UTC
Aha, found the reason:

diff -r 2442efacf4a8 -r 82d6f5dacf63 Python/dynload_shlib.c
--- a/Python/dynload_shlib.c    Mon Dec 14 20:33:12 2015 +0100
+++ b/Python/dynload_shlib.c    Mon Dec 14 20:33:13 2015 +0100
@@ -36,9 +36,15 @@ const char *_PyImport_DynLoadFiletab[] =
 #ifdef __CYGWIN__
     ".dll",
 #else  /* !__CYGWIN__ */
+#ifdef __MACH__
+   "." SOABI ".bundle"        <----------------------- missing a comma here.
+    ".abi" PYTHON_ABI_STRING ".bundle",
+    ".bundle",
+#else  /* !__MACH__ */
     "." SOABI ".so",
     ".abi" PYTHON_ABI_STRING ".so",
     ".so",
+#endif  /* __MACH__ */
 #endif  /* __CYGWIN__ */
     NULL,
 };
Comment 15 Fabian Groffen gentoo-dev 2015-12-18 08:37:09 UTC
darn, thanks for this!
Comment 16 Fabian Groffen gentoo-dev 2015-12-18 10:54:02 UTC
I updated the patchset