Skip to content

Update MINIMUM_NODE_VERSION to match the emsdk version#18464

Closed
sbc100 wants to merge 1 commit intomainfrom
min_node_version
Closed

Update MINIMUM_NODE_VERSION to match the emsdk version#18464
sbc100 wants to merge 1 commit intomainfrom
min_node_version

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jan 4, 2023

We don't test emscripten on older version of node than this so it seems reasonable to require at least this version.

We don't test emscripten on older version of node than this so it seems
reasonable to require at least this version.
@sbc100
Copy link
Collaborator Author

sbc100 commented Jan 4, 2023

Last time we tried this was back in #9333 and it got reverted.. so this needs some more consideration.

@sbc100
Copy link
Collaborator Author

sbc100 commented Jan 4, 2023

We evidently have not supported 4.1.1 for quite some time. Based on the empirical running of the test suite I found the following.

4.1.1:

/usr/local/google/home/sbc/dev/wasm/emscripten/src/compiler.js:25
  for (let i = 0; i < prefixes.length; ++i) {
       ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:413:25)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:475:10)
    at startup (node.js:117:18)
    at node.js:951:3

Looking at https://packages.ubuntu.com/search?keywords=nodejs I picked that next LTS version focal (20.04LTS) which is 10.19.0:

/usr/local/google/home/sbc/dev/wasm/emscripten/src/parseTools.js:11
globalThis.FOUR_GB = 4 * 1024 * 1024 * 1024;
^

ReferenceError: globalThis is not defined

This globalThis references was first added in #18266 which landed fairly recently and was released in 3.1.28, so it could just be that folks wanting to use 10.19.0 have not noticed this yet.

If it replace globalThis with just global like we use elsewhere I can get a bunch of stuff to work. But wasm bigint support it missing which we do depend on for generating struct info in wasm64 mode.

So it seems like we could make 10.19.0 work with a little effort. I'll give that a go.

@sbc100 sbc100 closed this Jan 4, 2023
@sbc100 sbc100 deleted the min_node_version branch January 4, 2023 13:53
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.

1 participant