Skip to content

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

Closed

Description

@radical

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

Activity

  1. added
    arch-wasm
    on Feb 17, 2022
  2. ghost added
    untriaged
    on Feb 17, 2022
  3. added a commit that references this issue on Feb 17, 2022
  4. lewing commented on Feb 17, 2022

    @lewing
    Member

    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

  5. pavelsavara commented on Feb 17, 2022

    @pavelsavara
    Member

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

  6. maraf commented on Feb 17, 2022

    @maraf
    Member

    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.

  7. radekdoulik commented on Feb 17, 2022

    @radekdoulik
    Member

    Could we avoid hardcoding the version number?

  8. pavelsavara commented on Feb 17, 2022

    @pavelsavara
    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.

  9. removed
    untriaged
    on Feb 17, 2022
  10. maraf commented on Feb 18, 2022

    @maraf
    Member

    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.

  11. radical commented on Feb 18, 2022

    @radical
    MemberAuthor

    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.

  12. maraf commented on Feb 18, 2022

    @maraf
    Member

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

  13. ghost locked as resolved and limited conversation to collaborators on Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-wasmarea-Build-mono

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions