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

Fix wasm-opt regression #187

Merged
merged 6 commits into from
Feb 22, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve error message on wasm-opt error
  • Loading branch information
cmichi committed Feb 19, 2021
commit f888044a44457e8d2f24f2a1c7aa723058f2f766
12 changes: 10 additions & 2 deletions src/cmd/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use std::{
};

#[cfg(not(feature = "binaryen-as-dependency"))]
use std::process::Command;
use std::{process::Command, str};

use crate::{
crate_metadata::CrateMetadata,
Expand Down Expand Up @@ -359,7 +359,15 @@ fn do_optimization(
.output()?;

if !output.status.success() {
anyhow::bail!("wasm-opt optimization failed");
let err = str::from_utf8(&output.stderr)
.expect("cannot convert stderr output of wasm-opt to string")
.trim();
anyhow::bail!(
"The wasm-opt optimization failed.\n\
A possible source of error could be that you have an outdated binaryen package installed.\n\n\
The error which wasm-opt returned was: \n{}",
err
);
}
Ok(())
}
Expand Down