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

Disable system stepping feature by default #11931

Closed
alice-i-cecile opened this issue Feb 18, 2024 · 2 comments · Fixed by #12847
Closed

Disable system stepping feature by default #11931

alice-i-cecile opened this issue Feb 18, 2024 · 2 comments · Fixed by #12847
Labels
A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use
Milestone

Comments

@alice-i-cecile
Copy link
Member

What problem does this solve or what need does it fill?

This feature should not be included in shipped games, and adds small but measurable performance overhead to running schedules.

What solution would you like?

Disable the feature by default, and document that you need to enable it in the example.

What alternative(s) have you considered?

Add this to your Cargo.toml, and update it every release:

default-features = false
features = [
  "animation",
  "bevy_asset",
  "bevy_audio",
  "bevy_gilrs",
  "bevy_scene",
  "bevy_winit",
  "bevy_core_pipeline",
  "bevy_pbr",
  "bevy_gltf",
  "bevy_render",
  "bevy_sprite",
  "bevy_text",
  "bevy_ui",
  "multi-threaded",
  "png",
  "hdr",
  "vorbis",
  "x11",
  "bevy_gizmos",
  "android_shared_stdcxx",
  "tonemapping_luts",
  "default_font",
  "webgl2",
]

Additional context

Any other information you would like to add such as related previous work,
screenshots, benchmarks, etc.

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Feb 18, 2024
@iiYese
Copy link
Contributor

iiYese commented Feb 18, 2024

Is disabled really the better default tho? Release builds are the exception not debug builds.

@alice-i-cecile
Copy link
Member Author

alice-i-cecile commented Feb 18, 2024

Disabling features of your dependencies in Rust is particularly painful: if it's not on the core path I'd prefer to keep it out.

In particular, when building my games I like to have a dev-mode feature in my own crate. In order for that to work correctly, I now need to disable all default features, and carefully select my options.

@james7132 james7132 added this to the 0.14 milestone Mar 5, 2024
github-merge-queue bot pushed a commit that referenced this issue Apr 3, 2024
# Objective

Fix #11931 

## Solution

- Make stepping a non-default feature
- Adjust documentation and examples
- In particular, make the breakout example not show the stepping prompt
if compiled without the feature (shows a log message instead)

---

## Changelog

- Removed `bevy_debug_stepping` from default features

## Migration Guide

The system-by-system stepping feature is now disabled by default; to use
it, enable the `bevy_debug_stepping` feature explicitly:

```toml
[dependencies]
bevy = { version = "0.14", features = ["bevy_debug_stepping"] }
```

Code using
[`Stepping`](https://docs.rs/bevy/latest/bevy/ecs/schedule/struct.Stepping.html)
will still compile with the feature disabled, but will print a runtime
error message to the console if the application attempts to enable
stepping.

---------

Co-authored-by: James Liu <[email protected]>
Co-authored-by: François Mockers <[email protected]>
chompaa pushed a commit to chompaa/bevy that referenced this issue Apr 5, 2024
# Objective

Fix bevyengine#11931 

## Solution

- Make stepping a non-default feature
- Adjust documentation and examples
- In particular, make the breakout example not show the stepping prompt
if compiled without the feature (shows a log message instead)

---

## Changelog

- Removed `bevy_debug_stepping` from default features

## Migration Guide

The system-by-system stepping feature is now disabled by default; to use
it, enable the `bevy_debug_stepping` feature explicitly:

```toml
[dependencies]
bevy = { version = "0.14", features = ["bevy_debug_stepping"] }
```

Code using
[`Stepping`](https://docs.rs/bevy/latest/bevy/ecs/schedule/struct.Stepping.html)
will still compile with the feature disabled, but will print a runtime
error message to the console if the application attempts to enable
stepping.

---------

Co-authored-by: James Liu <[email protected]>
Co-authored-by: François Mockers <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants