[Python-Dev] Re: Hang with parallel make

2020年2月26日 10:25:30 -0800

Admittedly, the whole distutils spawn code should be rewritten to use
subprocess.
Regards
Antoine.
On 2020年2月26日 17:52:53 -0000
"Elad Lahav" <[email protected]> wrote:
> A change to posix_spawnp() fixes the problem for me:
> 
> diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py
> index ceb94945dc..cb69de4242 100644
> --- a/Lib/distutils/spawn.py
> +++ b/Lib/distutils/spawn.py
> @@ -90,7 +90,7 @@ def _spawn_posix(cmd, search_path=1, verbose=0, 
> dry_run=0):
> return
> executable = cmd[0]
> exec_fn = search_path and os.execvp or os.execv
> - env = None
> + env = os.environ
> if sys.platform == 'darwin':
> global _cfg_target, _cfg_target_split
> if _cfg_target is None:
> @@ -112,7 +112,7 @@ def _spawn_posix(cmd, search_path=1, verbose=0, 
> dry_run=0):
> env = dict(os.environ,
> MACOSX_DEPLOYMENT_TARGET=cur_target)
> exec_fn = search_path and os.execvpe or os.execve
> - pid = os.fork()
> + pid = os.posix_spawnp(executable, cmd, env)
> if pid == 0: # in the child
> try:
> if env is None:
> 
> --Elad
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/KU6TJ3LKKAX6C45NQZRVGWZCEC4FQ5J4/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to