Skip to content

Commit df1f6f7

Browse files
authored
Update default minimum Node.js version in generated JS to 16.0.0 (#19192)
This version of node supports wasm-bigint by default, so it will help #19156 Node 16 is over 2 years old, and the node website already provides newer versions both for latest and for LTS. This is possible after emscripten-core/emsdk#829 made the emsdk install a 15.x version by default, and then emscripten-core/emsdk#1232 switched to 16.x.
1 parent d25f32e commit df1f6f7

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ See docs/process.md for more on how version tagging works.
2020

2121
3.1.42 (in development)
2222
-----------------------
23+
- The default minimum Node version of Emscripten output was bumped from 10.19 to
24+
16.0. To run the output JS in an older version of node, you can use e.g.
25+
`-sMIN_NODE_VERSION=101900` which will apply the previous minimum version of
26+
10.19.0. (#19192).
2327
- The log message that emcc will sometime print (for example when auto-building
2428
system libraries) can now be completely supressed by running with
2529
`EMCC_LOGGING=0`.

src/settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1797,7 +1797,7 @@ var MIN_CHROME_VERSION = 75;
17971797
// distinct from the minimum version required run the emscripten compiler.
17981798
// This version aligns with the current Ubuuntu TLS 20.04 (Focal).
17991799
// Version is encoded in MMmmVV, e.g. 1814101 denotes Node 18.14.01.
1800-
var MIN_NODE_VERSION = 101900;
1800+
var MIN_NODE_VERSION = 160000;
18011801

18021802
// Tracks whether we are building with errno support enabled. Set to 0
18031803
// to disable compiling errno support in altogether. This saves a little
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4305

test/test_other.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10646,7 +10646,9 @@ def test(args):
1064610646
# Changing this option to [] should decrease code size.
1064710647
self.assertLess(changed, normal)
1064810648
# Check an absolute code size as well, with some slack.
10649-
self.assertLess(abs(changed - 4491), 150)
10649+
self.check_expected_size_in_file('js',
10650+
test_file('other/test_INCOMING_MODULE_JS_API.js.size'),
10651+
changed)
1065010652

1065110653
def test_INCOMING_MODULE_JS_API_missing(self):
1065210654
create_file('pre.js', '''
@@ -12362,22 +12364,22 @@ def test_node_unhandled_rejection(self):
1236212364

1236312365
# With NODEJS_CATCH_REJECTION we expect the unhandled rejection to cause a non-zero
1236412366
# exit code and log the stack trace correctly.
12365-
self.run_process([EMCC, '--pre-js=pre.js', '-sNODEJS_CATCH_REJECTION', 'main.c'])
12366-
output = self.run_js('a.out.js', assert_returncode=NON_ZERO)
12367-
self.assertContained('unhandledRejection', read_file('a.out.js'))
12367+
self.build('main.c', emcc_args=['--pre-js=pre.js', '-sNODEJS_CATCH_REJECTION'])
12368+
output = self.run_js('main.js', assert_returncode=NON_ZERO)
12369+
self.assertContained('unhandledRejection', read_file('main.js'))
1236812370
self.assertContained('ReferenceError: missing is not defined', output)
1236912371
self.assertContained('at foo (', output)
1237012372

1237112373
# Without NODEJS_CATCH_REJECTION we expect node to log the unhandled rejection
1237212374
# but return 0.
1237312375
self.node_args = [a for a in self.node_args if '--unhandled-rejections' not in a]
12374-
self.run_process([EMCC, '--pre-js=pre.js', '-sNODEJS_CATCH_REJECTION=0', 'main.c'])
12375-
self.assertNotContained('unhandledRejection', read_file('a.out.js'))
12376+
self.build('main.c', emcc_args=['--pre-js=pre.js', '-sNODEJS_CATCH_REJECTION=0'])
12377+
self.assertNotContained('unhandledRejection', read_file('main.js'))
1237612378

1237712379
if shared.check_node_version()[0] >= 15:
1237812380
self.skipTest('old behaviour of node JS cannot be tested on node v15 or above')
1237912381

12380-
output = self.run_js('a.out.js')
12382+
output = self.run_js('main.js')
1238112383
self.assertContained('ReferenceError: missing is not defined', output)
1238212384
self.assertContained('at foo (', output)
1238312385

0 commit comments

Comments
 (0)