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
Now that 3.5.0-r4 is in x86 portage tree, could we get that in prefix portage tree? Thank you.
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.
3.5.1 it will be
committed
It failed on my laptop. Looks like the _struct module is unavailable but I don't see compile error on that module.
Created attachment 419220 [details] python-3.5.1-build.log
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.
I already pushed something like that, right?
oh, that was to 2.7.11 only, I see
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'
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.
It looks like 08_all_darwin-bundle.patch is the culprit. Fabian could you update the patch? Thank you!
yeah, but how, .bundle is in there, so I need to understand why it doesn't match it.
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, };
darn, thanks for this!
I updated the patchset