Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 't/31344/homebrew__docbuild_crashes__libtcl_atforkprepar…
Browse files Browse the repository at this point in the history
…e' into t/31335/homebrew__unused_packages__singular__pari_______in__usr_local_leak_into_sagelib_build
  • Loading branch information
Matthias Koeppe committed Feb 7, 2021
2 parents 9ad84cc + b4ceee5 commit ae4ea55
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/sage_setup/docbuild/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,15 @@ def clean(self, *args):

from .utils import build_many as _build_many

def build_many(target, args):
def build_many(target, args, processes=None):
"""
Thin wrapper around `sage_setup.docbuild.utils.build_many` which uses the
docbuild settings ``NUM_THREADS`` and ``ABORT_ON_ERROR``.
"""
if processes is None:
processes = NUM_THREADS
try:
_build_many(target, args, processes=NUM_THREADS)
_build_many(target, args, processes=processes)
except BaseException as exc:
if ABORT_ON_ERROR:
raise
Expand Down Expand Up @@ -349,7 +351,13 @@ def _wrapper(self, name, *args, **kwds):

# build the other documents in parallel
L = [(doc, name, kwds) + args for doc in others]
build_many(build_other_doc, L)

# Trac #31344: Work around crashes from multiprocessing
if sys.platform == 'darwin':
for target in L:
build_other_doc(target)
else:
build_many(build_other_doc, L)
logger.warning("Elapsed time: %.1f seconds."%(time.time()-start))
logger.warning("Done building the documentation!")

Expand Down

0 comments on commit ae4ea55

Please sign in to comment.