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

Sysinfo plugin does not compile without multi_threaded feature #13957

Open
Friz64 opened this issue Jun 20, 2024 · 1 comment · May be fixed by #13964
Open

Sysinfo plugin does not compile without multi_threaded feature #13957

Friz64 opened this issue Jun 20, 2024 · 1 comment · May be fixed by #13964
Labels
A-Tasks Tools for parallel and async work C-Bug An unexpected or incorrect behavior C-Regression Functionality that used to work but no longer does. Add a test for this! P-Compile-Failure A failure to compile Bevy apps

Comments

@Friz64
Copy link
Contributor

Friz64 commented Jun 20, 2024

Bevy version

Any version after #13693

What you did

Compiled bevy without the multi_threaded feature, but with the sysinfo_plugin feature

What went wrong

error[E0308]: mismatched types
    --> crates/bevy_diagnostic/src/system_information_diagnostics_plugin.rs:147:30
     |
147  |             tasks.tasks.push(task);
     |                         ---- ^^^^ expected `Task<SysinfoRefreshData>`, found `FakeTask`
     |                         |
     |                         arguments to this method are incorrect
     |
     = note: expected struct `Task<SysinfoRefreshData>`
                found struct `FakeTask`
note: method defined here
    --> /home/friz64/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:1993:12
     |
1993 |     pub fn push(&mut self, value: T) {
     |            ^^^^
@Friz64 Friz64 added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jun 20, 2024
@bugsweeper
Copy link
Contributor

That because single_threaded_task_pool::TaskPool::spawn returns FakeTask which can't contain future result, because it's just empty struct, but actualy for non wasm (for wasm it indeed can't do better, because uses wasm spawn method which allows only futures which outputs only empty tuple) it spawns future, gets it's task, waits while executor finishes, and return nothing (FakeTask), throwing away _task with result! I think should be two spawn implementations for wasm (returning empty FakeTask) and for non-wasm which would return ready result T.

@janhohenheim janhohenheim added C-Regression Functionality that used to work but no longer does. Add a test for this! A-Tasks Tools for parallel and async work P-Compile-Failure A failure to compile Bevy apps and removed S-Needs-Triage This issue needs to be labelled labels Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Tasks Tools for parallel and async work C-Bug An unexpected or incorrect behavior C-Regression Functionality that used to work but no longer does. Add a test for this! P-Compile-Failure A failure to compile Bevy apps
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants