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

Exception: 'run_command unexpected stderr' when running wasm2js tests with nodejs-14.5.0 #2970

Closed
rathann opened this issue Jul 21, 2020 · 3 comments

Comments

@rathann
Copy link
Contributor

rathann commented Jul 21, 2020

$ ./check.py --binaryen-bin build/bin wasm2js
warning: no mozjs found (did not check native wasm support nor asm.js validation)
warning: no interpreter provided (did not test spec interpreter validation)

[ checking wasm2js testcases... ]

.. empty_table.wast
executing:  /builddir/build/BUILD/binaryen-version_95/build/bin/wasm2js split.wast -all --disable-exception-handling
executing:  /builddir/build/BUILD/binaryen-version_95/build/bin/wasm2js split.wast -all --disable-exception-handling --allow-asserts
executing:  /builddir/build/BUILD/binaryen-version_95/build/bin/wasm2js split.wast -all --disable-exception-handling --allow-asserts
[PassRunner] running passes...
[PassRunner]   running pass: autodrop...                          2.165e-06 seconds.
[PassRunner]   (validating)
[PassRunner]   running pass: legalize-js-interface...             1.0406e-05 seconds.
[PassRunner]   (validating)
[PassRunner]   running pass: remove-non-js-ops...                 8.381e-06 seconds.
[PassRunner]   (validating)
[PassRunner]   running pass: flatten...                           9.77e-07 seconds.
[PassRunner]   (validating)
[PassRunner]   running pass: i64-to-i32-lowering...               2.0394e-05 seconds.
[PassRunner]   (validating)
[PassRunner]   running pass: alignment-lowering...                3.562e-06 seconds.
[PassRunner]   (validating)
[PassRunner]   running pass: flatten...                           1.606e-06 seconds.
[PassRunner]   (validating)
[PassRunner]   running pass: simplify-locals-notee-nostructure... 1.536e-06 seconds.
[PassRunner]   (validating)
[PassRunner]   running pass: reorder-locals...                    1.676e-06 seconds.
[PassRunner]   (validating)
[PassRunner]   running pass: vacuum...                            1.327e-06 seconds.
[PassRunner]   (validating)
[PassRunner]   running pass: remove-unused-module-elements...     8.311e-06 seconds.
[PassRunner]   (validating)
[PassRunner]   running pass: dce...                               1.397e-06 seconds.
[PassRunner]   (validating)
[PassRunner] passes took 6.1738e-05 seconds.
[PassRunner] (final validation)
executing:  /usr/bin/node --experimental-modules --loader /builddir/build/BUILD/binaryen-version_95/scripts/test/node-esm-loader.mjs a.2asm.mjs
(node:187260) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
executing:  /usr/bin/node --experimental-modules --loader /builddir/build/BUILD/binaryen-version_95/scripts/test/node-esm-loader.mjs a.2asm.asserts.mjs
Traceback (most recent call last):
  File "/builddir/build/BUILD/binaryen-version_95/./check.py", line 403, in <module>
    sys.exit(main())
  File "/builddir/build/BUILD/binaryen-version_95/./check.py", line 386, in main
    TEST_SUITES[test]()
  File "/builddir/build/BUILD/binaryen-version_95/scripts/test/wasm2js.py", line 124, in test_wasm2js
    test_wasm2js_output()
  File "/builddir/build/BUILD/binaryen-version_95/scripts/test/wasm2js.py", line 90, in test_wasm2js_output
    out = support.run_command(cmd, expected_err='', err_ignore='ExperimentalWarning')
  File "/builddir/build/BUILD/binaryen-version_95/scripts/test/support.py", line 182, in run_command
    raise Exception(('run_command unexpected stderr',
Exception: ('run_command unexpected stderr', "expected '', actual '(Use `node --trace-warnings ...` to show where the warning was created)\n'")

This is with nodejs-14.5.0.

Indeed, running the above command directly gives an extra line of output:

$ cd out/test/
$ /usr/bin/node --experimental-modules --loader /builddir/build/BUILD/binaryen-version_95/scripts/test/node-esm-loader.mjs a.2asm.mjs
(node:187299) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
@rathann
Copy link
Contributor Author

rathann commented Jul 21, 2020

For now, I'm using the patch below as a work-around:

diff -up binaryen-version_95/scripts/test/wasm2js.py.node binaryen-version_95/scripts/test/wasm2js.py
--- binaryen-version_95/scripts/test/wasm2js.py.node    2020-07-21 06:04:33.000000000 +0200
+++ binaryen-version_95/scripts/test/wasm2js.py 2020-07-21 13:43:50.093293525 +0200
@@ -80,7 +80,7 @@ def test_wasm2js_output():
                 # `spectest` and `env` modules in our tests.
                 if shared.NODEJS:
                     loader = os.path.join(shared.options.binaryen_root, 'scripts', 'test', 'node-esm-loader.mjs')
-                    node = [shared.NODEJS, '--experimental-modules', '--loader', loader]
+                    node = [shared.NODEJS, '--experimental-modules', '--no-warnings', '--loader', loader]
                     cmd = node[:]
                     cmd.append('a.2asm.mjs')
                     out = support.run_command(cmd)

@kripken
Copy link
Member

kripken commented Jul 21, 2020

@rathann Interesting, looks like a new node warning then. I think that diff looks good - please open a PR with that, thanks!

rathann added a commit to rathann/binaryen that referenced this issue Jul 21, 2020
Fixes issue WebAssembly#2970

Exception: 'run_command unexpected stderr' when running wasm2js tests with nodejs-14.5.0
kripken pushed a commit that referenced this issue Jul 22, 2020
Fixes issue #2970

Avoids "Exception: 'run_command unexpected stderr'" when running wasm2js tests
with nodejs-14.5.0+, which is due to extra warnings from that node:

$ cd out/test/
$ /usr/bin/node --experimental-modules --loader /builddir/build/BUILD/binaryen-version_95/scripts/test/node-esm-loader.mjs a.2asm.mjs
(node:187299) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
@kripken
Copy link
Member

kripken commented Jul 22, 2020

Fixed by that PR.

@kripken kripken closed this as completed Jul 22, 2020
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

No branches or pull requests

2 participants