Skip to content

Avoid tokio feature rt-multi-thread when building for emscripten wasm32? #80

Description

@kylebarron

Currently we require tokio with the rt, rt-multi-thread and time features:

[dependencies.tokio]
version = "1.13"
features = ["rt", "rt-multi-thread", "time"]
optional = true

When building for pyodide and emscripten wasm, I get a compile error:

error: Only features sync,macros,io-util,rt,time are supported on wasm.
   --> /Users/kyle/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.50.0/src/lib.rs:475:1
    |
475 | compile_error!("Only features sync,macros,io-util,rt,time are supported on wasm.");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I'm curious if pyo3-async-runtimes would work in pyodide if the rt-multi-thread feature were removed.

We should be able to try

[target.'cfg(not(target_family = "wasm"))'.dependencies.tokio]
version = "1.13"
features = ["rt", "rt-multi-thread", "time"]
optional = true

[target.'cfg(target_family = "wasm")'.dependencies.tokio]
version = "1.13"
features = ["rt", "time"]
optional = true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions