commit: 13b2f0d1edd4f70c3bf776503cdc505ccf04f2d3 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> AuthorDate: Mon Jan 4 12:06:25 2021 +0000 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> CommitDate: Mon Jan 4 12:06:25 2021 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=13b2f0d1
lib/portage: add more definite fix for macOS multiprocessing default force 'fork' method for as long as we get pickle errors whilst using 'spawn' Bug: https://bugs.gentoo.org/758230 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> lib/portage/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/portage/__init__.py b/lib/portage/__init__.py index a5cc8fb08..ec1b50107 100644 --- a/lib/portage/__init__.py +++ b/lib/portage/__init__.py @@ -19,6 +19,8 @@ try: import re import types import platform + # PREFIX LOCAL + import multiprocessing # Temporarily delete these imports, to ensure that only the # wrapped versions are imported by portage internals. @@ -38,6 +40,16 @@ except ImportError as e: sys.stderr.write(" "+str(e)+"\n\n") raise +# BEGIN PREFIX LOCAL +# for bug #758230, on macOS the default was switched from fork to spawn, +# the latter causing issues because all kinds of things can't be +# pickled, so force fork mode for now +try: + multiprocessing.set_start_method('fork') +except RuntimeError: + pass +# END PREFIX LOCAL + try: import portage.proxy.lazyimport
