Engine does not see gdextension release

Godot Version

Godot 4.6 custom build.

Question

Engine does not see gdextension build dll of release version.

I have several build of the engine. Release and Debug.

Also I have release and debug version of dll.

this is *.gdextension file

[configuration]
entry_symbol = "rim_library_init"
compatibility_minimum = 4.1
reloadable = true

[libraries]


windows.debug.x86_32 = "res://bin/librim.windows.template_debug.dev.x86_32.dll"
windows.release.x86_32 = "res://bin/librim.windows.template_release.x86_32.dll"
							        
windows.debug.x86_64 = "res://bin/librim.windows.template_debug.dev.x86_64.dll"
windows.release.x86_64 = "res://bin/librim.windows.template_release.x86_64.dll"

but no matter what i do. engine does not load librim.windows.template_release.x86_64.dll. It Always loads librim.windows.template_debug.dev.x86_64.dll.

If I delete librim.windows.template_debug.dev.x86_64.dll then it does not load anything and crashes even though the release version is in same folder.

What do I have to do?

If you’re running the editor or starting the game from the editor, the debug version will always be used. Release version is used in the exported project and if you force it by starting from command line using --release flag.

Note that you can always just assign the release runtime to windows.debug.x86_* in the gdextension file.

I’ve always found this part frustrating too.
so here’s the way I sort of understand it, godot chooses the most constrained library to attempt loading based on the tags you give it. (there appears to be some automatic detection too but i haven’t read it)

The tags are split and tested against OS::has_feature which checks against a bunch of hard coded tags, and a set of custom tags, which can be added in the debug run configuration as well as the export configuration.
There is a bunch more stuff in there about finding libraries automatically but i haven’t really looked into it that hard.

Once you understand the above, and know where in the source to check the logic, it gets easier to write the exact tags necessary to load any library, or name the library for auto detection.

It’s been a while but i never found a way to extract the list of features from a build, i guess one could create a quick gdscript function with a copy paste of the known features from the source below, among other things.

Tried it just now and it didn’t help.

Yeah, i cant test game properly. I have to pack it every time before the test.

the shared libraries are not packed into the archive. they need to be placed next to the executable or in a library search path. on windows that automatically includes the directory of the executable, and so long as RPATH is set when compiling(i think thats already done in the scons and cmake) then it will also look in the local directory.

How about swapping the names. Have you tried that?

yeah. It worked. I was hopping for less intrusive approach. :slight_smile:

It’s not intrusive at all, a bit hacky perhaps :). You can have two *.gdextension files and swap from a tool script. The engine should hot reload the runtimes automatically.