bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
34.4k stars 3.36k forks source link

Compiler error if `sysinfo_plugin` feature is enabled, but `multi_threaded` is not. #14186

Closed inodentry closed 2 weeks ago

inodentry commented 3 weeks ago

Bevy version

0.14.0

What you did

Enabled the sysinfo_plugin cargo feature when depending on bevy with no default features.

In Cargo.toml:

[dependencies.bevy]
version = "0.14.0"
default-features = false
features = [ "sysinfo_plugin"]

What went wrong

Compiler error in bevy_diagnostic:

    Checking bevy_diagnostic v0.14.0
error[E0308]: mismatched types
    --> /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_diagnostic-0.14.0/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`

Additional Information

Enabling the multi_threaded feature allows it to compile.

Basically, the sysinfo diagnostic is broken in single-threaded builds of bevy.

torsteingrindvik commented 3 weeks ago

Duplicate of #13957 I think