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

Wasm support #161

Closed
wehlutyk opened this issue Jul 18, 2018 · 5 comments
Closed

Wasm support #161

wehlutyk opened this issue Jul 18, 2018 · 5 comments

Comments

@wehlutyk
Copy link
Contributor

Hi!

There is discussion over at Frommi/miniz_oxide#34 (and previously Frommi/miniz_oxide#26) to support Wasm for miniz_oxide_c_api (on top of miniz_oxide) using the libc-stub hack from alexcrichton/wasm-sodium. From there, it's only a small addition to flate2-rs to make this crate compile to wasm32. Would you take that as PR, or would you rather wait until libc has an implementation for wasm32?

@alexcrichton
Copy link
Member

Sounds like a great idea to me!

I think we should enable the rust-backend feature by default on wasm to make sure flate2 builds by default on wasm as well!

@wehlutyk
Copy link
Contributor Author

wehlutyk commented Jul 18, 2018

Great!

Ah yes, the rust_backend thing would be nice. I currently have to surface that feature through client crates of flate2-rs such as lopdf.

Will be back once the miniz_oxide change is made.

Edit: realising that's already possible in my fork, I didn't know it was possible!

@wehlutyk
Copy link
Contributor Author

Correction: I can't find a way to set a default feature for a given target. Are you referring to rust-lang/cargo#1197?

@alexcrichton
Copy link
Member

Nah we'd just hardcode this in the code, an unconditional target-specific dependency would be added for wasm and then on wasm the code would unconditionally (regardless of features) use miniz_oxide

@alexcrichton
Copy link
Member

This should be implemented now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants