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 reload final steps #434

Closed
kkolyan opened this issue Sep 29, 2023 · 5 comments · Fixed by #437
Closed

Hot reload final steps #434

kkolyan opened this issue Sep 29, 2023 · 5 comments · Fixed by #437
Labels
c: register Register classes, functions and other symbols to GDScript feature Adds functionality to the library

Comments

@kkolyan
Copy link
Contributor

kkolyan commented Sep 29, 2023

I just checked hot reload with Godot and gdext latest master branches and instead of loading new class, I have a Extension marked as reloadable, but attempted to register class 'SuperPlayer' which doesn't support reloading. Perhaps your language binding don't support it? Reloading disabled for this extension.

The place where error generated:
https://github.com/godotengine/godot/blob/4c3dc26367518e006f8555c12f5d2df0b8a28192/core/extension/gdextension.cpp#L431

Seems like we need to supply recreate_instance_func. Also, seems like that requires migration from deprecated _register_extension_class to _register_extension_class2.

Steps to reproduce a problem:

  1. get Godot sources and build them. I use scons dev_build=yes debug_symbols=yes platform=windows compiledb=yes -j8 for debugging from CLion.
  2. set GODOT4_BIN to the path of result executable
  3. select some working gdext project (dodge-the-creeps from examples is ok)
  4. add reloadable = true to the configuration section of .gdextension file
  5. comment out some class
  6. run cargo build --package dodge-the-creeps--lib --features custom-godot
  7. run Godot executable with --editor --path <path to dodge-the-creeps Godot folder>, wait it for loading scene
  8. run cargo build --package dodge-the-creeps--lib --features custom-godot again
  9. switch back to Godot editor and see error in console.
@Bromeon
Copy link
Member

Bromeon commented Sep 29, 2023

Yes, it's simply not implemented yet.

The equivalent for godot-cpp: godotengine/godot-cpp#1200

@Bromeon Bromeon added feature Adds functionality to the library c: register Register classes, functions and other symbols to GDScript labels Sep 29, 2023
kkolyan added a commit to kkolyan/gdext that referenced this issue Sep 30, 2023
kkolyan added a commit to kkolyan/gdext that referenced this issue Sep 30, 2023
kkolyan added a commit to kkolyan/gdext that referenced this issue Sep 30, 2023
@kkolyan
Copy link
Contributor Author

kkolyan commented Oct 1, 2023

blocked for Windows 10 by upstream godotengine/godot#82601

kkolyan added a commit to kkolyan/gdext that referenced this issue Oct 1, 2023
@kkolyan
Copy link
Contributor Author

kkolyan commented Oct 1, 2023

Current problems:

  1. GDExtension reload spam on Windows 10 due to inconsistent last_modified_time handling godotengine/godot#82601, hot-fixed locally, PR in upstream.

  2. errors in console after DLL change:

 Attempt to register extension class 'SuperPlayer', which appears to be already registered.
  Cannot get class ''.
  Attempt to register extension class 'SuperPlayer', which appears to be already registered.
  Attempt to register extension method 'get_x' for unexisting class 'SuperPlayer'.
  Attempt to register extension method 'set_x' for unexisting class 'SuperPlayer'.
  Attempt to register extension class property 'x' for unexisting class 'SuperPlayer'.
  Attempt to register extension method 'get_y' for unexisting class 'SuperPlayer'.
  Attempt to register extension method 'set_y' for unexisting class 'SuperPlayer'.
  Attempt to register extension class property 'y' for unexisting class 'SuperPlayer'.
  Attempt to register extension method 'get_z' for unexisting class 'SuperPlayer'.
  Attempt to register extension method 'set_z' for unexisting class 'SuperPlayer'.
  Attempt to register extension class property 'z' for unexisting class 'SuperPlayer'.

kkolyan added a commit to kkolyan/gdext that referenced this issue Oct 1, 2023
kkolyan added a commit to kkolyan/gdext that referenced this issue Oct 1, 2023
@kkolyan
Copy link
Contributor Author

kkolyan commented Oct 1, 2023

Ready for testing :) To really work well, depends on the pull request mentioned in godotengine/godot#82601.

@kkolyan
Copy link
Contributor Author

kkolyan commented Oct 2, 2023

upstream PR merged to master!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: register Register classes, functions and other symbols to GDScript feature Adds functionality to the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants