Validate class registrations against ClassDB - #1664
Merged
Merged
Conversation
|
API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-1664 |
Bromeon
force-pushed
the
qol/validate-registrations
branch
7 times, most recently
from
July 30, 2026 22:42
2fef30e to
20ef831
Compare
Bromeon
force-pushed
the
qol/validate-registrations
branch
4 times, most recently
from
July 31, 2026 16:50
48fee02 to
4d0bf16
Compare
Also reduce macro duplication.
Godot's `classdb_register_extension_class*` functions return void and only print to stderr on failure. Now, godot-rust queries `ClassDB` before each registration and reports precise errors via `defer_startup_fatal!`.
Bromeon
force-pushed
the
qol/validate-registrations
branch
from
July 31, 2026 17:03
4d0bf16 to
e055940
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Godot's
classdb_register_extension_class*functions return void and only print to stderr on failure, so a rejected class, method, property, signal or constant is silently missing at runtime. The printed Godot error may vary in detail.New
registry::reg_validationmodule queriesClassDBbefore each registration and reports a precise error viagodot_error!(and in a potential future builder API would allow programmatic check).In addition, it exits Godot after collecting all errors. Validation runs only under strict safeguards (default in Debug).
#[var]and#[func]are allowed to collide in Godot, but there aren't many use cases, and an explicit#[var(override)]or so might be better. For now warn (no breaking change), will become hard error in v0.6.Here's a small manual test.
Closes #1024.