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

Library doesn't compile on wasm #12

Closed
1 task done
luca-della-vedova opened this issue Aug 2, 2024 · 1 comment
Closed
1 task done

Library doesn't compile on wasm #12

luca-della-vedova opened this issue Aug 2, 2024 · 1 comment

Comments

@luca-della-vedova
Copy link
Member

Before proceeding, is there an existing issue or discussion for this?

Description

As found in open-rmf/rmf_site#233 (comment), the library currently doesn't compile in wasm blocking its usage for rmf_site.

Compile error:

error[E0308]: mismatched types
   --> /home/runner/.cargo/git/checkouts/bevy_impulse-30348e30aae85d7f/ee7858a/src/callback.rs:144:84
    |
144 |         OperateTask::<_, Streams>::new(task_id, session, self.source, self.target, task, None, sender)
    |         ------------------------------ arguments to this function are incorrect    ^^^^ expected `Task<_>`, found `FakeTask`
    |
    = note: expected struct `Task<_>`
               found struct `bevy_tasks::single_threaded_task_pool::FakeTask`
note: associated function defined here
   --> /home/runner/.cargo/git/checkouts/bevy_impulse-30348e30aae85d7f/ee7858a/src/operation/operate_task.rs:89:19
    |
89  |     pub(crate) fn new(
    |                   ^^^
...
94  |         task: BevyTask<Response>,
    |         ------------------------

   Compiling bevy_stl v0.12.0
error[E0308]: mismatched types
   --> /home/runner/.cargo/git/checkouts/bevy_impulse-30348e30aae85d7f/ee7858a/src/impulse/map.rs:182:51
    |
181 |         OperateTask::<_, Streams>::new(
    |         ------------------------------ arguments to this function are incorrect
182 |             task_source, session, source, target, task, None, sender,
    |                                                   ^^^^ expected `Task<_>`, found `FakeTask`
    |
    = note: expected struct `Task<_>`
               found struct `bevy_tasks::single_threaded_task_pool::FakeTask`
note: associated function defined here
   --> /home/runner/.cargo/git/checkouts/bevy_impulse-30348e30aae85d7f/ee[785](https://github.com/open-rmf/rmf_site/actions/runs/10213662123/job/28259507753?pr=233#step:7:786)8a/src/operation/operate_task.rs:89:19
    |
89  |     pub(crate) fn new(
    |                   ^^^
...
94  |         task: BevyTask<Response>,
    |         ------------------------

error[E0308]: mismatched types
   --> /home/runner/.cargo/git/checkouts/bevy_impulse-30348e30aae85d7f/ee7858a/src/operation/operate_map.rs:202:51
    |
201 |         OperateTask::<_, Streams>::new(
    |         ------------------------------ arguments to this function are incorrect
202 |             task_source, session, source, target, task, None, sender,
    |                                                   ^^^^ expected `Task<_>`, found `FakeTask`
    |
    = note: expected struct `Task<_>`
               found struct `bevy_tasks::single_threaded_task_pool::FakeTask`
note: associated function defined here
   --> /home/runner/.cargo/git/checkouts/bevy_impulse-30348e30aae85d7f/ee7858a/src/operation/operate_task.rs:89:19
    |
89  |     pub(crate) fn new(
    |                   ^^^
...
94  |         task: BevyTask<Response>,
    |         ------------------------

error[E0308]: mismatched types
   --> /home/runner/.cargo/git/checkouts/bevy_impulse-30348e30aae85d7f/ee7858a/src/service/async_srv.rs:242:43
    |
241 |     OperateTask::<_, Streams>::new(
    |     ------------------------------ arguments to this function are incorrect
242 |         task_id, session, source, target, task, blocker, sender,
    |                                           ^^^^ expected `Task<_>`, found `FakeTask`
    |
    = note: expected struct `Task<_>`
               found struct `bevy_tasks::single_threaded_task_pool::FakeTask`
note: associated function defined here
   --> /home/runner/.cargo/git/checkouts/bevy_impulse-30348e30aae85d7f/ee7858a/src/operation/operate_task.rs:89:19
    |
89  |     pub(crate) fn new(
    |                   ^^^
...
94  |         task: BevyTask<Response>,
    |         ------------------------

For more information about this error, try `rustc --explain E0308`.
error: could not compile `bevy_impulse` (lib) due to 4 previous errors
@mxgrey
Copy link
Contributor

mxgrey commented Aug 3, 2024

WASM is working now, as long as the single_threaded_async feature is active.

I've added a WASM CI test to the CI issue #4 and a new issue to document the feature #15 so I think we can close this.

@mxgrey mxgrey closed this as completed Aug 3, 2024
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

2 participants