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

Mark Emscripten's .wasm files auxiliary #7476

Merged
merged 3 commits into from
Oct 4, 2019

Conversation

tlively
Copy link
Contributor

@tlively tlively commented Oct 3, 2019

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.

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.
@rust-highfive
Copy link

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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 3, 2019
@@ -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") {
Copy link
Member

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

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Collaborator

bors commented Oct 4, 2019

📌 Commit c8c6839 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 4, 2019
@bors
Copy link
Collaborator

bors commented Oct 4, 2019

⌛ Testing commit c8c6839 with merge 0fe1638...

bors added a commit that referenced this pull request Oct 4, 2019
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.
@bors
Copy link
Collaborator

bors commented Oct 4, 2019

☀️ Test successful - checks-azure
Approved by: alexcrichton
Pushing 0fe1638 to master...

@bors bors merged commit c8c6839 into rust-lang:master Oct 4, 2019
bors added a commit to rust-lang/rust that referenced this pull request Oct 8, 2019
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)
tlively added a commit to tlively/rust that referenced this pull request Oct 8, 2019
Specifically to pick up rust-lang/cargo#7476,
which is necessary to run test suites for the
wasm32-unknown-emscripten target.
@ehuss ehuss added this to the 1.40.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cargo test tries to execute .wasm files Error running tests in wasm32-unknown-emscripten environment.
5 participants