-
Notifications
You must be signed in to change notification settings - Fork 409
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
Add docs and actionable error message for failed wasm-opt executions #766
Add docs and actionable error message for failed wasm-opt executions #766
Conversation
@torch2424 if you have time could you see if this branch lets you build w/o changes to your config? |
Yep! It works! This is half for my future reference and for you but: I went ahead and re-enabled wasm-opt in the Tried to build with the latest wasm-pack master, and it fails: Then I cloned down your fork (I think it's your fork? Let me know if it isn't), switched to your branch, and I just got the warning and I was able to build 😄 |
Awesome! Thanks for checking that out for me :) |
d678121
to
bb826e2
Compare
tests/all/wasm_opt.rs
Outdated
@@ -147,7 +147,7 @@ fn custom_args() { | |||
.arg("build") | |||
.assert() | |||
.stderr(predicates::str::contains("--not-accepted-argument")) | |||
.failure(); |
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.
this pr changes the expected behavior so i changed this failure to a success. i've talked with @ashleygwilliams about this change and we think it makes sense to build and warn if wasm-opt
fails since it's not a necessary build step. That being said, I could see how you might want to make it fail instead of warn if it was custom arguments that failed and not the default wasm-opt
enablement that failed.
cc @alexcrichton - this is related to #625
I could see this being a problem for people who have |
@Pauan @fitzgen @alexcrichton do you have thoughts on this being a breaking change? and/or what behavior you'd want to see? |
I'm not really comfortable with this change. Right now, wasm-opt is only run in release builds, and the point of release builds is to be as optimized as possible. So if wasm-opt fails, then the file size and performance will be degraded. That's something important to notice and fix. And warnings can get lost easily and overlooked, leading to accidental performance regressions. My solution to this problem is: if there's a bug causing wasm-opt to error, I'd rather fix that bug. And if users don't want to run wasm-opt at all, I'm fine with providing a flag or option to toggle that. But I think the default should be to run wasm-opt (in release mode), and hard error if something goes wrong. |
bb826e2
to
e8f27f2
Compare
I've updated this PR to include docs changes and a (hopefully) more helpful error message. Happy to change the wording of either |
cc @Pauan - ultimately i think you are right- do you think the error message and docs help? |
mergin |
In light of our upcoming release and the reported bug regarding
wasm-opt
on Linux, this PR updates the docs and includes a helpful error message on failedwasm-opt
executions.Output looks like this: