Skip to content

Commit 414dff4

Browse files
committed
Update minimum supported node version
This change updates the minimum support node version for the generated code and the for running the compiler to 18.20.4. For the generated code this is a change from v12.22.9. For the compiler this is a change from v18.3. This new minimum is supported by both debian/stable and debian/oldstable as well as the current Ubuntu 24.04 LTS (Noble Numbat).
1 parent 57df161 commit 414dff4

File tree

13 files changed

+26
-134
lines changed

13 files changed

+26
-134
lines changed

.circleci/config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ commands:
106106
cat ~/emsdk/.emscripten
107107
echo "export PATH=\"$HOME/node-v${version}-linux-x64/bin:\$PATH\"" >> $BASH_ENV
108108
install-node-oldest:
109-
description: "install node 12.22.9 (oldest)"
109+
description: "install node 18.19.1 (oldest)"
110110
steps:
111111
- install-node-version:
112112
# Keep this in sync with `OLDEST_SUPPORTED_NODE` in `feature_matrix.py`
113-
node_version: "12.22.9"
113+
node_version: "18.19.1"
114114
install-node-lts:
115115
description: "install node 22.21.0 (current LTS)"
116116
steps:
@@ -962,16 +962,16 @@ jobs:
962962
# version.
963963
# Keep this in sync with MINIMUM_NODE_VERSION in tools/shared.py.
964964
- install-node-version:
965-
node_version: "18.3.0"
965+
node_version: "18.19.1"
966966
- run:
967-
name: configure compiler to use 18.3.0
967+
name: configure compiler to use 18.19.1
968968
command: echo "NODE_JS = '$(which node)'" >> ~/emsdk/.emscripten
969969
# Run some basic tests with the minimum version of node that we currently
970970
# support in the generated code.
971971
- install-node-oldest
972972
- run-tests:
973-
title: "node (oldest / 12.22.9)"
974-
extra-cflags: "-sMIN_NODE_VERSION=122209"
973+
title: "node (oldest / 18.19.1)"
974+
extra-cflags: "-sMIN_NODE_VERSION=181901"
975975
# We include most but not all of the nodefs and node rawfs tests here.
976976
# test_fs_nodefs_rw, test_fs_nodefs_statvfs, and test_unistd_io_nodefs_bigint fail.
977977
test_targets: "

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ See docs/process.md for more on how version tagging works.
2929
- SDL3 port updated from 3.2.30 to 3.4.2 (#26572)
3030
- Fixed a race condition in syscall proxying that caused some hangs and ASan
3131
errors (#26582)
32+
- The minimum supported version of node (both for the running the generated
33+
code and for running the compiler) was bumped to v18.19.1.
3234

3335
5.0.4 - 03/23/26
3436
----------------

site/source/docs/tools_reference/settings_reference.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2919,10 +2919,10 @@ MIN_NODE_VERSION
29192919
Specifies minimum node version to target for the generated code. This is
29202920
distinct from the minimum version required to run the emscripten compiler.
29212921
Version is encoded in MMmmVV, e.g. 181401 denotes Node 18.14.01.
2922-
Minimum supported value is 122209, which was released 2022-01-11 (see
2923-
feature_matrix.py). This version aligns with the Ubuntu TLS 22.04 (Jammy).
2922+
Minimum supported value is 189101, which was released 2024-02-14 (see
2923+
feature_matrix.py). This version aligns with the Ubuntu TLS 24.04 (Noble).
29242924

2925-
Default value: 160000
2925+
Default value: 181901
29262926

29272927
.. _minimal_runtime:
29282928

src/babel-plugins/strip-node-prefix.mjs

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/runtime_common.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,6 @@ function updateMemoryViews() {
136136
#endif
137137
}
138138

139-
#if ENVIRONMENT_MAY_BE_NODE && MIN_NODE_VERSION < 160000
140-
// The performance global was added to node in v16.0.0:
141-
// https://nodejs.org/api/globals.html#performance
142-
if (ENVIRONMENT_IS_NODE) {
143-
// This is needed for emscripten_get_now and for pthreads support which
144-
// depends on it for accurate timing.
145-
// Use `global` rather than `globalThis` here since older versions of node
146-
// don't have `globalThis`.
147-
global.performance ??= require('perf_hooks').performance;
148-
}
149-
#endif
150-
151139
#if IMPORTED_MEMORY
152140
// In non-standalone/normal mode, we create the memory here.
153141
#include "runtime_init_memory.js"

src/settings.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,9 +1920,9 @@ var MIN_CHROME_VERSION = 85;
19201920
// Specifies minimum node version to target for the generated code. This is
19211921
// distinct from the minimum version required to run the emscripten compiler.
19221922
// Version is encoded in MMmmVV, e.g. 181401 denotes Node 18.14.01.
1923-
// Minimum supported value is 122209, which was released 2022-01-11 (see
1924-
// feature_matrix.py). This version aligns with the Ubuntu TLS 22.04 (Jammy).
1925-
var MIN_NODE_VERSION = 160000;
1923+
// Minimum supported value is 189101, which was released 2024-02-14 (see
1924+
// feature_matrix.py). This version aligns with the Ubuntu TLS 24.04 (Noble).
1925+
var MIN_NODE_VERSION = 181901;
19261926

19271927
// If true, uses minimal sized runtime without POSIX features, Module,
19281928
// preRun/preInit/etc., Emscripten built-in XHR loading or library_browser.js.

test/common.py

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import line_endings
2929
from retryable_unittest import RetryableTestCase
3030

31-
from tools import building, config, feature_matrix, shared, utils
31+
from tools import building, config, shared, utils
3232
from tools.feature_matrix import Feature
3333
from tools.settings import COMPILE_TIME_SETTINGS
3434
from tools.shared import DEBUG, EMCC, EMXX, get_canonical_temp_dir
@@ -147,15 +147,6 @@ def record_flaky_test(test_name, attempt_count, max_attempts, exception_msg):
147147
f.write(f'{test_name}\n')
148148

149149

150-
def node_bigint_flags(node_version):
151-
# The --experimental-wasm-bigint flag was added in v12, and then removed (enabled by default)
152-
# in v16.
153-
if node_version and node_version < (16, 0, 0):
154-
return ['--experimental-wasm-bigint']
155-
else:
156-
return []
157-
158-
159150
@contextlib.contextmanager
160151
def env_modify(updates):
161152
"""A context manager that updates os.environ."""
@@ -457,11 +448,7 @@ def require_pthreads(self):
457448
if self.get_setting('MINIMAL_RUNTIME'):
458449
self.skipTest('non-browser pthreads not yet supported with MINIMAL_RUNTIME')
459450
for engine in self.js_engines:
460-
if engine_is_node(engine):
461-
if not self.try_require_node_version(16, 0, 0):
462-
self.fail('node v16 required to run this test')
463-
return
464-
elif engine_is_bun(engine) or engine_is_deno(engine):
451+
if engine_is_node(engine) or engine_is_bun(engine) or engine_is_deno(engine):
465452
self.require_engine(engine)
466453
return
467454
self.fail('no JS engine found capable of running pthreads')
@@ -531,23 +518,6 @@ def try_require_node_version(self, major, minor=0, revision=0):
531518
self.require_engine(nodejs)
532519
return True
533520

534-
def require_simd(self):
535-
if 'EMTEST_SKIP_SIMD' in os.environ:
536-
self.skipTest('test requires node >= 16 or d8 (and EMTEST_SKIP_SIMD is set)')
537-
if self.is_browser_test():
538-
return
539-
540-
if self.try_require_node_version(16):
541-
return
542-
543-
v8 = get_v8()
544-
if v8:
545-
self.cflags.append('-sENVIRONMENT=shell')
546-
self.require_engine(v8)
547-
return
548-
549-
self.fail('either d8 or node >= 16 required to run wasm64 tests. Use EMTEST_SKIP_SIMD to skip')
550-
551521
def require_wasm_legacy_eh(self):
552522
if 'EMTEST_SKIP_WASM_LEGACY_EH' in os.environ:
553523
self.skipTest('test requires node >= 17 or d8 (and EMTEST_SKIP_WASM_LEGACY_EH is set)')
@@ -701,13 +671,6 @@ def setUp(self):
701671
nodejs = get_nodejs()
702672
if nodejs:
703673
node_version = shared.get_node_version(nodejs)
704-
if node_version < (13, 0, 0):
705-
self.node_args.append('--unhandled-rejections=strict')
706-
elif node_version < (15, 0, 0):
707-
# Opt in to node v15 default behaviour:
708-
# https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode
709-
self.node_args.append('--unhandled-rejections=throw')
710-
self.node_args += node_bigint_flags(node_version)
711674

712675
# If the version we are running tests in is lower than the version that
713676
# emcc targets then we need to tell emcc to target that older version.
@@ -719,12 +682,6 @@ def setUp(self):
719682
)
720683
if node_version < emcc_min_node_version:
721684
self.cflags.append('-sMIN_NODE_VERSION=%02d%02d%02d' % node_version)
722-
self.cflags.append('-Wno-transpile')
723-
724-
# This allows much of the test suite to be run on older versions of node that don't
725-
# support wasm bigint integration
726-
if node_version[0] < feature_matrix.min_browser_versions[feature_matrix.Feature.JS_BIGINT_INTEGRATION]['node'] / 10000:
727-
self.cflags.append('-sWASM_BIGINT=0')
728685

729686
self.v8_args = ['--wasm-staging']
730687
self.env = {}

test/test_core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ def wasm_simd(func):
138138

139139
@wraps(func)
140140
def decorated(self, *args, **kwargs):
141-
self.require_simd()
142141
if self.is_wasm2js():
143142
self.skipTest('wasm2js only supports MVP for now')
144143
if '-O3' in self.cflags:

test/test_other.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13418,10 +13418,6 @@ def test_node_prefix_transpile(self):
1341813418
content = read_file('a.out.js')
1341913419
self.assertContained('node:', content)
1342013420

13421-
self.run_process([EMCC, test_file('hello_world.c'), '-sEXPORT_ES6', '-sMIN_NODE_VERSION=150000', '-Wno-transpile'])
13422-
content = read_file('a.out.js')
13423-
self.assertNotContained('node:', content)
13424-
1342513421
def test_gmtime_noleak(self):
1342613422
# Confirm that gmtime_r does not leak when called in isolation.
1342713423
self.do_other_test('test_gmtime_noleak.c', cflags=['-fsanitize=leak'])

tools/building.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,6 @@ def transpile(filename):
543543
config = {
544544
'sourceType': 'script',
545545
'presets': ['@babel/preset-env'],
546-
'plugins': [],
547546
'targets': {},
548547
'parserOpts': {
549548
# FIXME: Remove when updating to Babel 8, see:
@@ -559,7 +558,6 @@ def transpile(filename):
559558
config['targets']['safari'] = version_split(settings.MIN_SAFARI_VERSION)
560559
if settings.MIN_NODE_VERSION != UNSUPPORTED:
561560
config['targets']['node'] = version_split(settings.MIN_NODE_VERSION)
562-
config['plugins'] = [path_from_root('src/babel-plugins/strip-node-prefix.mjs')]
563561
config_json = json.dumps(config, indent=2)
564562
outfile = shared.get_temp_files().get('babel.js').name
565563
config_file = shared.get_temp_files().get('babel_config.json').name

0 commit comments

Comments
 (0)