diff options
author | Sam James <sam@gentoo.org> | 2020-12-10 19:38:36 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2020-12-10 19:41:04 +0000 |
commit | 706b09d472b952afaf73e32d29956af68567b272 (patch) | |
tree | 78200e107f2bbe79d931e36a3c513165df79879d /dev-python/cython | |
parent | app-text/liblangtag: Add patch by Anon Emuss for >=gtk-doc-1.32 (diff) | |
download | gentoo-706b09d472b952afaf73e32d29956af68567b272.tar.gz gentoo-706b09d472b952afaf73e32d29956af68567b272.tar.bz2 gentoo-706b09d472b952afaf73e32d29956af68567b272.zip |
dev-python/cython: fix usage on Darwin
macOS now defaults to the 'spawn' multiprocessing
method which Cython isn't written for.
Let's use a single thread if we're in the spawn case.
Package-Manager: Portage-3.0.12-prefix, Repoman-3.0.2
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-python/cython')
-rw-r--r-- | dev-python/cython/cython-0.29.21.ebuild | 1 | ||||
-rw-r--r-- | dev-python/cython/files/cython-0.29.21-spawn-multiprocessing.patch | 29 |
2 files changed, 30 insertions, 0 deletions
diff --git a/dev-python/cython/cython-0.29.21.ebuild b/dev-python/cython/cython-0.29.21.ebuild index e3ada54d8df6..2a1a1e79155c 100644 --- a/dev-python/cython/cython-0.29.21.ebuild +++ b/dev-python/cython/cython-0.29.21.ebuild @@ -31,6 +31,7 @@ BDEPEND="${RDEPEND} PATCHES=( "${FILESDIR}/cython-0.29.14-sphinx-update.patch" + "${FILESDIR}/cython-0.29.21-spawn-multiprocessing.patch" ) SITEFILE=50cython-gentoo.el diff --git a/dev-python/cython/files/cython-0.29.21-spawn-multiprocessing.patch b/dev-python/cython/files/cython-0.29.21-spawn-multiprocessing.patch new file mode 100644 index 000000000000..0aa7212b9a34 --- /dev/null +++ b/dev-python/cython/files/cython-0.29.21-spawn-multiprocessing.patch @@ -0,0 +1,29 @@ +Needed to prevent a loop while calling cythonize on macOS - or any platform +defaulting to the 'spawn' method, as Python 3.8 does on Darwin. + +https://github.com/cython/cython/pull/3263 +From 15ae78bb74a856836dd64828326f4f0812d36520 Mon Sep 17 00:00:00 2001 +From: Marcel Bargull <marcel.bargull@udo.edu> +Date: Fri, 6 Dec 2019 18:21:19 +0100 +Subject: [PATCH] Disable parallel cythonization for "spawn" start method. + +--- + Cython/Build/Dependencies.py | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/Cython/Build/Dependencies.py b/Cython/Build/Dependencies.py +index 593e00a6ef..f9b9c15bc5 100644 +--- a/Cython/Build/Dependencies.py ++++ b/Cython/Build/Dependencies.py +@@ -1073,6 +1073,11 @@ def copy_to_build_dir(filepath, root=os.getcwd()): + + if N <= 1: + nthreads = 0 ++ if nthreads: ++ import multiprocessing ++ if multiprocessing.get_start_method() == 'spawn': ++ print('Disabling parallel cythonization for "spawn" process start method.') ++ nthreads = 0 + if nthreads: + import multiprocessing + pool = multiprocessing.Pool( |