Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Oct 27, 2023

Bump the minimum build-time version of node 10.19.0 -> 16.20.0

This new minimum version matches the version that we ship with emsdk.
Critically it supports null coalescing & logical assignment needed
by #20549.

@sbc100 sbc100 requested review from RReverser and kripken October 27, 2023 01:57
@curiousdannii
Copy link
Contributor

Node 16 is already EOL (by one month). Would it be okay to push the MSV to 18?

Copy link
Collaborator

@RReverser RReverser left a comment

Choose a reason for hiding this comment

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

I don't know what the implications of bumping Node version are, but LGTM.

@RReverser
Copy link
Collaborator

Node 16 is already EOL (by one month). Would it be okay to push the MSV to 18?

I suspect this would need to change in emsdk first.

@RReverser
Copy link
Collaborator

RReverser commented Oct 27, 2023

Nit: can't comment on specific line as it's not part of the diff, but node_pthread_flags() also need to be removed.

@RReverser
Copy link
Collaborator

RReverser commented Oct 27, 2023

Also the code/comment here

# 10.19.0 is the oldest version of node that we do any testing with.

@sbc100
Copy link
Collaborator Author

sbc100 commented Oct 27, 2023

Node 16 is already EOL (by one month). Would it be okay to push the MSV to 18?

The MSV of node for running emscripten tends to lag way behind the officially supported node versions (as you can see from the fact that we are still supporting node 10.19.0!) since LTS linux distros such as debian/stable and ubuntu LTS.

@sbc100 sbc100 force-pushed the bump_min_node_version branch 2 times, most recently from 09f14b7 to dfd58d5 Compare October 27, 2023 16:04
@sbc100 sbc100 requested review from RReverser, dschuff and juj October 27, 2023 16:05
@sbc100 sbc100 force-pushed the bump_min_node_version branch from dfd58d5 to 8914c09 Compare October 27, 2023 16:29
@dschuff
Copy link
Member

dschuff commented Oct 27, 2023

Is 18 the version where the official binaries don't run on certain older Linux distros?

@RReverser
Copy link
Collaborator

Nit: can't comment on specific line as it's not part of the diff, but node_pthread_flags() also need to be removed.

@sbc100 I think this comment still stands.

@sbc100
Copy link
Collaborator Author

sbc100 commented Oct 27, 2023

Is 18 the version where the official binaries don't run on certain older Linux distros?

Yes. Specifically they dropped support for ubuntu/trusty.

@sbc100 sbc100 force-pushed the bump_min_node_version branch 2 times, most recently from e0143f3 to 05116f4 Compare October 27, 2023 17:09
emcc.py Outdated
if settings.MIN_NODE_VERSION >= 150000:
default_setting('NODEJS_CATCH_REJECTION', 0)
if settings.MIN_NODE_VERSION < 162000:
exit_with_error('targeting node older than v16.2 is not supported')
Copy link
Member

Choose a reason for hiding this comment

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

Wait, I'm confused - MIN_NODE_VERSION is for the generated code, which contradicts the changelog entry.

Are both being updated in this PR?

If we want to change the generated code version, can we not support older node by using transpilation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry you are correct, I also bumped min runtime version we support from 150000 to 162000. This keeps the testing matrix a little simple since it avoids us having to do specific testing with v15. But maybe its worth keeping this change focused on the build-time version.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I decided to stick with the update of both version. The min output version is much more minor bump

@sbc100 sbc100 changed the title Update the minimum supported version of node (10.19.0 -> 16.20.0) Update the minimum supported build-time version of node (10.19.0 -> 16.20.0) Oct 27, 2023
@sbc100 sbc100 changed the title Update the minimum supported build-time version of node (10.19.0 -> 16.20.0) Update the minimum supported version of node to 16.20.0 Oct 27, 2023
@sbc100 sbc100 force-pushed the bump_min_node_version branch 2 times, most recently from 6a55ee5 to 563e23c Compare October 27, 2023 18:03
ChangeLog.md Outdated
-----------------------
- The minimum version of node required run the compiler was updated from
10.19 to 16.20. The minimum verison of node supported by the
emscripten-generated code was updated from 15.0 to 16.20. One side effect of
Copy link
Member

Choose a reason for hiding this comment

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

The code below this in emcc.py shows this bumps the absolute version (the version we errored on, and do not even support transpiling on) for generated code from 10 to 16. So this comment looks flipped?

A hard error on node 16.20 is fairly strict. Is it hard to support earlier versions using transpilation, as I asked before? If it is, I'm not necessarily opposed to this, but let's then point people to using older versions of emscripten. The reason I mention all this is that sometimes someone does want to run "everywhere", even old machines without outdated node.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think transpilation + users supplying their own Node flags should still work if we remove the hard error, it's just that we won't test those versions or provide helpful messages (we don't want to maintain those forever).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, perhaps I'll just downgrade this to a warning. I'm trying to avoid testing on yet another version of node.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah I think that will be sensible middle ground.

RReverser added a commit to RReverser/emscripten that referenced this pull request Oct 27, 2023
The default is already higher than one specified here, so it wasn't really a bump.

This is a tiny part extracted from emscripten-core#20551 just to unblock this build.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Oct 30, 2023
This is needed for emscripten-core#20551 so that we can continue to run tests
under versions of node that are too old to run the compiler.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Oct 30, 2023
This is needed for emscripten-core#20551 so that we can continue to run tests
under versions of node that are too old to run the compiler.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Oct 30, 2023
This is needed for emscripten-core#20551 so that we can continue to run tests
under versions of node that are too old to run the compiler.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Oct 30, 2023
This is needed for emscripten-core#20551 so that we can continue to run tests
under versions of node that are too old to run the compiler.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Oct 30, 2023
This is needed for emscripten-core#20551 so that we can continue to run tests
under versions of node that are too old to run the compiler.
@sbc100 sbc100 force-pushed the bump_min_node_version branch from 563e23c to e325726 Compare October 30, 2023 21:16
sbc100 added a commit to sbc100/emscripten that referenced this pull request Oct 30, 2023
This is needed for emscripten-core#20551 so that we can continue to run tests
under versions of node that are too old to run the compiler.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Oct 30, 2023
This is needed for emscripten-core#20551 so that we can continue to run tests
under versions of node that are too old to run the compiler.
@sbc100 sbc100 force-pushed the bump_min_node_version branch from e325726 to ad50ab2 Compare October 30, 2023 22:13
sbc100 added a commit that referenced this pull request Oct 30, 2023
This is needed for #20551 so that we can continue to run tests
under versions of node that are too old to run the compiler.
@sbc100 sbc100 force-pushed the bump_min_node_version branch 2 times, most recently from b49c99f to 8669e6d Compare October 30, 2023 23:35
@sbc100 sbc100 changed the title Update the minimum supported version of node to 16.20.0 Update the minimum supported build-time version of node to 16.20.0 Oct 30, 2023
@sbc100
Copy link
Collaborator Author

sbc100 commented Oct 30, 2023

Now that #20573 has landed this change is once again solely focused on the build time version of node. PTAL

@sbc100 sbc100 force-pushed the bump_min_node_version branch from 8669e6d to 811a9b8 Compare October 30, 2023 23:37
This new minimum version matches the version that we ship with emsdk.
Critically it supports null coalescing & logical assignment needed
by emscripten-core#20549.
@sbc100 sbc100 force-pushed the bump_min_node_version branch from 811a9b8 to e6eacab Compare October 30, 2023 23:38
-----------------------
- The minimum version of node required run the compiler was updated from
10.19 to 16.20. This does not effect the node requirements of the generated
JavaScript code. (#20551)
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps rename the PR to be like this comment? "build-time" is less clear than the text here, "to run the compiler" I think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry too late. I think build-time is good enough for internal emscripten developers.. but I wanted to be extra explicit in the changelog.

@sbc100 sbc100 merged commit eefceb7 into emscripten-core:main Oct 31, 2023
@sbc100 sbc100 deleted the bump_min_node_version branch October 31, 2023 01:04
RReverser pushed a commit to RReverser/emscripten that referenced this pull request Oct 31, 2023
…n-core#20573)

This is needed for emscripten-core#20551 so that we can continue to run tests
under versions of node that are too old to run the compiler.
RReverser pushed a commit to RReverser/emscripten that referenced this pull request Oct 31, 2023
…mscripten-core#20551)

This new minimum version matches the version that we ship with emsdk.
Critically it supports null coalescing & logical assignment needed
by emscripten-core#20549.
@juj
Copy link
Collaborator

juj commented Nov 3, 2023

I think this is fine for us. Tried to find which OS versions Node.js 16.20.0 LTS supports, though couldn't find info here at least: https://nodejs.org/en/blog/release/v16.20.0

Any chance you might have run into such info while looking at this? (that's fine if not, I can try to hunt deeper myself)

@kleisauke
Copy link
Collaborator

sbc100 added a commit to sbc100/emscripten that referenced this pull request Dec 6, 2023
Since we updated out min node version to 16 in emscripten-core#20551 we can now
assume that `globalThis` (the more standard name) is always available

See https://nodejs.org/api/globals.html#global
sbc100 added a commit that referenced this pull request Dec 6, 2023
Since we updated out min node version to 16 in #20551 we can now
assume that `globalThis` (the more standard name) is always available

See https://nodejs.org/api/globals.html#global
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.

7 participants