Fix #6803: Disable parallel build on macOS and py38+

This commit is contained in:
Takeshi KOMIYA 2019-12-01 15:19:25 +09:00
parent 9d3f537cbe
commit 6f529f01ed
4 changed files with 23 additions and 1 deletions

View File

@ -7,6 +7,9 @@ Dependencies
Incompatible changes
--------------------
* #6803: For security reason of python, parallel mode is disabled on macOS and
Python3.8+
Deprecated
----------
@ -19,6 +22,7 @@ Bugs fixed
* #6776: LaTeX: 2019-10-01 LaTeX release breaks :file:`sphinxcyrillic.sty`
* #6815: i18n: French, Hindi, Japanese and Korean translation messages has been
broken
* #6803: parallel build causes AttributeError on macOS and Python3.8
Testing
--------

View File

@ -12,6 +12,7 @@
import os
import pickle
import platform
import sys
import warnings
from collections import deque
@ -199,6 +200,12 @@ class Sphinx:
# say hello to the world
logger.info(bold(__('Running Sphinx v%s') % sphinx.__display_version__))
# notice for parallel build on macOS and py38+
if sys.version_info > (3, 8) and platform.system() == 'Darwin' and parallel > 1:
logger.info(bold(__("For security reason, parallel mode is disabled on macOS and "
"python3.8 and above. For more details, please read "
"https://github.com/sphinx-doc/sphinx/issues/6803")))
# status code for command-line application
self.statuscode = 0

View File

@ -9,6 +9,8 @@
"""
import os
import platform
import sys
import time
import traceback
from math import sqrt
@ -26,7 +28,12 @@ logger = logging.getLogger(__name__)
# our parallel functionality only works for the forking Process
parallel_available = multiprocessing and (os.name == 'posix')
#
# Note: "fork" is not recommended on macOS and py38+.
# see https://bugs.python.org/issue33725
parallel_available = (multiprocessing and
(os.name == 'posix') and
not (sys.version_info > (3, 8) and platform.system() == 'Darwin'))
class SerialTasks:

View File

@ -10,6 +10,8 @@
import codecs
import os
import platform
import sys
import pytest
from docutils import nodes
@ -276,6 +278,8 @@ def test_colored_logs(app, status, warning):
@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows")
@pytest.mark.xfail(platform.system() == 'Darwin' and sys.version_info > (3, 8),
reason="Not working on macOS and py38")
def test_logging_in_ParallelTasks(app, status, warning):
logging.setup(app, status, warning)
logger = logging.getLogger(__name__)