diff --git a/ChangeLog.md b/ChangeLog.md index ba7798e2d8a8d..3ab4a5c7ab685 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -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`. diff --git a/src/settings.js b/src/settings.js index cb07f215b33f0..e549f9b0d42e9 100644 --- a/src/settings.js +++ b/src/settings.js @@ -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 diff --git a/test/other/test_INCOMING_MODULE_JS_API.js.size b/test/other/test_INCOMING_MODULE_JS_API.js.size new file mode 100644 index 0000000000000..75f4eab784cc6 --- /dev/null +++ b/test/other/test_INCOMING_MODULE_JS_API.js.size @@ -0,0 +1 @@ +4305 diff --git a/test/test_other.py b/test/test_other.py index 83b1063c42e87..010c247dfd5f2 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -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', ''' @@ -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)