From 8ecfab1d1685cc64760c76f2febc29441934361b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 17 Apr 2023 09:38:46 -0700 Subject: [PATCH 1/8] Update minimum Node.js version to 15.0.0 This is about 2 years old, and the node website already provides newer versions both for latest and for LTS. However, other places are behind, for example the latest Ubuntu LTS (22) has Node 12, so perhaps we should wait on this. This is possible after https://github.com/emscripten-core/emsdk/pull/829 made the emsdk install a 15.x version by default. --- ChangeLog.md | 5 +++++ src/settings.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index fc808b2e829e9..0498835aff9e3 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -18,6 +18,11 @@ to browse the changes between the tags. See docs/process.md for more on how version tagging works. +Future +----- +- Bump the default minimum Node version from 10.19 to 15.0. To target the + previous minimum version (10.19.0), use `-sMIN_NODE_VERSION=101900`. + 3.1.36 (in development) ----------------------- - The `USES_DYNAMIC_ALLOC` setting has been deprecated. You can get the same diff --git a/src/settings.js b/src/settings.js index af20a52f8ebff..4d120cfce93fc 100644 --- a/src/settings.js +++ b/src/settings.js @@ -1796,7 +1796,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 = 150000; // Tracks whether we are building with errno support enabled. Set to 0 // to disable compiling errno support in altogether. This saves a little From 62af277196405f74df3f3dcad205e8311e2ecd65 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 17 Apr 2023 16:23:20 -0700 Subject: [PATCH 2/8] changlog [ci skip] --- ChangeLog.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 8280676ee375d..aee9750ac3618 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -18,14 +18,10 @@ to browse the changes between the tags. See docs/process.md for more on how version tagging works. -Future ------ -- Bump the default minimum Node version from 10.19 to 15.0. To target the - previous minimum version (10.19.0), use `-sMIN_NODE_VERSION=101900`. - -3.1.36 (in development) 3.1.37 (in development) ----------------------- +- Bump the default minimum Node version from 10.19 to 15.0. To target the + previous minimum version (10.19.0), use `-sMIN_NODE_VERSION=101900` (#19192). 3.1.36 - 04/16/23 ----------------- From 3f9591de8e541b9777d54150d7e556c516493e92 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 20 Jun 2023 12:03:32 -0700 Subject: [PATCH 3/8] 16 --- ChangeLog.md | 2 +- src/settings.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 540ddb56bbc86..8f3f87b944a0d 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -20,7 +20,7 @@ See docs/process.md for more on how version tagging works. 3.1.42 (in development) ----------------------- -- Bump the default minimum Node version from 10.19 to 15.0. To target the +- Bump the default minimum Node version from 10.19 to 16.0. To target the previous minimum version (10.19.0), use `-sMIN_NODE_VERSION=101900` (#19192). - The log message that emcc will sometime print (for example when auto-building system libraries) can now be completely supressed by running with diff --git a/src/settings.js b/src/settings.js index 40e4ea214cc7a..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 = 150000; +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 From d95cc1e4552124b4595156e944f61d5b9df332c1 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 20 Jun 2023 13:21:01 -0700 Subject: [PATCH 4/8] update and generalize test --- test/other/test_INCOMING_MODULE_JS_API.js.size | 1 + test/test_other.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 test/other/test_INCOMING_MODULE_JS_API.js.size 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..0709cc8bf976d 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', ''' From a03ff65c64033fb51c3368f5ec9d4fbbaed54e10 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 20 Jun 2023 13:22:56 -0700 Subject: [PATCH 5/8] feedback --- ChangeLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 8f3f87b944a0d..fef91957f75a1 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -20,7 +20,7 @@ See docs/process.md for more on how version tagging works. 3.1.42 (in development) ----------------------- -- Bump the default minimum Node version from 10.19 to 16.0. To target the +- The default minimum Node version was bumped from 10.19 to 16.0. To target the previous minimum version (10.19.0), use `-sMIN_NODE_VERSION=101900` (#19192). - The log message that emcc will sometime print (for example when auto-building system libraries) can now be completely supressed by running with From 4c2a6e628e8dae016868d5a661cfd9ec1bc55aab Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 21 Jun 2023 08:48:18 -0700 Subject: [PATCH 6/8] Make other.test_node_unhandled_rejection use self.build() so it uses self.emcc_args which are populated with the node flags --- test/test_other.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index 0709cc8bf976d..010c247dfd5f2 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -12364,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) From b2cb9c76b2323d5cd77b2e40f165a3a4c097ad56 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 21 Jun 2023 08:49:36 -0700 Subject: [PATCH 7/8] clarify changelog --- ChangeLog.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index fef91957f75a1..15ab6e045d99c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -20,8 +20,10 @@ See docs/process.md for more on how version tagging works. 3.1.42 (in development) ----------------------- -- The default minimum Node version was bumped from 10.19 to 16.0. To target the - previous minimum version (10.19.0), use `-sMIN_NODE_VERSION=101900` (#19192). +- The default minimum Node version of Emscripten output was bumped from 10.19 to + 16.0. To target 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`. From fcbb74c25c6086389a6b6edbd3db09c36768387e Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 21 Jun 2023 08:49:55 -0700 Subject: [PATCH 8/8] clarify changelog --- ChangeLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 15ab6e045d99c..3ab4a5c7ab685 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -21,7 +21,7 @@ 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 target the output JS in an older version of node, you can use e.g. + 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