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

api-4-x-y features; automated version sync; #[cfg] cleanup. #740

Merged
merged 8 commits into from
Jun 2, 2024

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented Jun 2, 2024

The PR adds fine-grained features to allow patch-level requirements. In addition to api-4-2, it's now possible to specify api-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 and gdextension_minor_api, instead adds patch_api_since and patch_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.

Bromeon added 6 commits June 2, 2024 12:56
Changes:
- Cargo features now include all patch versions.
- #[cfg(before/since_patch_api = "4.3.2")] added.
- #[cfg(gdextension_exact_api)] removed.
- #[cfg(gdextension_minor_api)] removed.
@Bromeon Bromeon added quality-of-life No new functionality, but improves ergonomics/internals c: tooling CI, automation, tools labels Jun 2, 2024
@GodotRust
Copy link

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

@Bromeon Bromeon force-pushed the qol/cfg-cleanup branch from c4587ab to df20cb2 Compare June 2, 2024 16:37
@Bromeon Bromeon force-pushed the qol/cfg-cleanup branch from df20cb2 to 8b9a1a3 Compare June 2, 2024 18:26
@Bromeon Bromeon added this pull request to the merge queue Jun 2, 2024
Merged via the queue into master with commit e1f1ce3 Jun 2, 2024
15 checks passed
@Bromeon Bromeon deleted the qol/cfg-cleanup branch June 2, 2024 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: tooling CI, automation, tools quality-of-life No new functionality, but improves ergonomics/internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants