async-email / async-smtp

Apache License 2.0
60 stars 13 forks source link

Can this library run in WASM? #23

Open amaury1093 opened 4 years ago

amaury1093 commented 4 years ago

I'm looking to deploy my code to Cloudfare workers, and it uses this library. I was wondering, do you plan to support WASM as build target?

I just tried now, and had a small error, due to the hostname dependency (maybe others?).

error: Unsupported target OS! Create an issue: https://github.com/svartalf/hostname/issues/new
  --> /Users/amaurymartiny/.cargo/registry/src/github.com-1ecc6299db9ec823/hostname-0.3.1/src/lib.rs:81:9
   |
81 |         compile_error!("Unsupported target OS! Create an issue: https://github.com/svartalf/hostname/issues/new");
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0433]: failed to resolve: use of undeclared type or module `sys`
   --> /Users/amaurymartiny/.cargo/registry/src/github.com-1ecc6299db9ec823/hostname-0.3.1/src/lib.rs:105:5
    |
105 |     sys::get()
    |     ^^^ use of undeclared type or module `sys`

error: aborting due to 2 previous errors

We could return localhost in wasm.