@@ -348,7 +348,7 @@ def js_optimizer(filename, passes):
348348def acorn_optimizer (filename , passes , extra_info = None , return_output = False , worker_js = False ):
349349 optimizer = path_from_root ('tools/acorn-optimizer.mjs' )
350350 original_filename = filename
351- if extra_info is not None :
351+ if extra_info is not None and not shared . SKIP_SUBPROCS :
352352 temp_files = shared .get_temp_files ()
353353 temp = temp_files .get ('.js' , prefix = 'emcc_acorn_info_' ).name
354354 shutil .copyfile (filename , temp )
@@ -366,6 +366,9 @@ def acorn_optimizer(filename, passes, extra_info=None, return_output=False, work
366366 if settings .VERBOSE :
367367 cmd += ['--verbose' ]
368368 if return_output :
369+ shared .print_compiler_stage (cmd )
370+ if shared .SKIP_SUBPROCS :
371+ return ''
369372 return check_call (cmd , stdout = PIPE ).stdout
370373
371374 acorn_optimizer .counter += 1
@@ -375,6 +378,9 @@ def acorn_optimizer(filename, passes, extra_info=None, return_output=False, work
375378 output_file = basename + '.jso%d.js' % acorn_optimizer .counter
376379 shared .get_temp_files ().note (output_file )
377380 cmd += ['-o' , output_file ]
381+ shared .print_compiler_stage (cmd )
382+ if shared .SKIP_SUBPROCS :
383+ return output_file
378384 check_call (cmd )
379385 save_intermediate (output_file , '%s.js' % passes [0 ])
380386 return output_file
@@ -780,6 +786,9 @@ def metadce(js_file, wasm_file, debug_info, last):
780786 extra_info = '{ "exports": [' + ',' .join (f'["{ asmjs_mangle (x )} ", "{ x } "]' for x in exports ) + ']}'
781787
782788 txt = acorn_optimizer (js_file , ['emitDCEGraph' , '--no-print' ], return_output = True , extra_info = extra_info )
789+ if shared .SKIP_SUBPROCS :
790+ # The next steps depend on the output from this step, so we can't do them if we aren't actually running.
791+ return js_file
783792 graph = json .loads (txt )
784793 # ensure that functions expected to be exported to the outside are roots
785794 required_symbols = user_requested_exports .union (set (settings .SIDE_MODULE_IMPORTS ))
@@ -1209,6 +1218,9 @@ def run_binaryen_command(tool, infile, outfile=None, args=None, debug=False, std
12091218 if settings .GENERATE_SOURCE_MAP and outfile and tool in ['wasm-opt' , 'wasm-emscripten-finalize' ]:
12101219 cmd += [f'--input-source-map={ infile } .map' ]
12111220 cmd += [f'--output-source-map={ outfile } .map' ]
1221+ shared .print_compiler_stage (cmd )
1222+ if shared .SKIP_SUBPROCS :
1223+ return ''
12121224 ret = check_call (cmd , stdout = stdout ).stdout
12131225 if outfile :
12141226 save_intermediate (outfile , '%s.wasm' % tool )
0 commit comments