Skip to content

Commit 00783ae

Browse files
authored
Move node sanity checking back to perform_sanity_checks (#18625)
In #17725 I though I was being clever by delay node sanity checking until node was actually needed. However, I inadvertently made it always run (at least when linking). This change move the check back into `perform_sanity_checks` which has its results cached so should only run once.
1 parent b08191b commit 00783ae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/shared.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ def run_js_tool(filename, jsargs=[], node_args=[], **kw): # noqa: mutable defau
246246
This is used by emcc to run parts of the build process that are written
247247
implemented in javascript.
248248
"""
249-
check_node()
250249
command = config.NODE_JS + node_args + [filename] + jsargs
251250
return check_call(command, **kw).stdout
252251

@@ -376,7 +375,6 @@ def node_pthread_flags():
376375
@memoize
377376
@ToolchainProfiler.profile()
378377
def check_node():
379-
check_node_version()
380378
try:
381379
run_process(config.NODE_JS + ['-e', 'console.log("hello")'], stdout=PIPE)
382380
except Exception as e:
@@ -397,6 +395,7 @@ def generate_sanity():
397395

398396
def perform_sanity_checks():
399397
# some warning, mostly not fatal checks - do them even if EM_IGNORE_SANITY is on
398+
check_node_version()
400399
check_llvm_version()
401400

402401
llvm_ok = check_llvm()
@@ -410,6 +409,8 @@ def perform_sanity_checks():
410409
if not llvm_ok:
411410
exit_with_error('failing sanity checks due to previous llvm failure')
412411

412+
check_node()
413+
413414
with ToolchainProfiler.profile_block('sanity LLVM'):
414415
for cmd in [CLANG_CC, LLVM_AR, LLVM_NM]:
415416
if not os.path.exists(cmd) and not os.path.exists(cmd + '.exe'): # .exe extension required for Windows

0 commit comments

Comments
 (0)