rksm / hot-lib-reloader-rs

Reload Rust code without app restarts. For faster feedback cycles.
MIT License
575 stars 20 forks source link

Segmentation Fault on changing function params #3

Open mwbryant opened 1 year ago

mwbryant commented 1 year ago

Running on Ubuntu 20.04

When testing out the bevy example, if I add commands to the parameters for player_movement_system then the application seg faults. This happens for any change to the system params I have tested. This may be a fundamental limitation with these techniques though.

rksm commented 1 year ago

Yeah exactly, with the current implementation this is unavoidable. The executable expects the library function signatures to be fixed, if they change you'll hit undefined behavior.

The most practical workaround for now is to either pass a larger state parameter that likely includes what you'll want to work with on the library side or start out providing potentially needed but not yet used parameters while developing a system.

I'll be looking into ideas of making this more flexible and do welcome suggestions to solve this problem. I'll leave this issue open for a discussion around that.

mwbryant commented 1 year ago

I'll be reading through your write-up and the code tonight. I love this idea and I think it can grow into a very powerful dev tool for bevy