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

[wasm] running tests on NodeJs fails with globalThis is not defined #65485

Closed
radical opened this issue Feb 17, 2022 · 9 comments
Closed

[wasm] running tests on NodeJs fails with globalThis is not defined #65485

radical opened this issue Feb 17, 2022 · 9 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-Build-mono

Comments

@radical
Copy link
Member

radical commented Feb 17, 2022

Hitting this on the emscripten bump PR.
Build:

[01:27:29] fail: /datadisks/disk1/work/A3DA08F7/w/B1B30976/e/test-main.js:97
[01:27:29] fail: if (typeof globalThis.crypto === 'undefined') {
[01:27:29] fail: ^
[01:27:29] fail: 
[01:27:29] fail: ReferenceError: globalThis is not defined
[01:27:29] fail:     at Object.<anonymous> (/datadisks/disk1/work/A3DA08F7/w/B1B30976/e/test-main.js:97:1)
[01:27:29] fail:     at Module._compile (internal/modules/cjs/loader.js:778:30)
[01:27:29] fail:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
[01:27:29] fail:     at Module.load (internal/modules/cjs/loader.js:653:32)
[01:27:29] fail:     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
[01:27:29] fail:     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
[01:27:29] fail:     at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
[01:27:29] fail:     at startup (internal/bootstrap/node.js:283:19)
[01:27:29] fail:     at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
[01:27:29] info: Process node exited with 1

I'm disabling nodejs test runs for that PR.

cc @pavelsavara @maraf

@radical radical added arch-wasm WebAssembly architecture area-Build-mono labels Feb 17, 2022
@ghost
Copy link

ghost commented Feb 17, 2022

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Hitting this on the emscripten bump PR.
Build:

[01:27:29] fail: /datadisks/disk1/work/A3DA08F7/w/B1B30976/e/test-main.js:97
[01:27:29] fail: if (typeof globalThis.crypto === 'undefined') {
[01:27:29] fail: ^
[01:27:29] fail: 
[01:27:29] fail: ReferenceError: globalThis is not defined
[01:27:29] fail:     at Object.<anonymous> (/datadisks/disk1/work/A3DA08F7/w/B1B30976/e/test-main.js:97:1)
[01:27:29] fail:     at Module._compile (internal/modules/cjs/loader.js:778:30)
[01:27:29] fail:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
[01:27:29] fail:     at Module.load (internal/modules/cjs/loader.js:653:32)
[01:27:29] fail:     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
[01:27:29] fail:     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
[01:27:29] fail:     at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
[01:27:29] fail:     at startup (internal/bootstrap/node.js:283:19)
[01:27:29] fail:     at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
[01:27:29] info: Process node exited with 1

I'm disabling nodejs test runs for that PR.

cc @pavelsavara @maraf

Author: radical
Assignees: -
Labels:

arch-wasm, area-Build-mono

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Feb 17, 2022
radical added a commit to radekdoulik/runtime that referenced this issue Feb 17, 2022
They are still unstable, and fail with:

```
[01:27:29] fail: /datadisks/disk1/work/A3DA08F7/w/B1B30976/e/test-main.js:97
[01:27:29] fail: if (typeof globalThis.crypto === 'undefined') {
[01:27:29] fail: ^
[01:27:29] fail:
[01:27:29] fail: ReferenceError: globalThis is not defined
[01:27:29] fail:     at Object.<anonymous> (/datadisks/disk1/work/A3DA08F7/w/B1B30976/e/test-main.js:97:1)
[01:27:29] fail:     at Module._compile (internal/modules/cjs/loader.js:778:30)
[01:27:29] fail:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
[01:27:29] fail:     at Module.load (internal/modules/cjs/loader.js:653:32)
[01:27:29] fail:     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
[01:27:29] fail:     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
[01:27:29] fail:     at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
[01:27:29] fail:     at startup (internal/bootstrap/node.js:283:19)
[01:27:29] fail:     at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
```

Issue: dotnet#65485
@lewing
Copy link
Member

lewing commented Feb 17, 2022

I'm not sure what is happening here but it looks like a node specific case at this point, @maraf please work with @radekdoulik to look into it

@pavelsavara
Copy link
Member

This looks like the new nodeJS version (which we get from emsdk) is not used. Why ?

@maraf
Copy link
Member

maraf commented Feb 17, 2022

The new emscripten has a newer version of node, which is in different folder (14.15.5_64bit -> 14.18.2_64bit) and we have the path hardcoded in the sendtohelix-wasm.targets. I have pushed this change to the PR branch.

@radekdoulik
Copy link
Member

Could we avoid hardcoding the version number?

@pavelsavara
Copy link
Member

Also please add something like this to test-main.js

if (node && process.versions.node.split(".")[0]<14) throw new Error("NodeJS at "+process.execPath+"has too low version" + process.versions.node);

So that we don't have think about why, next time.

@radical radical removed the untriaged New issue has not been triaged by the area owner label Feb 17, 2022
@maraf
Copy link
Member

maraf commented Feb 18, 2022

Could we avoid hardcoding the version number?

I'll try to read it from filesystem in #65514.

So that we don't have think about why, next time.

In PR #65549.

@radical
Copy link
Member Author

radical commented Feb 18, 2022

Just a heads up, that we are now running tests on nodejs only on PRs. Once this is fixed, we could enable that for rolling builds.

@maraf
Copy link
Member

maraf commented Feb 18, 2022

Both PRs I mentioned are merged. I think we can close this one.

@maraf maraf closed this as completed Feb 18, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Mar 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Build-mono
Projects
None yet
Development

No branches or pull requests

5 participants