-
-
Notifications
You must be signed in to change notification settings - Fork 211
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 custom callable no longer working on latest Godot master #465
Fix custom callable no longer working on latest Godot master #465
Conversation
API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-465 |
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, I just did the same thing 😅 (before I triggered the nightly rebuild, after godotengine/godot#83800 was merged today)
But since you opened a PR, I'll merge this 🙂
Also adds a
use-latest-preview-build
feature since beta 3 was released yesterday so it's likely gonna be a week or two until the latest preview build actually has this commit included in it. So now if people wanna run gdext with beta 3 they can just add theuse-latest-preview-build
feature.
Per our compatibility guidelines, we do not officially maintain compatibility with preview builds:
We do not invest effort in maintaining compatibility with:
- Godot in-development versions, except for the latest master branch.
- Non-stable releases (alpha, beta, RC).
The conditional compilation is already complex enough to handle for multiple minor versions, and will only grow more complex over time (at least if we commit to supporting older versions). Also, this feature may be correct today but would instantly become obsolete on the next preview release, meaning we have to take immediate action again just to keep things working.
I think it's a fair trade-off to:
- either expect users who need absolute cutting edge versions to use nightly Godot (we even build the artifacts for them), or recompile Godot themselves;
- or, let users stay with a gdext version + Godot preview/stable builds for some time.
But providing the option to combine the two at any point in time comes at a high cost, given that dev builds are allowed to introduce breaking changes.
I know that 4.1 -> 4.2 is a huge jump because several major bugs were fixed and hot reloading is now supported. In general, I expect updates to be a bit less dramatic though, which would also mean there's less urge to use the latest version.
codegen-lazy-fptrs = [ | ||
"godot-ffi/codegen-lazy-fptrs", | ||
"godot-codegen/codegen-lazy-fptrs", | ||
] |
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.
Was this formatting changed by some tool?
Asking because we don't usually do this (see other lines in this file) 🙂
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.
yeah, i can probably disable my formatter and save it as it was but still
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.
Out of curiosity, which one do you use? Not that my CLion TOML plugin un-formats it again 😬
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.
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! I think the change is fine, we'll see if my formatter will be happy with it 🙂
godot-core/src/builtin/callable.rs
Outdated
#[cfg(since_api = "4.2")] | ||
fn default_callable_custom_info() -> sys::GDExtensionCallableCustomInfo { | ||
sys::GDExtensionCallableCustomInfo { | ||
callable_userdata: ptr::null_mut(), | ||
token: ptr::null_mut(), | ||
// TODO: Remove when 4.2 beta 3 is no longer the latest preview build | ||
#[cfg(feature = "use-latest-preview-build")] | ||
object: ptr::null_mut(), | ||
#[cfg(not(feature = "use-latest-preview-build"))] | ||
object_id: 0, | ||
call_func: None, | ||
is_valid_func: None, // could be customized, but no real use case yet. | ||
free_func: None, | ||
hash_func: None, | ||
equal_func: None, | ||
// Op < is only used in niche scenarios and default is usually good enough, see https://github.com/godotengine/godot/issues/81901. | ||
less_than_func: None, | ||
to_string_func: None, | ||
} | ||
} |
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.
Nice refactoring! 👍
Make `Callable` work with beta 2 under `use-latest-preview-build` feature
b7f5b02
to
79ed1bb
Compare
codegen-lazy-fptrs = [ | ||
"godot-ffi/codegen-lazy-fptrs", | ||
"godot-codegen/codegen-lazy-fptrs", | ||
] |
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! I think the change is fine, we'll see if my formatter will be happy with it 🙂
Re categorization: I was a bit unsure whether to mark this as Ultimately the main purpose of labels is to find things efficiently, and when looking for |
Makes
GDExtensionCallableCustomInfo
useobject_id
instead ofobject
.Also adds a
use-latest-preview-build
feature since beta 3 was released yesterday so it's likely gonna be a week or two until the latest preview build actually has this commit included in it. So now if people wanna run gdext with beta 3 they can just add theuse-latest-preview-build
feature.Ideally we'd have a CI set up to run integration tests using this feature on the latest preview build. But im not familiar enough with all the CI to set that up.