Skip to content

Commit fb0e627

Browse files
committed
Properly handle MAKE='make -j5'
1 parent 41d2591 commit fb0e627

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/sage_docbuild/builders.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
import os
6767
import pickle
6868
import re
69+
import shlex
6970
import shutil
7071
import subprocess
7172
import sys
@@ -266,11 +267,11 @@ def pdf(self):
266267
f.write(ref)
267268

268269
make_cmd = os.environ.get('MAKE', 'make')
269-
command = 'all-pdf'
270-
logger.debug(f"Running {make_cmd} {command} in {tex_dir}")
270+
command = shlex.split(make_cmd) + ['all-pdf']
271+
logger.debug(f"Running {' '.join(command)} in {tex_dir}")
271272

272273
proc = subprocess.run(
273-
[make_cmd, command],
274+
command,
274275
check=False, cwd=tex_dir,
275276
capture_output=True,
276277
text=True,
@@ -279,7 +280,7 @@ def pdf(self):
279280
if proc.returncode != 0:
280281
logger.error(f"stdout from {make_cmd}:\n{proc.stdout}")
281282
logger.error(f"stderr from {make_cmd}:\n{proc.stderr}")
282-
raise RuntimeError(f"failed to run {make_cmd} {command} in {tex_dir}")
283+
raise RuntimeError(f"failed to run {' '.join(command)} in {tex_dir}")
283284

284285
if proc.stdout:
285286
logger.debug(f"make stdout:\n{proc.stdout}")

0 commit comments

Comments
 (0)