Disabling default features causes app with DefaultPlugins to exit
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## Bevy version
0.10.0
## What you did
I wrote a simple little reproducible program called `eager-hello`:
```rust
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_system(|| println!("hello"))
.run();
```
With the following `Cargo.toml`, the program is not as eager as I had hoped:
```
[dependencies.bevy]
version = "0.10.0"
default-features = false
```
## What went wrong
The expected output would be:
```
hello
hello
hello
...
```
Unfortunately I only get:
```
hello
```
## Additional information
If I remove the `default-features = false` from `Cargo.toml` the program works as expected.
However, I want a simple program with as few dependencies as possible.
I've tried disabling the window exit condition:
```rust
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins.set(WindowPlugin {
primary_window: None,
exit_condition: bevy::window::ExitCondition::DontExit,
close_when_requested: false,
}))
.add_system(|| println!("hello"))
.run();
}
```
I've tried disabling the window plugin:
```rust
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins.build().disable::())
.add_system(|| println!("hello"))
.run();
```
I tried to get further insight by looking at the logging, but nothing seems obvious for why the app exits after one update cycle.
Here is the log from where the WindowPlugin was disabled:
```
2023-03-16T22:34:41.104978Z DEBUG bevy_app::plugin_group: added plugin: bevy_core::TaskPoolPlugin
2023-03-16T22:34:41.105039Z DEBUG bevy_app::app: added plugin: bevy_core::TaskPoolPlugin
2023-03-16T22:34:41.105230Z TRACE bevy_core::task_pool_options: Assigning 8 cores to default task pools
2023-03-16T22:34:41.105256Z TRACE bevy_core::task_pool_options: IO Threads: 2
2023-03-16T22:34:41.105403Z TRACE bevy_core::task_pool_options: Async Compute Threads: 2
2023-03-16T22:34:41.105526Z TRACE bevy_core::task_pool_options: Compute Threads: 4
2023-03-16T22:34:41.105817Z DEBUG bevy_app::plugin_group: added plugin: bevy_core::TypeRegistrationPlugin
2023-03-16T22:34:41.105847Z DEBUG bevy_app::app: added plugin: bevy_core::TypeRegistrationPlugin
2023-03-16T22:34:41.107118Z DEBUG bevy_app::plugin_group: added plugin: bevy_core::FrameCountPlugin
2023-03-16T22:34:41.107157Z DEBUG bevy_app::app: added plugin: bevy_core::FrameCountPlugin
2023-03-16T22:34:41.107285Z DEBUG bevy_app::plugin_group: added plugin: bevy_time::TimePlugin
2023-03-16T22:34:41.107304Z DEBUG bevy_app::app: added plugin: bevy_time::TimePlugin
2023-03-16T22:34:41.107570Z DEBUG bevy_app::plugin_group: added plugin: bevy_transform::TransformPlugin
2023-03-16T22:34:41.107593Z DEBUG bevy_app::app: added plugin: bevy_transform::TransformPlugin
2023-03-16T22:34:41.107762Z DEBUG bevy_app::app: added plugin: bevy_hierarchy::valid_parent_check_plugin::ValidParentCheckPlugin
2023-03-16T22:34:41.108071Z DEBUG bevy_app::plugin_group: added plugin: bevy_hierarchy::HierarchyPlugin
2023-03-16T22:34:41.108096Z DEBUG bevy_app::app: added plugin: bevy_hierarchy::HierarchyPlugin
2023-03-16T22:34:41.108325Z DEBUG bevy_app::plugin_group: added plugin: bevy_diagnostic::DiagnosticsPlugin
2023-03-16T22:34:41.108348Z DEBUG bevy_app::app: added plugin: bevy_diagnostic::DiagnosticsPlugin
2023-03-16T22:34:41.108437Z DEBUG bevy_app::plugin_group: added plugin: bevy_input::InputPlugin
2023-03-16T22:34:41.108464Z DEBUG bevy_app::app: added plugin: bevy_input::InputPlugin
2023-03-16T22:34:41.109808Z DEBUG bevy_app::plugin_group: added plugin: bevy_a11y::AccessibilityPlugin
2023-03-16T22:34:41.109839Z DEBUG bevy_app::app: added plugin: bevy_a11y::AccessibilityPlugin
2023-03-16T22:34:41.131299Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux 20.04 Ubuntu", kernel: "5.4.0-139-generic", cpu: "Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz", core_count: "4", memory: "15.5 GiB" }
hello
```
I even tried disabling plugins one-by-one, but no matter what I tried, I still couldn't get the app to continue:
```rust
use bevy::{
a11y::AccessibilityPlugin, diagnostic::DiagnosticsPlugin, input::InputPlugin, prelude::*,
time::TimePlugin,
};
fn main() {
App::new()
.add_plugins(
DefaultPlugins
.build()
.disable::()
.disable::()
.disable::()
.disable::()
.disable::()
.disable::()
.disable::()
.disable::()
.disable::()
.disable::(),
)
.add_system(|| println!("hello"))
.run();
}
```
Contributor guide
Research direction
Start with the reported Cargo.toml feature configuration and the App::run entry point, then inspect how DefaultPlugins behaves when default features are disabled. Compare the one-update-cycle behavior with and without default features and with WindowPlugin disabled. Done means the minimal reproducible app continues running and prints hello repeatedly, or the intended configuration is clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100