-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo test
tries to execute .wasm files
#7471
Comments
Is this maybe a duplicate of #7255? |
Yes it is, although the top post of that issue focuses on the file name when the larger issue is that the wasm is being executed at all. I'd be fine rolling this issue into the other or vice versa. |
The wasm file is added around here and I think the fix may be to tweak the |
Mark Emscripten's .wasm files auxiliary This fixes #7471 and fixes #7255 by preventing the .wasm file from being treated as an executable binary, so `cargo test` and `cargo run` will no longer try to execute it directly. This change is only made for Emscripten, which outputs a .js file as the primary executable entry point, as opposed to other WebAssembly targets for which the .wasm file is the only output.
Problem
When using target wasm32-unknown-emscripten,
cargo test
correctly uses node to execute the .js test files, but also attempts to execute the output .wasm files with node. This was observed during the development of rust-lang/rust#63649, for example when running./x.py test src/libcore
.Steps
I've put some effort into fixing this myself, but I can't figure out where the best place to filter out the .wasm files would be. It would be simple to filter them out in cargo_test.rs, but it seems like it would be more elegant to filter them out or mark them as not executable somewhere in the compilation machinery. Pointers and suggestions would be much appreciated!
The text was updated successfully, but these errors were encountered: