-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
#[class(no_init)]
makes extension non-reloadable
#874
Comments
Your project has a ton of dependencies, that's not really helpful. Please really come up with a minimal complete example, a single Rust file + if relevant, Also, ZIPs are nice -- but additionally, please add the above-mentioned files as inline snippets here (make sure they're short and do not contain irrelevant info). This is more accessible for anyone joining the discussion, and lets people try out things without first downloading and unpacking an archive. |
iteresting, I got error when I started it from scratch:
I think that it's issue on the lib side, if it so, please, close this issue(just I am not sure): |
So it looks like this has nothing to do with coroutines, but rather |
#[class(no_init)]
makes extension non-reloadable
Confirmed to be a limitation in Godot: godotengine/godot#96823 |
Note
Edit bromeon: updated problem description.
When disabling the default constructor via
#[class(no_init)]
, the class can no longer be reloaded. Godot uses this as a reason to disable reloading for the entire extension, with the following error:It looks like the problem arises in the following part:
gdext/godot-macros/src/class/derive_godot_class.rs
Lines 78 to 105 in 6e6889a
If
no_init
is specified, the init strategy will beAbsent
, and neithercreate
norrecreate
functions are set. I think particularly the latter causes problems, although this needs to be confirmed. The class is also marked abstract, but I'm not sure if that interferes with it.We would need to see how we can enable reloading in the absence of a default constructor. If there are no instances of a class to be reloaded, there shouldn't be a problem -- so maybe Godot is overzealous at forbidding reloading if there is no constructor?
Update: there's now an upstream issue to enable this workflow in Godot:
Original message:
Hello,
I've noticed that when I've updated gdext and godot on 4.3 I got broken reload. I used
gdext_coroutines
. After disable this part on another project that I've created for testing - reloadable starts work fine. After I read the library and didn't notice any specific cases and tried to add imports coroutines into my extenstion directrly and got same issue.Reproduce:
#![feature(coroutines, coroutine_trait)]
use std::ops::{Coroutine, CoroutineState};
Read more: Houtamelo/gdext_coroutines#2
showcase.zip
The text was updated successfully, but these errors were encountered: