api-4-x-y
features; automated version sync; #[cfg]
cleanup.
#740
+592
−157
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The PR adds fine-grained features to allow patch-level requirements. In addition to
api-4-2
, it's now possible to specifyapi-4-2-1
. This is generally not recommended, because it needlessly restricts compatibility with little gain (GDExtension API itself only changes in minor versions). There can be situations though where a necessary feature is only fixed by Godot in a certain patch version, or some API symbols are only added in one.Since this is quite annoying to maintain on our side and Rust still doesn't have "multi-features", I automated the hell out of the list. There's now a small crate (nested in
itest
) that does string templating directly in the source, which is checked in CI. Whenever a new Godot patch version is released, we need to add only one line and rerun this. It's admittedly a bit overengineered, but at least I could reuse the mechanism for the existing GDScript codegen, and it may pay off quickly, as we already have 11 locations to keep in sync.Removes cfgs
gdextension_exact_api
andgdextension_minor_api
, instead addspatch_api_since
andpatch_api_before
, although those are still unused.Furthermore, this fixes warnings introduced by
lints.rust.unexpected_cfgs
. We may need to look into this as compiler support improves.