-
-
Notifications
You must be signed in to change notification settings - Fork 575
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
Problems with hot reload #1573
Comments
Hi, I was just attempting to update to Godot 4.3 (from 4.2.2), and I'm encountering a similar issue. System info is:
And On initial load of my project, everything seems to work fine. However, when I recompile the C++ library, going back to Godot elicits thousands of the same errors:
Like the original author, I also find that all my custom derived Node or Node3D subclasses stop appearing in the inspector, and I get GDScript errors about my bound methods no longer being present. The only solution is to reload the editor (and be sure not to save anything) to resolve. There seems to be some general problem with hot reload:
Possibly some change between 4.2.2 and 4.3 has broken hot reloading, at least on Mac? I'd expect a lot of people to be complaining if it was a more widespread issue. |
Just want to confirm that I tested the update from 4.2.2 to 4.3 on Windows 10, and it seems to work OK. I am not seeing these hot reload issues on Windows. |
This could be related to godotengine/godot#90108, which does seem to be trickier on MacOS than Linux. |
I am very out of my depth here, but I was looking into the problem, and here's some info that may or may not be helpful. The issue you linked mentions Some places (like https://stackoverflow.com/a/13403745) recommended using Using Searching for that, it is a symbol that gets linked into your library when "thread local variables" are being used - see this link. Anyway, I don't understand if this is actually relevant or even how to test it, but I am at least seeing some concern that thread-local stuff might break unloading of dynamic libraries, and that for some reason the 4.3 version of my library is including this thread-local symbol when the 4.2 version did not. May be completely irrelevant, but there it is! |
Just to add on to my comment above, I did notice that I found a discussion on the Apple Developer Forums where an Apple Engineer says that using
I'm curious what was the impetus for introducing the |
Oof, that's unfortunate. If you remove the
In order to get the API we want, we have to set these global variables used in the It definitely is possible to do without Anyway, let me know if removing the |
Good point - I probably should have just tried that! I regret to inform that removing the My repro steps:
Speaking of reimplementing Also, since this seems to only be an issue with hot reload in editor, perhaps the "slow" approach you mention could be used for debug builds only. Using |
Thanks! I'll put together a PR that replaces
Ah, good idea! I think I will go for the "slow" approach and make it only for editor and debug builds. |
I posted PR #1594 which swaps out |
@dsnopek, sorry for the delay, but I did just try this out - and it appears to work! I can recompile the lib on Mac, go back to editor, and no more errors output - appears to work how it used to do. Thank you for taking the time to put that together! |
Godot version
master, b6223c0df0300ba2db17b5742c349f13c33f8884
godot-cpp version
master, d477589
System information
macOS Sonoma 14.6.1, M3 Max
Issue description
I had to add this in my cmake to both my extension and godot-cpp to enable reload support. Without this, it was spamming that it detected extension was changed on disk, but was asking if reloading was supported and yes,
GODOT_ENABLE_HOT_RELOAD
wasON
before including godot-cpp.Now that godot reloaded my extension, my custom node in the editor lost its properties. It is derived from
Node3D
and the correct type is shown when I hover that node in the scene tree, however custom properties are lost, and scripts are screaming that they can't find base methods from custom node.Node in inspector after reload:
Any idea if is it me or something is broken, maybe it's apple specific problem?
Steps to reproduce
N/A
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: