WebAssembly / WebAssembly/WASI

WASM/WASI support for actix-web

Open
#591 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request S-inactive
Dominant language
Rust
Stars
5.8k
Forks
333
Avg merge
2d 13h
Merged PRs (30d)
3

Description

I have created RUST microservice using actix-web framework. When compiling to wasm32-wasi target, Got below error:

How to fix the error?

E:\code\RustTradingAppPot>cargo build --target wasm32-wasi
Compiling proc-macro2 v1.0.78
Compiling unicode-ident v1.0.12
Compiling autocfg v1.1.0
Compiling version_check v0.9.4
Compiling cfg-if v1.0.0
Compiling crossbeam-utils v0.8.19
Compiling pin-project-lite v0.2.13
Compiling typenum v1.17.0
Compiling libc v0.2.153
Compiling serde v1.0.196
Compiling once_cell v1.19.0
Compiling value-bag v1.7.0
Compiling slab v0.4.9
Compiling generic-array v0.14.7
Compiling lock_api v0.4.11
Compiling log v0.4.20
Compiling futures-core v0.3.30
Compiling parking_lot_core v0.9.9
Compiling wasi v0.11.0+wasi-snapshot-preview1
Compiling memchr v2.7.1
Compiling windows_x86_64_msvc v0.52.0
Compiling ahash v0.8.8
Compiling num-traits v0.2.18
Compiling quote v1.0.35
Compiling bytes v1.5.0
Compiling getrandom v0.2.12
Compiling windows-targets v0.52.0
Compiling syn v2.0.48
Compiling concurrent-queue v2.4.0
Compiling jobserver v0.1.28
Compiling futures-io v0.3.30
Compiling scopeguard v1.2.0
Compiling smallvec v1.13.1
Compiling cc v1.0.83
Compiling tracing-core v0.1.32
Compiling pkg-config v0.3.29
Compiling windows-sys v0.52.0
Compiling windows_x86_64_msvc v0.48.5
Compiling parking_lot v0.12.1
Compiling futures-sink v0.3.30
Compiling io-lifetimes v1.0.11
Compiling rustix v0.38.31
Compiling block-buffer v0.10.4
Compiling crypto-common v0.1.6
Compiling subtle v2.5.0
Compiling tinyvec_macros v0.1.1
Compiling windows-targets v0.48.5
Compiling digest v0.10.7
Compiling tinyvec v1.6.0
Compiling polling v2.8.0
Compiling itoa v1.0.10
Compiling rustix v0.37.27
Compiling unicode-bidi v0.3.15
Compiling paste v1.0.14
Compiling serde_json v1.0.113
Compiling mio v0.8.10
Compiling unicode-normalization v0.1.22
Compiling num-bigint v0.4.4
Compiling async-io v1.13.0
Compiling syn v1.0.109
Compiling percent-encoding v2.3.1
Compiling wasm-bindgen-shared v0.2.91
Compiling bitflags v2.4.2
Compiling tokio v1.36.0
Compiling event-listener v4.0.3
error: Only features sync,macros,io-util,rt,time are supported on wasm.
--> C:\Users.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.36.0\src\lib.rs:470:1
|
470 | compile_error!("Only features sync,macros,io-util,rt,time are supported on wasm.");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Compiling zerocopy v0.7.32
Compiling pin-utils v0.1.0
Compiling event-listener-strategy v0.4.0
Compiling windows-sys v0.48.0
Compiling rand_core v0.6.4
Compiling bumpalo v3.14.0
Compiling allocator-api2 v0.2.16
Compiling futures-task v0.3.30
Compiling ppv-lite86 v0.2.17
Compiling parking v2.2.0
Compiling thiserror v1.0.57
Compiling native-tls v0.2.11
Compiling rand_chacha v0.3.1
Compiling hashbrown v0.14.3
error: could not compile tokio (lib) due to previous error
warning: build failed, waiting for other jobs to finish...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported cargo build --target wasm32-wasi command and reviewing the Tokio feature error shown in the build output. Determine whether actix-web can support this target with its current dependencies; done means the compatibility requirements or implementation scope are documented and a supported build path is demonstrated.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
backend, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.