Skip to content

Commit 110a856

Browse files
authored
Override get_num_cores when in EMCC_DEBUG mode (#13331)
This means that its not just the mutliprocessing pool that we limit to single core but also any places we do things like "make -j" in ports to testing.
1 parent c92f413 commit 110a856

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/building.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ def clear():
161161

162162

163163
def get_num_cores():
164+
if DEBUG:
165+
# When in EMCC_DEBUG mode, only use a single core to avoid interleaving
166+
# logging output and keeps things more deterministic.
167+
return 1
164168
return int(os.environ.get('EMCC_CORES', multiprocessing.cpu_count()))
165169

166170

@@ -172,10 +176,6 @@ def get_multiprocessing_pool():
172176
global multiprocessing_pool
173177
if not multiprocessing_pool:
174178
cores = get_num_cores()
175-
if DEBUG:
176-
# When in EMCC_DEBUG mode, only use a single core in the pool, so that
177-
# logging is not all jumbled up.
178-
cores = 1
179179

180180
# If running with one core only, create a mock instance of a pool that does not
181181
# actually spawn any new subprocesses. Very useful for internal debugging.

0 commit comments

Comments
 (0)