Skip to content

Update default minimum Node.js version to 16.0.0 #19192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ See docs/process.md for more on how version tagging works.

3.1.42 (in development)
-----------------------
- The default minimum Node version of Emscripten output was bumped from 10.19 to
16.0. To run the output JS in an older version of node, you can use e.g.
`-sMIN_NODE_VERSION=101900` which will apply the previous minimum version of
10.19.0. (#19192).
- The log message that emcc will sometime print (for example when auto-building
system libraries) can now be completely supressed by running with
`EMCC_LOGGING=0`.
Expand Down
2 changes: 1 addition & 1 deletion src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ var MIN_CHROME_VERSION = 75;
// distinct from the minimum version required run the emscripten compiler.
// This version aligns with the current Ubuuntu TLS 20.04 (Focal).
// Version is encoded in MMmmVV, e.g. 1814101 denotes Node 18.14.01.
var MIN_NODE_VERSION = 101900;
var MIN_NODE_VERSION = 160000;

// Tracks whether we are building with errno support enabled. Set to 0
// to disable compiling errno support in altogether. This saves a little
Expand Down
1 change: 1 addition & 0 deletions test/other/test_INCOMING_MODULE_JS_API.js.size
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4305
16 changes: 9 additions & 7 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -10646,7 +10646,9 @@ def test(args):
# Changing this option to [] should decrease code size.
self.assertLess(changed, normal)
# Check an absolute code size as well, with some slack.
self.assertLess(abs(changed - 4491), 150)
self.check_expected_size_in_file('js',
test_file('other/test_INCOMING_MODULE_JS_API.js.size'),
changed)

def test_INCOMING_MODULE_JS_API_missing(self):
create_file('pre.js', '''
Expand Down Expand Up @@ -12362,22 +12364,22 @@ def test_node_unhandled_rejection(self):

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

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

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

output = self.run_js('a.out.js')
output = self.run_js('main.js')
self.assertContained('ReferenceError: missing is not defined', output)
self.assertContained('at foo (', output)

Expand Down