-
Notifications
You must be signed in to change notification settings - Fork 259
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
Build failure with Rust 1.82.0 and bundled wasm-opt #904
Comments
I investigated a few versions of I'm not sure how to make this happen when using trunk. So perhaps this is related to #866? |
It might make sense to update the default versions for the different tools: Lines 98 to 105 in 306fa0b
Also #901 might help. |
After some more experimentation, This problem seems specific to wasm-bindgen/wasm-bindgen-cli 0.2.95 (0.2.93 works; 0.2.94 was yanked but I think it's also broken). But the problem is only triggered by a build with rust 1.82.0. I don't think it matters what Trunk's default wasm-bindgen version is-- the version of |
I have the same problem
[parse exception: invalid code after misc prefix: 17 (at 0:564976)] rustc 1.82.0 (f6e511eec 2024-10-15) |
As you're using trunk 0.21.4, you should be able to use the new |
Or maybe we need to bump the default version of wasm-opt. |
Also note that this will be fixed in the next release of wasm-bindgen, which won't emit |
I had this issue and resolved it for myself with the following:
I admit I do not know what bulk memory or |
Thanks for the summary. That is super helpful. Now that we have internal APIs for the tools in place, would it make sense to auto-enable |
Note that rustc doesn't enable bulk memory by default, so to me the safest default would be to track whatever rustc is doing. Enabling bulk memory instructions by default could affect compatibility with existing runtimes. The reason we're having problems with rust 1.82.0 is because of a bug in wasm-bindgen 0.2.94-0.2.95: wasm-bindgen notices that rustc has enabled new target features, and accidentally enables bulk memory on its output as a side-effect. This will no longer be the case in wasm-bindgen 0.2.96. |
What should happen in the long term? A few possibilities I can think of:
Is Footnotes
|
Thanks for this thread! It's super helpful. Is it possible to specify default wasm-opt version through the configuration file? From a quick look at the documentation and code it appears not, but maybe I missed something. For others, this might be helpful: I managed to get things working by cloning the trunk, then patching trunk/src/tools.rs changing the default version to One thing I noted is |
I guess the answer to all of this is: PRs welcome 😉 |
@troelsfr the wasm-opt version is configurable already through Trunk.toml https://github.com/trunk-rs/trunk/blob/4c9d85f6f04a31a272c71db8df12e142c76311fb/Trunk.toml I'm using: [tools]
wasm_opt = "version_119" and this on my html: <link data-trunk rel="rust" data-bin="some-app-name" data-wasm-opt="z"
data-wasm-opt-params="--enable-bulk-memory" /> |
Sorry for not reading the docs careful enough! And thanks a lot for pointing me to the right place! |
After upgrading from Rust 1.81 to 1.82 I discovered that a particular wasm/trunk project no longer builds. It always fails with:
I built a minimized project that demonstrates the issue here: https://github.com/eric-seppanen/wasm_test_2024
This seems to be a wasm-opt issue, but since wasm-opt is bundled with trunk by default, perhaps it would be a good idea to ship a newer version?
The text was updated successfully, but these errors were encountered: