-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Allow GDExtensions to set a compatibility_maximum
#88417
Allow GDExtensions to set a compatibility_maximum
#88417
Conversation
e28ea58
to
9b0ca78
Compare
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.
I'm all for it, and the change looks good to me. The ability to omit parts of it is a nice touch.
I would frankly like to see this be added to the example .gdextension
file in the godot-cpp README.md
as well, and have it be the same value as its compatibility_minimum
.
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.
Looks great otherwise, nice to see this idea implemented!
I think I was against this in the meeting, but doesn't seem to be in the notes 🤔
|
9b0ca78
to
2afa355
Compare
While we aim to have complete forward compatibility, that breaks at times, and it's not always possible to ensure a fully compatible version of a plugin when that happens, so this allows developers to avoid having a version that breaks on some targets, and can then make a new version but keep support for older versions as well, when necessary I agree that it shouldn't be encouraged broadly, but it prevents issues such as crashes with Jolt when it relies on something specific, including deprecated features that might not work as expected any longer etc., or broken compatibility for a bug that would still break a plugin that relies on it And allowing plugin developers to not have to ensure forward compatibility of their plugins before they've verified they work etc. |
Do we know why Jolt uses this check? Are they regularly facing breaking changes? In my opinion we should look into this more closely before just providing workarounds. |
I don't know that I'd really want to promote this too much. It's better than folks implementing a custom thing, but like Bromeon says, I think the default should be assuming that older GDExtensions will be compatible with newer versions of Godot.
At the meeting, we really need to have someone dedicated to taking notes! I know I miss a lot of stuff trying to simultaneously facilitate the conversation and take notes. Anyway, sorry for failing to note that.
I mostly agree! However, regarding this:
I think having a formalized way to do this is better than GDExtensions using "existing means" to check versions, as I explained in the PR description above. If people are going to do it (because it's useful sometimes), I'd rather they do it in the .gdextension file, allowing advanced users to override it if needed. |
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.
The code looks nice, simple and consistent with the minimum version logic!
In regards to the idea itself, I have pretty much the same concerns as of @Bromeon, but the arguments in favor make sense and I can see that we're all being cautious here, so count me as favorable too :D
There were technically two compatibility breakages that affected Godot Jolt in 4.2. The first was an actual binary breakage related to ray-casting, which slipped past In any case, I've only ever supported the latest stable version of Godot in Godot Jolt, since I'm a bit more pessimistic when it comes forward compatibility, and I didn't want to get saddled with whatever bugs might arise from (what I perceived to be) some inevitable breakage. Unfortunately that sort of happened anyway, in part because I didn't communicate the supported version clearly enough, so the version check was just the evolution of that. The fact that it's hardcoded is unfortunate, but I didn't get the sense that people were all that receptive to
Fair enough! |
If we go down this route, how do you feel about other "often needed" compatibility settings (e.g. an extension requiring double precision or another feature)? Maybe in the future we can think about something like: [configuration]
required_features = ["double", "64"]
To me it seems like these issues can very well be introduced in a patch version, not just a minor one. I.e. I'm not sure if this setting is powerful enough to reliably ensure forward compatibility. Recommending to deal with this properly (custom code) is imo the better solution than recommending |
How do you mean? That it doesn't cover if you assume to start with that you're safe on Part of my support for this is that I believe it gives a strong tool to developers of plugins to release responsibly, to be able to control the versions they officially cover, and ensure, on their part, that the version range the plugin covers does work, therefore they can release a version with a conservative range and then shift this range when they've tested it with a newly released version That and just being able to provide multiple versions, or a constrained range of versions, if they rely on some specific quirk or behavior that has been fixed, as we don't guarantee compatibility for fixes a lot of the time, and adapting to a change like that can be complicated, and without some compatibility code you can have a hard time to write a version that works before and after reliably, depending on the behavior that was fixed. And to a degree, it allows developers of plugins to deal with breakages in a way that doesn't flood them with complaints if we end up breaking something, which I think is a good thing Of course we should strive to keep compatibility as much as possible, but we've already seen that it's not always possible, so we shouldn't use this as a way to excuse ourselves from having good compatibility, but to provide standardized tools for users to deal with it when it happens Thinking about this I think it'd be nice to add a custom compatibility message to print, which can instruct the user of the plugin, like:
So that people can keep different versions for example with different features etc. I think it's good to allow different styles of development for people, some might write a broad support version that either only uses 4.2 features, or has code for different versions, but some might prefer to develop a 4.2 branch and a 4.3 branch to keep their code clean, while allowing themselves to leverage more advanced features etc. |
@Bromeon Isn't this already a thing, sort of? You can already add whatever feature tags you want to the
I struggle to see what custom code you're envisioning that would be radically different from this But yes, you can of course technically end up with breakages in patch versions as well. In the end it's in part a system of trust that Godot isn't going to make any radical changes as part of a patch version, and certainly not intentional breaking changes. If that trust is broken then you might have to be more aggressive with your
That's actually a very good point. There might even be an argument for having these minimum/maximum versions be part of each individual |
You're both right, sorry -- I was somehow under the impression that this only covers major/minor due to the way how GDExtension's API is versioned, but I realized now that it allows patch. That makes it indeed even with a custom check. If I interpret the code correctly, There's a slight confusion because Godot calls 4.2.0 officially 4.2, and here 4.2 means 4.2.x.
That's a good point -- maybe in the future such metadata could even be displayed (e.g. in an asset store for extensions) 🤔 Thanks everyone for taking the time to explain, I think I'm good with this now 🙂 |
@Bromeon yup, from what I can tell that's indeed how it works. If you set // If a version part is missing, set the maximum to an arbitrary high value.
compatibility_maximum[i] = 9999; If you otherwise set compatible = VERSION_PATCH <= compatibility_maximum[2]; |
Thanks! |
} else { | ||
compatible = VERSION_PATCH <= compatibility_maximum[2]; | ||
} |
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.
Fixup: #88527
At the GDExtension meeting on December 1st, 2023 (see notes), we agreed on a number of changes to help with upgrading Godot on projects using GDExtensions.
One of those changes was implementing a
compatibility_maximum
that can be used in .gdextension files - which is what this PR adds!While this doesn't solve all the problems, it is simple to add, and is another tool in the toolbox for use by the maintainers of GDExtensions.
In fact, Godot Jolt is already implementing a custom version of this in its register_types.cpp:
So, this is a pretty good sign that this feature would be useful.
However, I think it would actually be even better if Godot Jolt used
compatibility_maximum
instead of hard-coding this in the C++, because that would make it easier for advanced users to test it with new versions.(Selfishly, I would like to be able to grab old binary releases of Godot Jolt and try them with Godot
master
during development, as a way to test that we didn't break GDExtension's binary compatibility - if it usedcompatibility_maximum
, I could just delete that line ;-))Please let me know what you think!
/cc @mihe