Closed zavalyshyn closed 1 year ago
Hey @zavalyshyn. I haven't done much with WebAssembly other than downloading an e-book and reading the 1st chapter! It does seem a worth goal to support it, but I suppose, at the moment, we're locked into what we can do with the dependencies (Paho C and OpenSSL).
Out of curiosity, have you tried it without SSL? Something like:
[dependencies]
paho-mqtt = { version = "0.11", default-features = false, features = ["bundled"] }
If that worked, you would only be able to connect with TCP or unsecure WebSockets, but it might be a starting point. If it doesn't work, it would indicate a lot more trouble moving forward.
@fpagliughi thanks for a suggestion. I've just tried that and the build still failed but this time not not due to underlying openssl dependencies but due to paho.mqtt.c
code using pthread.h header files for logging. Unfortunately, threads are not yet supported by wasi-sdk, which I'm using to build for wasm32-wasi target.
Is there a flag I could pass to build with no threads support?
Sadly, no. The C lib spawns a few threads to do all of the I/O for the library.
Sorry. Looks like there's nothing we can do here at this point.
Hi,
First of all, thanks for making this library available for Rust developers. I can successfully compile and run it on a standard Linux machine.
I wonder if there are plans for WebAssembly support, or more specifically,
wasm32-unknown-unknown
build target.Right now my attempts to compile the code using paho.mqtt.rust fail because of the openssl library that fails to cross-compile for the wasm32 target.
Any ideas on what I can try to make it work?
Thanks
Just in case I show my Cargo.toml file