Skip to content
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

Update default minimum Node.js version to 16.0.0 #19192

Merged
merged 13 commits into from
Jun 21, 2023
Merged

Update default minimum Node.js version to 16.0.0 #19192

merged 13 commits into from
Jun 21, 2023

Conversation

kripken
Copy link
Member

@kripken kripken commented Apr 17, 2023

This version of node supports wasm-bigint by default, so it will help #19156

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 emscripten-core/emsdk#829 made
the emsdk install a 15.x version by default, and then
emscripten-core/emsdk#1232 switched to 16.

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 emscripten-core/emsdk#829 made the emsdk
install a 15.x version by default.
@kripken kripken requested a review from sbc100 April 17, 2023 16:45
Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % discussions about when to actually land this

@jeswr
Copy link
Contributor

jeswr commented May 5, 2023

Node 15 no longer has active or security support. Why not go straight to Node 16 which is currently in maintenance LTS?

@kripken
Copy link
Member Author

kripken commented May 5, 2023

@jeswr Good point, yeah, it might be better to do that. This came up on the mailing list too:

https://groups.google.com/g/emscripten-discuss/c/HmCTeDEw6cQ/m/-nYu5HqfCAAJ

It does seem more obvious to go for 16, but that does allow strictly fewer installations than going to 15 (and 15 is the minimum we need for the wasm-bigint feature), so it's not obvious to me what is best.

@jeswr
Copy link
Contributor

jeswr commented May 5, 2023

so it's not obvious to me what is best.

I'd be suggesting 16. Odd versions of node (including 15) are short lived by design and shouldn't really end up being used in any production scenarios - Node 15 has been deprecated for almost 2 years now (c.f. https://endoflife.date/nodejs).

This is possible after emscripten-core/emsdk#829 made
the emsdk install a 15.x version by default.

I'd be suggesting to upgrade emsdk to 16.x as well (and always using even versions of Node as defaults going into the future).

@jeswr
Copy link
Contributor

jeswr commented May 5, 2023

Just read the mailing list as well and wanted to respond to a particular comment there.

Since emsdk (2) has already been updated, I'm not sure there is any reason to update again from 15.14.0 to 16.0.0. I'm not sure what benefit that would have.

This would actually be quite a beneficial update in our use case in swipl-wasm. I currently have a draft PR open where we are needing to switch over to node 16 for the build step in order to generate a file that will pass our ctest test suite. Using Node 15 to build some of our tests result in UnhandledRejectionErrors. I have not dug into what the root cause of these errors were when building with Node 15.

@sbc100
Copy link
Collaborator

sbc100 commented May 8, 2023

Just read the mailing list as well and wanted to respond to a particular comment there.

Since emsdk (2) has already been updated, I'm not sure there is any reason to update again from 15.14.0 to 16.0.0. I'm not sure what benefit that would have.

This would actually be quite a beneficial update in our use case in swipl-wasm. I currently have a draft PR open where we are needing to switch over to node 16 for the build step in order to generate a file that will pass our ctest test suite. Using Node 15 to build some of our tests result in UnhandledRejectionErrors. I have not dug into what the root cause of these errors were when building with Node 15.

Are the errors you are seeing from running the tests (i.e. running the output of emscripten)?

Remember this issue is just about the minimum node version that we target by default. You are still free to run the output on a more recent version, such as 16.. or whatever you want.

@sbc100
Copy link
Collaborator

sbc100 commented May 8, 2023

If there is an issue with UnhandledRejectionError when running on node 15 we should fix that regardless of the default we target since users can always target an explictly older version. MIN_NODE_VERSION can be set to low as 10.19.0, and we do test the output and run some tests with that ancient version of node.

1 similar comment
@sbc100
Copy link
Collaborator

sbc100 commented May 8, 2023

If there is an issue with UnhandledRejectionError when running on node 15 we should fix that regardless of the default we target since users can always target an explictly older version. MIN_NODE_VERSION can be set to low as 10.19.0, and we do test the output and run some tests with that ancient version of node.

@hoodmane
Copy link
Collaborator

hoodmane commented May 9, 2023

I would also like to see emsdk stop placing node on the path automatically. Or at least not at the start of the path, I would be okay with adding node to the end of the path. Particularly if there is already a newer node around that I would prefer to use it is annoying to have to adjust the path to work around the older node.

@sbc100
Copy link
Collaborator

sbc100 commented May 9, 2023

I would also like to see emsdk stop placing node on the path automatically. Or at least not at the start of the path, I would be okay with adding node to the end of the path. Particularly if there is already a newer node around that I would prefer to use it is annoying to have to adjust the path to work around the older node.

This was largely fixed in #1189/#1209 I believe.

@kripken
Copy link
Member Author

kripken commented May 9, 2023

After thinking more on this I am convinced that we should switch to 16 by default. It is less surprising by far - we've had several people mention that - and also this is tied to the version the emsdk installs by default, and 16 is just much more useful for people to have (since it is a supported version that people might also find useful in their CIs etc.).

But that would depend on making the emsdk install 16 by default. @sbc100 , I know you did the upgrade to 15 fairly recently, and I guess there's no reason to rush to do it again. But next time we think about an update there, I think it would be good to do. In general, I think it makes sense for us to eventually switch to having the emsdk install node LTS versions by default.

@sbc100
Copy link
Collaborator

sbc100 commented Jun 14, 2023

Looks like node 16 is coming to emsdk: emscripten-core/emsdk#1232

@kripken
Copy link
Member Author

kripken commented Jun 20, 2023

Updated to Node 16 after emscripten-core/emsdk#1232 landed.

ChangeLog.md Outdated
@@ -20,6 +20,8 @@ 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default minimum Node version was bumped

Also can you add the word "default" to the PR title?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, but isn't "was bumped" passive voice, which is generally frowned upon in English? I guess just "bump" as in the old text isn't even grammatical...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Bump the default minimum Node version" sounds correct grammatically but that sounds like that text I would write for the PR itself. i.e. its in the present tense, imperative mood. e.d. "Rename foo", "Delete X"

For the changelog entry I normally write in the past tense think. e.g. "foo was renamed", "x was deleted". So I would expect "was bumped" here... but I could be wrong. Reading the rest of the changelog it seems to be mostly be in the past. Should we swith to using the same tense/mood for PR and for the changelog?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. Let's go with your intuition here (changelog in the past, PRs in the present).

@kripken kripken changed the title Update minimum Node.js version to 15.0.0 Update default minimum Node.js version to 15.0.0 Jun 20, 2023
@kripken kripken changed the title Update default minimum Node.js version to 15.0.0 Update default minimum Node.js version to 16.0.0 Jun 20, 2023
@kripken
Copy link
Member Author

kripken commented Jun 20, 2023

A code size test improved here. While improving it I also made it work with --rebaseline.

@kripken
Copy link
Member Author

kripken commented Jun 20, 2023

The code size improvement is due to this diff:

64,69d63
<  var nodeMajor = process.versions.node.split(".")[0];
<  if (nodeMajor < 15) {
<   process.on("unhandledRejection", reason => {
<    throw reason;
<   });
<  }

@sbc100
Copy link
Collaborator

sbc100 commented Jun 21, 2023

15.x -> 16.x in the PR description.

@sbc100
Copy link
Collaborator

sbc100 commented Jun 21, 2023

15.x -> 16.x in the PR description.

And #1232 is the emsdk PR that made it possible

@kripken
Copy link
Member Author

kripken commented Jun 21, 2023

This also required a test fix, to make a test use self.build(). That way the test uses self.emcc_args which we populate with the right node flags for emcc automatically.

@sbc100
Copy link
Collaborator

sbc100 commented Jun 21, 2023

lgtm! Once this landed we should do a release I think.

@kripken
Copy link
Member Author

kripken commented Jun 21, 2023

Ok, I think this is ready to land. We've collected feedback both here and on the mailing list and there were no concerns, aside from actually suggesting to go to 16 and not just 15, as we then agreed.

@kripken kripken merged commit df1f6f7 into main Jun 21, 2023
@kripken kripken deleted the min.node.15 branch June 21, 2023 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants