-
Notifications
You must be signed in to change notification settings - Fork 106
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
Fails to build to wasm32-unknown-unknown
target
#91
Comments
Quite similar and related to #23, probably. I don't really know much about wasm ecosystem and conventions so it would be really helpful if somebody contributed a reasonable design/semantics/implementation here. |
I think dynamic loading of WASM is a completely different concept and out of scope of libloading. There is also some consideration on dynamic linking of wasm modules: https://github.com/WebAssembly/module-linking/blob/main/proposals/module-linking/Explainer.md Edit: wasmtime may be what you needed: https://docs.wasmtime.dev/examples-rust-linking.html Nevertheless, maybe you can describe what you want to achieve here concretely and then one can point you in the right direction. |
I got similar problem running
then I found in code: Lines 48 to 53 in 2173d71
does it mean can I just skip this in my building since the code related to libloading is actually not used while compiling to wasm? updated: got a temp solution of disabling libloading conditionally in |
What about a fallback |
I'm not currently targeting WASM platforms often enough to tell if that would be an appropriate approach. I know the standard library does it for wasm, but it is also a fairly controversial thing that Rust has done for that target in particular. |
I guess it is counter to the (rather core) idea of failing to compile rather than failing to run |
personally my main concern is the error messages, which were supposed to tell me what's the problem and what to do next, rather than leaving me at a loss only to Google for luck. |
Maybe instead of a stub fallback, a |
Ah, I tried implementing this, but the compiler's output is now all the previous errors alongside the new "unsupported platform" one, instead of just the unsupported one on its own as I intended. How about a stub fallback which is guarded by the |
Hm, I'm not sure a stub fallback is necessary after all. Instead you should be able to Sorry for the late response here. |
Hey all, I made some changes in #98 which may help with this significantly. Could somebody try patching this in their failing projects and see if it helps in any way? You can do it by adding a following section to your [patch.crates-io]
libloading = { git = 'https://github.com/nagisa/rust_libloading', branch = 'nagisa/072' } |
tried in my project, now I can use your fork of related lines of mine(but I modified at local disk), |
Yes, the intended result is that |
libloading 0.7.2 onwards should build fine on wasm32-unknown-unknown. |
I'm trying to build to
wasm32-unknown-unknown
target but I get several errors thatimp
is not declaredThe text was updated successfully, but these errors were encountered: