Skip to content

bug: object_store_opendal does not compile on wasm32-unknown-unknown #5525

@XiangpengHao

Description

@XiangpengHao

Describe the bug

Doesn't compile on my machine with wasm32-unknown-unknown

Steps to Reproduce

cd integrations/object_store
cargo build  --release --target wasm32-unknown-unknown --features "send_wrapper"

Will see:

error[E0277]: `dyn futures::Future<Output = ()>` cannot be sent between threads safely
    --> /opendal/core/src/types/execute/executors/tokio_executor.rs:28:42
     |
28   |         let _handle = tokio::task::spawn(f);
     |                       ------------------ ^ `dyn futures::Future<Output = ()>` cannot be sent between threads safely
     |                       |
     |                       required by a bound introduced by this call
     |
     = help: the trait `std::marker::Send` is not implemented for `dyn futures::Future<Output = ()>`, which is required by `Pin<Box<dyn futures::Future<Output = ()>>>: std::marker::Send`
     = note: required for `Unique<dyn futures::Future<Output = ()>>` to implement `std::marker::Send`
note: required because it appears within the type `Box<dyn futures::Future<Output = ()>>`

Expected Behavior

Should compile.

I saw some special handling on wasm + Send bound, but I have not fully understand why we need them yet.

Additional Context

No response

Are you willing to submit a PR to fix this bug?

  • Yes, I would like to submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions