Skip to content

Improve automated checks for GDExtension compatibility#113743

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
Yarwin:feature/improve-automated-checks-for-gdextension-compatibility
Feb 6, 2026
Merged

Improve automated checks for GDExtension compatibility#113743
Repiteo merged 1 commit intogodotengine:masterfrom
Yarwin:feature/improve-automated-checks-for-gdextension-compatibility

Conversation

@Yarwin
Copy link
Copy Markdown
Contributor

@Yarwin Yarwin commented Dec 8, 2025

closes: #113519

Implements the first proposed solution in this thread, i.e.:

We could make a minimal GDExtension (maybe directly in C?) that attempts to load all methods in the extension_api.json from the previous minor version and see if any of them fails to load. This feels like the most complete way to test it, because it's not just testing the JSON data, but also the fallback code

Effect of running said check against Godot 4.5.1-stable:

$ ./tests/compatibility_test/run_compatibility_test.py

Effect of running said check against Godot Engine v4.6.dev.custom_build.63e14e13f:

Errors
$ ./tests/compatibility_test/run_compatibility_test.py
Compatibility test failed. Errors:
 ERROR: Method 'EditorFileDialog.set_file_mode' has changed and no compatibility fallback has been provided. Please open an issue.
   at: gdextension_classdb_get_method_bind (core/extension/gdextension_interface.cpp:1643)
Method bind not found: EditorFileDialog.set_file_mode (hash: 274150415)
ERROR: Method 'EditorFileDialog.get_file_mode' has changed and no compatibility fallback has been provided. Please open an issue.
   at: gdextension_classdb_get_method_bind (core/extension/gdextension_interface.cpp:1643)
Method bind not found: EditorFileDialog.get_file_mode (hash: 2681044145)
ERROR: Method 'EditorFileDialog.set_access' has changed and no compatibility fallback has been provided. Please open an issue.
   at: gdextension_classdb_get_method_bind (core/extension/gdextension_interface.cpp:1643)
Method bind not found: EditorFileDialog.set_access (hash: 3882893764)
ERROR: Method 'EditorFileDialog.get_access' has changed and no compatibility fallback has been provided. Please open an issue.
   at: gdextension_classdb_get_method_bind (core/extension/gdextension_interface.cpp:1643)
Method bind not found: EditorFileDialog.get_access (hash: 778734016)
ERROR: Method 'EditorFileDialog.set_display_mode' has changed and no compatibility fallback has been provided. Please open an issue.
   at: gdextension_classdb_get_method_bind (core/extension/gdextension_interface.cpp:1643)
Method bind not found: EditorFileDialog.set_display_mode (hash: 3049004050)
ERROR: Method 'EditorFileDialog.get_display_mode' has changed and no compatibility fallback has been provided. Please open an issue.
   at: gdextension_classdb_get_method_bind (core/extension/gdextension_interface.cpp:1643)
Method bind not found: EditorFileDialog.get_display_mode (hash: 3517174669)
ERROR: Index p_which = 1 is out of bounds (popup->get_item_count() = 1).
   at: _select (scene/gui/option_button.cpp:416)

Compatibility test against Godot4.5-stable failed

@Yarwin Yarwin requested review from a team as code owners December 8, 2025 10:54
@Yarwin Yarwin marked this pull request as draft December 8, 2025 10:54
@Yarwin Yarwin force-pushed the feature/improve-automated-checks-for-gdextension-compatibility branch 2 times, most recently from a115f26 to 49bf182 Compare December 8, 2025 10:56
@Yarwin Yarwin marked this pull request as ready for review December 8, 2025 10:57
@Yarwin Yarwin force-pushed the feature/improve-automated-checks-for-gdextension-compatibility branch 2 times, most recently from dba9425 to 6ed1267 Compare December 8, 2025 11:01
@AThousandShips AThousandShips added this to the 4.x milestone Dec 8, 2025
@Yarwin Yarwin force-pushed the feature/improve-automated-checks-for-gdextension-compatibility branch 2 times, most recently from 076b2da to 262f560 Compare December 8, 2025 12:10
@Yarwin Yarwin force-pushed the feature/improve-automated-checks-for-gdextension-compatibility branch 2 times, most recently from 5aaf1b6 to 2aad03c Compare December 8, 2025 12:43
Copy link
Copy Markdown
Contributor

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Overall, this looks really great to me - I've got only a few minor notes :-)

doc-test: true
proj-conv: true
api-compat: true
api-compat-load: true
Copy link
Copy Markdown
Contributor

@dsnopek dsnopek Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know that this needs its own variable? It could probably just use the pre-existing api-compat. But this up to the build system folks - maybe they'll like having a separate variable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reusing api-compat would indeed be preferable

Suggested change
api-compat-load: true

@Yarwin Yarwin force-pushed the feature/improve-automated-checks-for-gdextension-compatibility branch from 5d3831d to a255d3e Compare December 9, 2025 08:26
@Yarwin Yarwin requested a review from a team as a code owner December 9, 2025 08:26
@Yarwin Yarwin force-pushed the feature/improve-automated-checks-for-gdextension-compatibility branch from a255d3e to a468c31 Compare December 9, 2025 08:27
@Yarwin Yarwin force-pushed the feature/improve-automated-checks-for-gdextension-compatibility branch 2 times, most recently from 9b59968 to f9dd9ca Compare December 18, 2025 12:07
@Yarwin Yarwin force-pushed the feature/improve-automated-checks-for-gdextension-compatibility branch from f9dd9ca to d7df4a0 Compare December 18, 2025 14:42
Copy link
Copy Markdown
Contributor

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

From a GDExtension perspective, this looks great to me. :-) This still needs some review from the build system and CI folks, though

(FYI, the current test failures are just issues with downloading the ANGLE libs - I'll re-run the failed jobs after they finish)

@Yarwin Yarwin force-pushed the feature/improve-automated-checks-for-gdextension-compatibility branch from d7df4a0 to 8b656b6 Compare December 19, 2025 22:37
@Repiteo Repiteo self-requested a review January 5, 2026 17:13
Copy link
Copy Markdown
Contributor

@Repiteo Repiteo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very torn on this implementation. On one hand, unless there's a very good reason to do so, we should be using C++ instead of C. This would allow using the godot-cpp helper methods directly, which I think should be encouraged for any GDExtension test. On the other hand, this is meant to be as minimal as possible, so maybe the specialized setup is warranted here? I never realized how the lack of a godot-c equivalent forced direct reliance on the standard library.

doc-test: true
proj-conv: true
api-compat: true
api-compat-load: true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reusing api-compat would indeed be preferable

Suggested change
api-compat-load: true

@dsnopek
Copy link
Copy Markdown
Contributor

dsnopek commented Jan 5, 2026

On one hand, unless there's a very good reason to do so, we should be using C++ instead of C. This would allow using the godot-cpp helper methods directly, which I think should be encouraged for any GDExtension test. On the other hand, this is meant to be as minimal as possible, so maybe the specialized setup is warranted here?

Personally, I think using C (or at least not using godot-cpp) here is the right choice. If this test used godot-cpp, it wouldn't really use any of its helpers (maybe just loading the interface functions?), and would still be implemented pretty much the exact same way as it is now. All we would get is slower build times and the potential for godot-cpp changes/bugs to break the test.

 ====

 - Create minimal GDExtension which tries to load methods specified in a
   gdextension_api.json.

 - Run said GDExtension in the CI.
@Yarwin Yarwin force-pushed the feature/improve-automated-checks-for-gdextension-compatibility branch from 8b656b6 to e517509 Compare January 6, 2026 07:31
@Yarwin Yarwin requested a review from Repiteo January 15, 2026 16:19
@akien-mga akien-mga requested a review from a team February 6, 2026 11:59
Copy link
Copy Markdown
Contributor

@Repiteo Repiteo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some reservations on this not being in a separate repo, but having this check in place is more pertinent. Sorry for the wait, and great job!

@Repiteo Repiteo modified the milestones: 4.x, 4.7 Feb 6, 2026
@Repiteo Repiteo merged commit ff7d5cb into godotengine:master Feb 6, 2026
20 checks passed
@Repiteo
Copy link
Copy Markdown
Contributor

Repiteo commented Feb 6, 2026

Thanks!

rivie13 pushed a commit to rivie13/Phoenix-Agentic-Engine that referenced this pull request Feb 16, 2026
…omated-checks-for-gdextension-compatibility

Improve automated checks for GDExtension compatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve automated checks for GDExtension compatibility

4 participants