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

Option to toggle/revert to 0.14 behaviour of Fallible SystemParams #16578

Open
TheBiochemic opened this issue Nov 30, 2024 · 4 comments · May be fixed by #16638
Open

Option to toggle/revert to 0.14 behaviour of Fallible SystemParams #16578

TheBiochemic opened this issue Nov 30, 2024 · 4 comments · May be fixed by #16638
Assignees
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible S-Needs-Design This issue requires design work to think about how it would best be accomplished X-Contentious There are nontrivial implications that should be thought through
Milestone

Comments

@TheBiochemic
Copy link

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

In bigger Projects there is already a lot going on in the Terminal during runtime. If now forgetting to add some Resource etc. generates only logging (or nothing at all), that something won't happen, but the app otherwise launching and working often entails debugging that wouldn't be necessary in the first place, if it would just crash the program with the log message as the panic message, as it was historically.

If a Resource etc. is missing, it's supposed to interrupt my workflow, which is why i consider the old behavior a safeguard.

What solution would you like?

Some Sort of functionality to toggle the behavior globally. It could be one of these things:

  • A Flag to set it to panic, log or none globally by default, with the option to override it, as seen in 0.15 (could be nice, since it could be disabled for release builds. This could be problematic with other parts of bevy potentially).
  • An Option in DefaultPlugins (That defines the default behavior for all Systems. Same Problem as first Option)
  • An Option to set the Default behavior on a Plugin level (All systems added via this plugin have the following behavior of none, logging once, loggin always, panic)
  • Catching nonworking SystemParams (like a missing Resource) in a System without defined behaviour (not using .never_param_warn(), ...) during compile time and throwing a hard error (i'm not sure how possible that would be, if at all)

The Last option would be personally my favourite.

What alternative(s) have you considered?

Not upgrading to 0.15 just yet, until some interface is available to toggle to this or a similarly obvious behavior.

Additional context

i'm talking specifically about the feature mentioned in https://bevyengine.org/news/bevy-0-15/#fallible-system-parameters

@TheBiochemic TheBiochemic added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Nov 30, 2024
@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events X-Contentious There are nontrivial implications that should be thought through and removed S-Needs-Triage This issue needs to be labelled labels Nov 30, 2024
@mockersf mockersf added this to the 0.15.1 milestone Dec 1, 2024
@mockersf
Copy link
Member

mockersf commented Dec 1, 2024

I think panics by default should be re-introduced

catching it at compile time is impossible as some of the system parameters can be made valid/invalid at runtime

@TheBiochemic
Copy link
Author

catching at compile time not being possible makes sense, i think it was a suggestion from the bevy discord.

Restoring the previous behaviour would be great yeah. I would say the panicking along side the additional behaviour of logging/none is probably a good compromise.

I guess one of the chores might be to go through the codebase and make sure, that the Systems, that shouldn't panic on missing/unloaded SystemParams need to have the .never_param_warn(), etc.

I don't really know, what implications a Plugin wide behavior override mechanic would have, but it might help with that above chore.

@MiniaczQ MiniaczQ self-assigned this Dec 1, 2024
@MiniaczQ MiniaczQ linked a pull request Dec 3, 2024 that will close this issue
@seivan
Copy link

seivan commented Dec 4, 2024

If it's not possible to catch at compile time, then it needs to be possible to catch at boot.
Whatever it is that causes error logs to get dumped need to happen as soon as possible.

I wonder if #16638 fixes this.

@BenjaminBrienen BenjaminBrienen added the S-Needs-Design This issue requires design work to think about how it would best be accomplished label Dec 12, 2024
@wilk10
Copy link
Contributor

wilk10 commented Dec 14, 2024

+1 from my side to reintroduce panics by default. It was actually good UX and very easy to fix. The warning is very easy to miss.

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-Feature A new feature, making something new possible S-Needs-Design This issue requires design work to think about how it would best be accomplished X-Contentious There are nontrivial implications that should be thought through
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants