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 wasm32-unknown-unknown ? #888

Closed
andrewzah opened this issue Feb 7, 2019 · 3 comments
Closed

Build for wasm32-unknown-unknown ? #888

andrewzah opened this issue Feb 7, 2019 · 3 comments

Comments

@andrewzah
Copy link

Version

tokio-executor v0.1.6 (dependency of reqwest v0.9.9)

Platform

Darwin mbp.local 18.2.0 Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:46 PST 2018; root:xnu-4903.231.4~2/RELEASE_X86_64 x86_64

but compiling for wasm32-unknown-unknown

Subcrates

tokio-executor

Description

Compiling this fails when targeting wasm32-unknown-unknown. Are there any plans to address this (if possible)?

   Compiling tokio-executor v0.1.6
error[E0432]: unresolved import `sys`
  --> /Users/andrewzah/.cargo/registry/src/github.com-1ecc6299db9ec823/net2-0.2.33/src/tcp.rs:18:5
   |
18 | use sys::c;
   |     ^^^ maybe a missing `extern crate sys;`?

error[E0432]: unresolved import `sys`
  --> /Users/andrewzah/.cargo/registry/src/github.com-1ecc6299db9ec823/net2-0.2.33/src/udp.rs:18:5
   |
18 | use sys::c;
   |     ^^^ maybe a missing `extern crate sys;`?

error[E0432]: unresolved import `sys`
  --> /Users/andrewzah/.cargo/registry/src/github.com-1ecc6299db9ec823/net2-0.2.33/src/socket.rs:22:5
   |
22 | use sys;
   |     ^^^ no `sys` in the root

error[E0432]: unresolved import `sys`
  --> /Users/andrewzah/.cargo/registry/src/github.com-1ecc6299db9ec823/net2-0.2.33/src/socket.rs:23:5
   |
23 | use sys::c;
   |     ^^^ maybe a missing `extern crate sys;`?

Note that tokio-rs/tokio-core#327 by saschagrunert existed but was archived.

@davidbarsky
Copy link
Member

Are there any plans to address this?

I can't speak for Carl or anybody else, but getting Tokio to compile to wasm32-unknown-unknown would be a big lift, and I don't know if it make sense to get Tokio compiling for that target. Being able to move away from libc would be a win in view, a lot of things Tokio depends on aren't defined in WASM at the moment. However, the wasm_bindgen_futures crate might be a reasonable thing to use in the meantime, especially if you're targeting Node.js/browsers.

I'll close this issue in the meantime. Feel free to open a new one if you encounter any issues.

@r-ocket
Copy link

r-ocket commented Sep 28, 2023

@davidbarsky has the state of things changed from when this was closed? would it be more feasible now to get tokio to compile for wasm32-unknown-unknown? I think some browsers now support wasm threads (even tho it's still only at proposal stage)

@Darksonn
Copy link
Contributor

Not much has happened for a while. We don't have threading support. You can find up-to-date information in the documentation: https://docs.rs/tokio/latest/tokio/#wasm-support

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

No branches or pull requests

4 participants