Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Aug 26, 2025

See #20573

@sbc100 sbc100 requested review from juj and kripken August 26, 2025 22:03
@juj
Copy link
Collaborator

juj commented Aug 27, 2025

This would be good to land.

I pulled this locally into the integrated big endian node emsdk, but after this PR, I still get a bunch of failures in the suite:

http://localhost:8010/api/v2/logs/32577/raw_inline

e.g.

======================================================================
ERROR: test_autodebug_wasm (test_core.bigendian.test_autodebug_wasm)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.12/unittest/case.py", line 58, in testPartExecutor
    yield
  File "/usr/lib/python3.12/unittest/case.py", line 634, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.12/unittest/case.py", line 589, in _callTestMethod
    if method() is not None:
       ^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 982, in resulting_test
    return func(self, *args)
           ^^^^^^^^^^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 716, in metafunc
    func(self, *args, **kwargs)
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/test_core.py", line 304, in decorated
    f(self, *args, **kwargs)
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 477, in modified
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/test_core.py", line 7047, in test_autodebug_wasm
    self.node_args += shared.node_reference_types_flags(self.get_nodejs())
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/tools/shared.py", line 348, in node_reference_types_flags
    node_version = get_node_version(nodejs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/tools/shared.py", line 329, in get_node_version
    return _get_node_version_pair(nodejs)[1]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/tools/shared.py", line 321, in _get_node_version_pair
    actual = run_process(nodejs + ['--version'], stdout=PIPE).stdout.strip()
                         ~~~~~~~^~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'

here self.get_nodejs() returns None, because line

if config.NODE_JS_TEST not in self.js_engines:

is true. My self.js_engines is only

['/mnt/ssd1000/emscripten_buildbot/worker_root/x10dax-linux-mint22/emscripten_x10dax/build/node/nightly-v25.0.0-nightly202507249188563304/bin/node']

The way I set up the big endian node is I have .emscripten file as follows:

import os
emsdk_path = os.path.dirname(os.getenv('EM_CONFIG')).replace('\\', '/')
LLVM_ROOT = emsdk_path + '/llvm/git/build_main_64/bin'
NODE_JS = emsdk_path + '/node/nightly-v25.0.0-nightly202507249188563304/bin/node'
EMSCRIPTEN_ROOT = emsdk_path + '/emscripten/main'
BINARYEN_ROOT = emsdk_path + '/binaryen/main_64bit_binaryen'
NODE_JS_TEST = ['qemu-s390x', '-L', '/usr/s390x-linux-gnu/', emsdk_path + '/node-big-endian-crosscompile/22.16.0_64bit/bin/node']

and EMSDK_NODE environment variable points to same as NODE_JS above: emsdk_path + '/node/nightly-v25.0.0-nightly202507249188563304/bin/node'.

But it seems that is not enough, but there is some other addition that is needed? Do I need to customize adding NODE_JS_TEST somewhere to a js_engines variable? Or should that happen automatically?

@sbc100 sbc100 enabled auto-merge (squash) August 27, 2025 17:32
@sbc100 sbc100 merged commit 97d872d into emscripten-core:main Aug 27, 2025
30 checks passed
@sbc100 sbc100 deleted the node_js_test branch August 27, 2025 17:36
@juj juj mentioned this pull request Aug 27, 2025
@sbc100
Copy link
Collaborator Author

sbc100 commented Aug 27, 2025

This would be good to land.

I pulled this locally into the integrated big endian node emsdk, but after this PR, I still get a bunch of failures in the suite:

http://localhost:8010/api/v2/logs/32577/raw_inline

e.g.

======================================================================
ERROR: test_autodebug_wasm (test_core.bigendian.test_autodebug_wasm)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.12/unittest/case.py", line 58, in testPartExecutor
    yield
  File "/usr/lib/python3.12/unittest/case.py", line 634, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.12/unittest/case.py", line 589, in _callTestMethod
    if method() is not None:
       ^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 982, in resulting_test
    return func(self, *args)
           ^^^^^^^^^^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 716, in metafunc
    func(self, *args, **kwargs)
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/test_core.py", line 304, in decorated
    f(self, *args, **kwargs)
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 477, in modified
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/test_core.py", line 7047, in test_autodebug_wasm
    self.node_args += shared.node_reference_types_flags(self.get_nodejs())
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/tools/shared.py", line 348, in node_reference_types_flags
    node_version = get_node_version(nodejs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/tools/shared.py", line 329, in get_node_version
    return _get_node_version_pair(nodejs)[1]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/tools/shared.py", line 321, in _get_node_version_pair
    actual = run_process(nodejs + ['--version'], stdout=PIPE).stdout.strip()
                         ~~~~~~~^~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'

here self.get_nodejs() returns None, because line

if config.NODE_JS_TEST not in self.js_engines:

is true. My self.js_engines is only

['/mnt/ssd1000/emscripten_buildbot/worker_root/x10dax-linux-mint22/emscripten_x10dax/build/node/nightly-v25.0.0-nightly202507249188563304/bin/node']

The way I set up the big endian node is I have .emscripten file as follows:

import os
emsdk_path = os.path.dirname(os.getenv('EM_CONFIG')).replace('\\', '/')
LLVM_ROOT = emsdk_path + '/llvm/git/build_main_64/bin'
NODE_JS = emsdk_path + '/node/nightly-v25.0.0-nightly202507249188563304/bin/node'
EMSCRIPTEN_ROOT = emsdk_path + '/emscripten/main'
BINARYEN_ROOT = emsdk_path + '/binaryen/main_64bit_binaryen'
NODE_JS_TEST = ['qemu-s390x', '-L', '/usr/s390x-linux-gnu/', emsdk_path + '/node-big-endian-crosscompile/22.16.0_64bit/bin/node']

and EMSDK_NODE environment variable points to same as NODE_JS above: emsdk_path + '/node/nightly-v25.0.0-nightly202507249188563304/bin/node'.

But it seems that is not enough, but there is some other addition that is needed? Do I need to customize adding NODE_JS_TEST somewhere to a js_engines variable? Or should that happen automatically?

yes that should be enough. js_engines should be populated from confgi.JS_ENGINES should should default to just NODE_JS_TEST.

The EMSDK_NODE environment variable is not used anywhere by emscripten.

juj added a commit that referenced this pull request Aug 27, 2025
Emsdk generates

```
import os
emsdk_path = os.path.dirname(os.getenv('EM_CONFIG')).replace('\\', '/')
LLVM_ROOT = emsdk_path + '/llvm/git/build_main_64/bin'
NODE_JS = emsdk_path + '/node/22.16.0_64bit/bin/node'
EMSCRIPTEN_ROOT = emsdk_path + '/emscripten/main'
BINARYEN_ROOT = emsdk_path + '/binaryen/main_64bit_binaryen'
NODE_JS_TEST = ['qemu-s390x', '-L', '/usr/s390x-linux-gnu/', emsdk_path + '/node-big-endian-crosscompile/22.16.0_64bit/bin/node']
```
when activating regular and big endian node. This results in a
non-working Emscripten installation that complains about NODE_JS not
found.

Comment at
#25063 (comment)
suggests that the intent is that if NODE_JS_TEST is populated, it should
go to JS_ENGINES, so make that happen.
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.

3 participants