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

Hot reloading issues #608

Closed
Jacob-Steentoft opened this issue Feb 13, 2024 · 6 comments
Closed

Hot reloading issues #608

Jacob-Steentoft opened this issue Feb 13, 2024 · 6 comments
Labels
not an issue The reported problem isn't a problem within gdext.

Comments

@Jacob-Steentoft
Copy link

Hi,

I stumbled over #434 and tried to replicate the steps from the original post to get hot reloading working. But when compiling changes while the game is running, I'm just getting an error Access is denied. (os error 5) since the dll file cannot be removed.

Am I misunderstanding the hot reloading capabilities, or is something not working as intended? I'm unable to find any documentation for gdext on the hot reloading on either Godot's docs or the Godot rust book.

@Bromeon
Copy link
Member

Bromeon commented Feb 13, 2024

Hello 🙂

Hot reloading is managed by the Godot engine for the most part -- we hook up some callbacks and tell Godot where the .dll file is, but the actual reloading is triggered by Godot.

Do you use a recent engine version (at least 4.2)? You also need to set your extension as reloadable in the .gdextension file.

If the problem persists, I'd recommend opening an issue in Godot's own tracker (or asking on their forum/contributors chat).

@scripturial
Copy link

scripturial commented Feb 18, 2024

@Jacob-Steentoft Sounds like your on PC. But for what it's worth, hot reloading doesn't work at all on Mac as far as I can tell, even when the reloadable flag is set with the latest version of Godot and rust gdext. When I rebuild (app running or not), I can't see any changes until I fully quit and restart Godot. (At which point Godot crashes and I reopen and it works)

Im experimenting with using rust in Godot so I can pull in a whole pile of existing rust code into my Godot apps, and it works, but continually restarting Godot every few minutes drives me insane.

@Bromeon
Copy link
Member

Bromeon commented Feb 18, 2024

There are two open bugs related to hot reloading:

Can you check if this issue could be related to one of those?

If not, could you report this upstream in the Godot issue tracker? Hot reloading being completely broken on macOS is definitely not something that should happen.

@Bromeon
Copy link
Member

Bromeon commented Mar 5, 2024

Closing as I can't reproduce it on Windows and haven't gotten more info. Godot implemented a dedicated mechanism to move DLLs before hot reloading, and from what I can tell, it works.

Regarding the macOS issues, we don't do anything different for that platform. If it still doesn't work, I'd recommend opening an issue on the Godot repo. But make sure to test with latest gdext master first, there were a few recent bugfixes, such as no longer allowing to forget #[class(init)].

@Bromeon Bromeon closed this as not planned Won't fix, can't repro, duplicate, stale Mar 5, 2024
@scripturial
Copy link

I haven't tested on 4.3.x yet, but for informational purposes, on macOS, I can confirm the problem is not fixed 4.2.1, I am doing a "quit Godot, build, open Godot" build cycle at the moment.

@Bromeon
Copy link
Member

Bromeon commented Mar 15, 2024

@scripturial are you sure it is this specific issue with hot reloading though -- with Access is denied. (os error 5)?

There are some other hot reloading problems we need to address, but this one is probably something that should be reported to Godot directly, as they're doing the DLL copy logic before reloading.

@Bromeon Bromeon added the not an issue The reported problem isn't a problem within gdext. label Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not an issue The reported problem isn't a problem within gdext.
Projects
None yet
Development

No branches or pull requests

3 participants