-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
wasm32 target without getrandom/js
feature
#267
Comments
Hmm, or it could also be the |
Hey, thanks for reporting this issue. How are random numbers supposed to work for non-JS WASM targets? Also HTTP clients and timestamps, for that matter.
Yeah, I'd expect similar issues with both crates. See recent discussion in chronotope/chrono#1301 about disabling It seems like |
My usecase is that I'm implementing the host functions for the operations I want to support (for example executing a HTTP request, oauth2 already supports integrating with custom HTTP clients), so I would expose a random and time implementations as well. This is just a personal project and the host is a full Rust host, basically I'm reimplementing parts of WASI.
True, compile error is definitely preferable. Unfortunately now it is a runtime error for me because the import fails when trying to link the WASM module at runtime. |
Gotcha, thanks for that context. We could address the Despite Exposing a feature flag would allow the behavior to respect SemVer guarantees. It sounds like the The Line 93 in e2e8a62
Fixing that would require either changing the API to require a I think your best bet may be to vendor the |
Thanks for the discussion. I agree this is a niche usecase and does not warrant the maintenance burden. I was trying to avoid vendoring the dependencies and thought I'd ask, but you are right that it seems like the most sensible solution. Other than that, since this is nothing serious I could also switch to WASI and stub out the host functions I don't use. The main reason why I haven't done that here is that I've done that on another project already 😅 I've also been trying to use WASM multivalue, which forced me into nightly and Oh well. I'll close the issue, thanks for considering. |
Hi, is it possible to remove the
js
feature flag passed togetrandom
dependency onwasm32
targets by default?oauth2-rs/Cargo.toml
Line 65 in e2e8a62
I'm trying to use oauth2 in a wasm32 environment that is not running under a javascript host and so I am getting import errors (for example
unknown import: `__wbindgen_placeholder__::__wbindgen_describe` has not been defined
) when running the module under wasmtime (since it depends on some bindgen imports that I'm not providing).getrandom crate also recommends not setting the feature in library crates, to leave the choice for the final dependent.
The text was updated successfully, but these errors were encountered: