Skip to content
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

[357] Removing sys from godot_gdnative_init() args. #494

Merged
merged 1 commit into from
Jul 1, 2020

Conversation

halzy
Copy link
Member

@halzy halzy commented Jun 28, 2020

godot_gdnative_init() callbacks can now report loading errors via InitCallbackInfo:: report_loading_error()

@ghost
Copy link

ghost commented Jun 29, 2020

I hate to say it, but this missed the point. The purpose of high-level init option wrappers is not to expose the low-level API structs to users: that's the job of gdnative-sys! Instead, it's for exposing information that could be useful to users, without exposing sys types, so that gdnative-sys can be considered an internal dependency and have different version numbers from the main crate. This is actually the entire underlying theme of #357, as said at the beginning of that issue. See #291 for the rationale of this.

Here, the only things that I think should be exposed to users in InitCallbackOptions are in_editor, active_library_path, and report_loading_error. The other fields are low-level details that users should not care about.

@halzy
Copy link
Member Author

halzy commented Jun 29, 2020

I'm glad! This is the sort of feedback I was looking for. That API did seem to reveal too much and why I stopped before unwrapping more. It seems we could use the version mismatch fn() when we bail on Godot 4.

@ghost
Copy link

ghost commented Jun 29, 2020

I think bailing on Godot 4 is better done in gdnative-sys, because the (incorrect) API struct would already have been constructed (in bind_api) by the time the callback is called, and we don't want that to happen.

gdnative-core/src/init.rs Outdated Show resolved Hide resolved
@halzy halzy force-pushed the halzy/357-api-clean branch 2 times, most recently from 99921d8 to f2c778b Compare June 30, 2020 01:02
@halzy halzy marked this pull request as ready for review June 30, 2020 01:03
@halzy halzy changed the title [357] WIP Wrappers for init [357] Removing sys from godot_gdnative_init() args. Jun 30, 2020
@halzy halzy force-pushed the halzy/357-api-clean branch from f2c778b to ed86d34 Compare June 30, 2020 01:07
gdnative-core/src/core_types/string.rs Outdated Show resolved Hide resolved
gdnative-core/src/init.rs Outdated Show resolved Hide resolved
gdnative-core/src/init.rs Outdated Show resolved Hide resolved
gdnative-core/src/init.rs Show resolved Hide resolved
@halzy halzy force-pushed the halzy/357-api-clean branch from ed86d34 to 91f8f83 Compare June 30, 2020 01:34
gdnative-core/src/init.rs Outdated Show resolved Hide resolved
gdnative-core/src/init.rs Outdated Show resolved Hide resolved
@halzy halzy force-pushed the halzy/357-api-clean branch from 91f8f83 to bad10ed Compare June 30, 2020 14:31
gdnative-core/src/macros.rs Outdated Show resolved Hide resolved
@halzy halzy force-pushed the halzy/357-api-clean branch from bad10ed to 05ded0c Compare June 30, 2020 18:25
gdnative-core/src/macros.rs Outdated Show resolved Hide resolved
@halzy halzy force-pushed the halzy/357-api-clean branch from 05ded0c to b183b99 Compare July 1, 2020 02:15
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Looks good to me!

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 1, 2020

Build succeeded:

@bors bors bot merged commit 77d443d into godot-rust:master Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant