-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Check that GDExtensionCompatHashes
are valid when generating extension_api.json
#84973
Check that GDExtensionCompatHashes
are valid when generating extension_api.json
#84973
Conversation
2c94571
to
5cf6d08
Compare
Note: this adds a warning, but the most important part is probably the |
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.
Seems confirmed working by #84906 failing CI with this PR.
Thanks! |
if (p_check_valid) { | ||
MethodBind *mb = ClassDB::get_method_with_compatibility(p_class, p_method, mapping.current_hash); | ||
if (!mb) { | ||
WARN_PRINT(vformat("Compatibility hash %d mapped to non-existent hash %d. Please update gdextension_compat_hashes.cpp.", mapping.legacy_hash, mapping.current_hash)); |
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.
One point of potential confusion here is that we use hexadecimal representation of the hash in the other check, didn't realize previously, might be worth improving to unify
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, however, we use plain integers in the source code, so if someone is trying to find the hash in the code it's more useful in integer form. It would be good to unify this in some way, though.
Our CI uses the
extension_api.json
to check that we haven't broken GDExtension binary compatibility by removing a method with a particular hash. We're also usingGDExtensionCompatHashes
to map from some old broken hashes to some new ones.However, there isn't anything presently that checks that these mapped hashes are actually valid, which could hide compatibility breakages until runtime.
This PR attempts to validate the mapped hashes when generating the
extension_api.json
.