Skip to content

GDNative 1.3 version check breaks compilation for Godot 3.5 RC #904

Closed
@kylewlacy

Description

@kylewlacy

I'm evaluating Godot 3.5 RC 6 for a project. I followed along with the "Hello, World!" tutorial in the book, and everything built fine. I then added a new GDNativeLibrary resource, set up the HelloWorld class as a NativeScript, and attached it to a node. When starting my project, I got the following error:

E 0:00:00.515   gdnative_init: Error loading GDNative file res://MyLibrary.dll: GodotEngine v4.* is not yet supported. See https://github.com/godot-rust/godot-rust/issues/396
  <Source>      MyLibrary.dll:0 @ gdnative_init()

I tracked this error down to this section in the code:

https://github.com/godot-rust/godot-rust/blob/bacc380bfeee5aba44dd1a6966adc39b4912c6e0/gdnative-core/src/private.rs#L55-L61

I did some digging and it looks like this check was added at a time where Godot 4 reported a GDNative API version of 1.3 even though the Godot 4 API was not compatible. My understanding of the situation since then is that Godot 4 removed GDNative in favor of the new "GDExtension" mechanism, and Godot 3.5 bumped its own version of GDNative to 1.3 (which I'm guessing is broadly compatible with API version 1.2?)

As a result, it seems like godot-rust v0.10.0 isn't compatible with Godot 3.5, as it's treating Godot 3.5 the same as Godot 4.


I made a fork of godot-rust with this check disabled (https://github.com/kylewlacy/godot-rust/tree/wip/godot-3.5). Compiling my GDNative extension using my godot-rust fork seems to make the extension load properly now, and "Hello, World!" gets printed to the console when loaded. I haven't tested anything beyond the "Hello World" tutorial at this point, so I can't speak about other pitfalls or breakages. Would Godot 3.5 support be as simple as removing/tweaking this version check, or would it be a more involved change?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions