-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Running wasm output via node does not work when in a different directory #4542
Comments
This is actually quite ugly to work around in our test runner. |
Yeah, sorry about this. I'm not sure what we can do to improve. On both node.js and on the web, there isn't a One specific possibility is you can add some code using |
I'm not sure that it will be as ugly as you thought at first glance, @brson. I think that there may be a solution in Do you think that would fix the problem we're seeing? Or is there only one way to find out? |
@rschulman Yes, either of those solutions should work. The only thing I suspect might cause problems is the various paths being passed around - if any of them are relative things could break. But let's just try and see what happens. |
Working asmjs and wasm targets This patch set results in a working standard library for the asmjs-unknown-emscripten and wasm32-unknown-emscripten targets. It is based on the work of @badboy and @rschulman. It does a few things: - Updates LLVM with the emscripten [fastcomp](rust-lang/llvm#50) patches, which include the pnacl IR legalizer and the asm.js backend. This patch is thought not to have any significant effect on existing targets. - Teaches rustbuild to correctly link C code with emscripten - Updates gcc-rs to work correctly with emscripten - Teaches rustbuild to run crate tests for emscripten with node - Modifies Thread::new to return an error on emscripten, to facilitate debugging a common failure mode - Modifies libtest to run in single-threaded mode for emscripten - Ignores a host of tests that don't work yet, mostly dealing with threads and I/O - Updates libc with wasm32 definitions (presently the same as asmjs) - Adds a wasm32-unknown-emscripten target that feeds the output of LLVM's asmjs backend through emcc to generate wasm Notes and caveats: - This is only known to work with `--enable-rustbuild`. - The wasm32 target can't be tested correctly yet because of issues in compiletest and limitations in node emscripten-core/emscripten#4542, but hello.rs does seem to work when run on node via the binaryen interpreter - This requires an up to date installation of the emscripten sdk from its incoming branch - Unwinding is very broken - When enabling the emscripten targets jemalloc is disabled for all targets, which results in test failures for the host Next steps are to fix the jemalloc issue, start building the two emscripten targets on the auto builders, then start producing nightlies. #36317 tracks work on this. Fixes #36515 Fixes #36515 Fixes #36356
Add a travis builder for wasm32-unknown-emscripten This commits add an entry to travis matrix that will execute wasm32-unknown-emscripten tests suites. - Emscripten for asmjs was updated to sdk-1.37.13-64bit - The tests are run with node 8.0.0 (it can execute wasm) - A wrapper script is used to run each test from the directory where it is (workaround for emscripten-core/emscripten#4542) - Some tests are ignore, see #42629 and #42630
At least in Node.js, you have |
@patrickroberts, #5368 fixes this issue. It just wasn't merged yet. |
@nazar-pc thanks for letting me know. I tried to check out your fork of emscripten and rebuild emsdk with it, but the expected versions of llvm caused compilation to fail. What commit of emsdk should I fork that's compatible with your pull request? |
Try to install version that was latest stable approximately at the time of last commit in that PR. |
Quick update: PR was rebased against incoming (look for commits with green tests) so that you can benefit from Emscripten's improvements over the last year. Will hopefully be merged soon. |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
Emscripten and rustc have to use compatible versions of LLVM to avoid linker error. With the update to LLVM 11, emscripten also requires an update, see rust-lang/rust#75716. Also, now the emscripten is updated, the fix for emscripten-core/emscripten#4542 is now avalibe, which means we can delete the node-wasm workaround. Signed-off-by: Joe Richey <joerichey@google.com>
Emscripten and rustc have to use compatible versions of LLVM to avoid linker error. With the update to LLVM 11, emscripten also requires an update, see rust-lang/rust#75716. Also, now the emscripten is updated, the fix for emscripten-core/emscripten#4542 is now avalibe, which means we can delete the node-wasm workaround. Signed-off-by: Joe Richey <joerichey@google.com>
The Rust test suite runs tests using commands like
This results in the following error:
This instead works successfully:
I suspect I can work around this by changing the directory in our test runner.
The text was updated successfully, but these errors were encountered: