Skip to content

Conversation

@Yarwin
Copy link
Contributor

@Yarwin Yarwin commented Nov 2, 2025

get_godot_version has been deprecated in favor of get_godot_version2: https://github.com/godotengine/godot/blob/master/core/extension/gdextension_interface.h#L854.

I could leave it as good first issue, oh well 😬.

@Yarwin Yarwin added the c: ffi Low-level components and interaction with GDExtension API label Nov 2, 2025
@Yarwin Yarwin force-pushed the update-get-godot-version branch 2 times, most recently from 1525d6a to cb91099 Compare November 2, 2025 07:43
@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-1394

Copy link
Member

@Bromeon Bromeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! 👍

I could leave it as good first issue, oh well 😬.

We can't always leave things open in the hope that someone will pick them up one day. Many such issues are open for more than a year.

Comment on lines 115 to 118
#[cfg(before_api = "4.5")]
type GDExtensionInterfaceGetGodotVersion = sys::GDExtensionInterfaceGetGodotVersion;
#[cfg(since_api = "4.5")]
type GDExtensionInterfaceGetGodotVersion = sys::GDExtensionInterfaceGetGodotVersion2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't prefix anything we define with GDExtension.

If we do this in other places, we should fix it.

#[cfg(before_api = "4.5")]
static GET_GODOT_VERSION: &[u8] = b"get_godot_version\0";
#[cfg(since_api = "4.5")]
static GET_GODOT_VERSION: &[u8] = b"get_godot_version2\0";
Copy link
Member

@Bromeon Bromeon Nov 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be const and not static. See also next comment with grouping 🙂

Comment on lines 116 to 119
#[cfg(before_api = "4.5")]
pub type GodotVersion = GDExtensionGodotVersion;
#[cfg(since_api = "4.5")]
pub type GodotVersion = GDExtensionGodotVersion2;
Copy link
Member

@Bromeon Bromeon Nov 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to define this in the other file, next to the function pointer type, and re-export here.

If we keep all 3 symbols (func ptr, func name, version struct) together, it might also be worth an immediately re-exported module:

#[cfg(before_api = "4.5")]
mod version_symbols {
    pub ...
}
#[cfg(since_api = "4.5")]
mod version_symbols {
    pub ...
}
use version_symbols::*;

@Bromeon Bromeon added the quality-of-life No new functionality, but improves ergonomics/internals label Nov 2, 2025
Comment on lines 118 to 119
pub type GodotVersion = GDExtensionGodotVersion;
pub type InterfaceGetGodotVersion = GDExtensionInterfaceGetGodotVersion;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, forgot to add this before:

I was thinking to add a high-level GodotVersion at some point, which could be used by GdextBuild or similar. In anticipation of that, would it make sense to include "Sys" here? Also in the function pointer, then we can drop the "Interface":

Suggested change
pub type GodotVersion = GDExtensionGodotVersion;
pub type InterfaceGetGodotVersion = GDExtensionInterfaceGetGodotVersion;
pub type GodotSysVersion = super::GDExtensionGodotVersion;
pub type GetGodotSysVersion = super::GDExtensionInterfaceGetGodotVersion;

(Not sure if use super::* is still needed)

@Yarwin Yarwin force-pushed the update-get-godot-version branch from cb91099 to f9dad7d Compare November 2, 2025 09:38
@Yarwin Yarwin force-pushed the update-get-godot-version branch 3 times, most recently from 2747c76 to 55548db Compare November 2, 2025 09:48
Copy link
Member

@Bromeon Bromeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Bromeon Bromeon added this pull request to the merge queue Nov 2, 2025
Merged via the queue into godot-rust:master with commit 9182513 Nov 2, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: ffi Low-level components and interaction with GDExtension API quality-of-life No new functionality, but improves ergonomics/internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants