-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Fix editor needs restart after adding GDExtensions #93972
Fix editor needs restart after adding GDExtensions #93972
Conversation
13652f3
to
875f898
Compare
965b848
to
1c0cb31
Compare
1c0cb31
to
10a13dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as documentation for the two new signals, it's fine.
10a13dc
to
b01beba
Compare
b01beba
to
6ced7c1
Compare
Sure! I'm testing with https://github.com/GodotVR/godot_openxr_vendors using the project in If I delete the
These errors aren't present when I open the Godot editor every subsequent time, after the |
6ced7c1
to
d97b0c6
Compare
I fixed this issue. It was caused because the |
This isn't just about a good editor experience, it apparently fixes #92833 which stops people from being able to implement headless CI builds. Thanks for the fix! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
With the latest version of the PR, I'm not seeing the issue I was seeing previously. Skimming the code, the GDExtension parts look good to me - I'm not qualified to review the GDScript parts.
Anyway, this is a really great improvement! I'm really excited for this to be merged once Godot 4.4 development opens up :-)
d97b0c6
to
a1ed3be
Compare
I haven't reviewed this in detail, but the GDScript part looks good to me. However, it may not be enough to make tool scripts and hot reloading work correctly. The GDScript implementation relies in multiple places on the assumption that GDExtension classes are indistinguishable from native classes, i.e. they can't be removed/changed. We probably need to invalidate some scripts when unloading GDExtensions and/or do some other work similar to rune-scape's fixes. However, I don't think this should be treated as a blocker for merging this PR if everything else is fine. GDExtensions can be used independently of tool / hot reloading scripts or may not be affected by the above issues. Just pointing out potential problems that can be addressed in future PR(s). |
11fcfb8
to
ebbbae4
Compare
ebbbae4
to
ef6f873
Compare
Rebased to fix the merge conflict and adjusted to documentation for // The extension may not have a .gdextension file.
if (!FileAccess::exists(loaded_extensions[i])) { |
Thanks! Awesome improvement 🎉 |
@ryevdokimov I think the error you posted is unrelated, but does represent something that could be improved! Can you open a new issue for that? It sounds like we're detecting from the DLL that it has a PDB file (could have been built in Godot Jolts build process) but not finding the file on disk (probably just not included with the release files). We should probably just silently skip copying the PDB in that case. With regard to your editor crashes: Do they only happen with this PR? |
I can confirm that this is the case. I do build with debug symbols, but I distribute them separately as part of the GitHub release for whomever wants/needs them, as opposed to shipping them with the binaries. This is fairly common on Windows in general, but maybe not so much with GDExtension. This particular error seems to have slipped past me because it's typically only emitted to stderr, since Anyway, the PDB renaming introduced in #87117 should indeed not assume that the PDB file is present on disk even if there's an entry for it in the header. |
Yeah, I suppose this is more an exposed issue as a result of a PR rather than a direct consequence of it. Prior to this PR, it wouldn't get to this step because the editor needed to be restarted. Just wanted to confirm. I can report this as a new issue using the feedback from mihe above. |
@ryevdokimov If interested, you could also test with Terrain3D, which is downloadable from the asset library. I don't distribute debug builds, but do provide icons for our editor buttons. Typically they need a restart so Godot will properly import them. So our normal instructions are to restart twice, once for the library, once for imported graphics. |
The library loads fine however as probably expected we get errors for the missing graphics: I believe this PR would fix this: #92667 |
I believe so, yes. |
There’s interest in chat.godotengine.org for cherry picking this to 4.3 |
I think we should wait to see if there's any issues after using it in a couple dev releases before cherry-picking it. But, yeah, if there are no issues, I know lots of folks would love this change. :-) |
Fixes #77478
This PR should prevent the need to restart the editor when a new GDExtension is installed or when starting the editor for the first time without the
extension_list.cfg
file.Modifications:
extension_list.cfg
toGDExtensionManager::ensure_extensions_loaded
to facilitate the emission of theextensions_reloaded
signal and to call_reload_all_scripts
when extensions are added or removed.ScriptEditor::get_singleton()->reload_scripts
onextensions_reloaded
inEditorNode
to revalidate the opened scripts and fix GDScript errors when extensions are added while the editor is running and GDScripts are opened that use classes from the extension.Known issues:
@tool
. This issue was already present.Not tested:
MRP used to test this (only built for Windows):
It's based on the MRP from #77478 but modified for Godot 4.3 master.
test-godot-minimal_repro.zip