-
Notifications
You must be signed in to change notification settings - Fork 254
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
feat: New data-threads
attribute for rust assets.
#868
Conversation
This enables the `threads`, `bulk-memory`, and `mutable-globals` options in `wasm-opt`, which if absent can result in `wasm-opt` failing to optimize wasm modules compiled with threading features. Fixes trunk-rs#866.
It surprised me that the existing So evidently there is some difference between my wasm module and the wasm module produced by What's really confusing is that when I take the But regardless of all that confusion, |
Thanks for the PR. I think it's good to have control over those settings. However, I'd prefer that one can enable them independently. So maybe an enum with flags that can be enabled for wasm-opt? As maybe someone wants to enable some of them without "threads" in mind. |
At that point, what do you think of just having a |
Huh. I also can't see anything obvious. Is that failing code available somewhere? My own little project with all flags enabled has some 330 dependencies on wasm, among them are currently embassy-rs, which is doing same nasty linker abuses, but it still builds just fine with trunk. Do you depend on wasm-bindgen? I've seen that cause issues, which I solved by defining a higher-than-default |
I cant seem to be able to go back to an old version of wasm_opt, if I switch back to an old version in Trunk.toml it seems to ignore that and go ahead with the already installed 116. So sorry, can't test that. |
I would say thats prefferable over mapping everything. I was also at some point thinking about trying the |
I figured out how to reproduce the problem. Simply add the following to [profile.release]
strip = true And if you remove
Note, adding Does this perhaps indicate a problem in |
I experimented around with a few settings to make my WASM binary smaller in the beginning, IIRC stripping had no impact if I also used wasm-opt. I think wasm-opt is stripping on its own by default, this is also implied by the text for So in that case, unless you observed something different, you could probably also just get rid of that. |
My application also works fine if I add strip=true. It must depend on other factors as well. Didn't test the example on my laptop yet. Have you tried this stuff with wasm-opt 118? And/or wasm-bindgen 0.2.93 |
Same issue in
|
Sounds like a great idea |
I have to excuse myself. That was late at night, and I forgot not actually test in release mode. With release mode I get the same error. Sorry for wasting your time. |
Closing this in favor of putting up a PR for custom |
Is that work in progress or waiting for a contribution? |
It was going to be WIP by me but I became too busy to get around to it. |
@101100 thanks for asking for an update, I forgot to check up on this myself. Are you working on this right now? Otherwise I might give it a shot myself. If you did already work some on this, perhaps you could also open a WIP PR so that I can follow that, and see if progress stalls. |
@9SMTM6 I didn't get a chance to start on this on the weekend, so you would not be duplicating effort if you started on it. |
This enables the
threads
,bulk-memory
, andmutable-globals
options inwasm-opt
, which if absent can result inwasm-opt
failing to optimize wasm modules compiled with threading features.Fixes #866.