-
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
Mark Emscripten's .wasm files auxiliary #7476
Conversation
This fixes rust-lang#7471 and fixes rust-lang#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.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@@ -253,10 +255,15 @@ impl TargetInfo { | |||
|
|||
// See rust-lang/cargo#4535. | |||
if target_triple.starts_with("wasm32-") && crate_type == "bin" && suffix == ".js" { | |||
let flavor = if target_triple.contains("emscripten") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to skip the emscripten
check here, I think wasm32 targets that primarily emit a js file are always emscripten targets
@bors: r+ |
📌 Commit c8c6839 has been approved by |
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.
☀️ Test successful - checks-azure |
Update Cargo To pull rust-lang/cargo#7482 List of merged PRs: - Fix wrong directories in PATH on Windows (rust-lang/cargo#7482) - Update SPDX list to 3.6 (rust-lang/cargo#7481) - Mark Emscripten's .wasm files auxiliary (rust-lang/cargo#7476) - Update `curl-sys` dependency requirement (rust-lang/cargo#7464) - add dependencies for `pkg-config` (rust-lang/cargo#7443) - Removing hash from output files when using MSVC (rust-lang/cargo#7400) - Disable preserving mtimes on archives (rust-lang/cargo#7465) - Removed redundant borrow (rust-lang/cargo#7462) - Public dependency refactor and re-allow backjumping (rust-lang/cargo#7361) - unify the quote in Cargo.toml (rust-lang/cargo#7461)
Specifically to pick up rust-lang/cargo#7476, which is necessary to run test suites for the wasm32-unknown-emscripten target.
This fixes #7471 and fixes #7255 by preventing the .wasm file from
being treated as an executable binary, so
cargo test
andcargo 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.