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

Build for WASM #386

Open
amaury1093 opened this issue May 30, 2020 · 2 comments
Open

Build for WASM #386

amaury1093 opened this issue May 30, 2020 · 2 comments

Comments

@amaury1093
Copy link
Member

amaury1093 commented May 30, 2020

What does it take to make this lib compile to WASM?

Rationale: since browsers allow TCP connections, this should work in browser. I'd also like to try deploying this to cloudfare workers.

Right now, some deps don't compile to WASM, running wasm-pack build in core/ gives:

➜  core git:(master) wasm-pack build
[INFO]: 🎯  Checking for the Wasm target...
[INFO]: 🌀  Compiling to Wasm...
   Compiling cfg-if v0.1.10
   Compiling log v0.4.8
   Compiling wasm-bindgen-shared v0.2.62
   Compiling bumpalo v3.3.0
   Compiling futures-core v0.3.5
   Compiling futures-sink v0.3.5
   Compiling wasm-bindgen v0.2.62
   Compiling slab v0.4.2
   Compiling once_cell v1.4.0
   Compiling lazy_static v1.4.0
   Compiling pin-utils v0.1.0
   Compiling futures-io v0.3.5
   Compiling pkg-config v0.3.17
   Compiling cc v1.0.54
   Compiling smallvec v1.4.0
   Compiling pin-project-lite v0.1.5
   Compiling matches v0.1.8
   Compiling percent-encoding v2.1.0
   Compiling send_wrapper v0.4.0
   Compiling foreign-types-shared v0.1.1
   Compiling ppv-lite86 v0.2.8
   Compiling openssl v0.10.29
   Compiling gimli v0.21.0
   Compiling async-task v3.0.0
   Compiling iovec v0.1.4
   Compiling nodrop v0.1.14
   Compiling rustc-demangle v0.1.16
   Compiling match_cfg v0.1.0
   Compiling object v0.19.0
   Compiling bytes v0.5.4
   Compiling openssl-probe v0.1.2
   Compiling static_assertions v0.3.4
   Compiling ascii_utils v0.9.3
   Compiling quick-error v1.2.3
   Compiling linked-hash-map v0.5.3
   Compiling itoa v0.4.5
   Compiling base64 v0.11.0
   Compiling bufstream v0.1.4
   Compiling hostname v0.1.5
   Compiling net2 v0.2.34
error[E0432]: unresolved import `sys`
  --> /Users/amaurymartiny/.cargo/registry/src/github.com-1ecc6299db9ec823/net2-0.2.34/src/tcp.rs:18:5
   |
18 | use sys::c;
   |     ^^^ maybe a missing crate `sys`?
-- snip --
@bcomnes
Copy link

bcomnes commented May 19, 2022

Being able to call this library from a server side node or deno codebase as a wasm library would be great.

@amaury1093
Copy link
Member Author

Being able to call this library from a server side node or deno codebase as a wasm library would be great.

For server-side node code, there's also an alternative: #1105

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

No branches or pull requests

2 participants