Skip to content

Fix api-custom build when prebuilt lags detected Godot version - #1649

Merged
Bromeon merged 1 commit into
masterfrom
bugfix/api-custom-unresolved-symbols
Jun 28, 2026
Merged

Fix api-custom build when prebuilt lags detected Godot version#1649
Bromeon merged 1 commit into
masterfrom
bugfix/api-custom-unresolved-symbols

Conversation

@Bromeon

@Bromeon Bromeon commented Jun 27, 2026

Copy link
Copy Markdown
Member

With api-custom, godot-rust reuses the shipped prebuilt gdextension_interface.json unless the Godot binary is newer than the prebuilt covers. That check used the hand-maintained LATEST_API_VERSION constant, which can run ahead of the currently used default version (e.g. latest 4.7, default 4.6). A 4.7 binary then got the stale 4.6 interface, missing functions like classdb_construct_object3, resulting in a not very helpful no field ... error message.

This instead reads the prebuilt JSON itself and parses the maximum value of the since fields, dumping from the binary whenever it is ahead. Also adds a codegen guard that fails early when a required interface function is missing for the detected API version.

Fixes #1646.

With `api-custom`, godot-rust reuses the shipped prebuilt `gdextension_interface.json`,
unless the Godot binary is newer than the prebuilt covers. That check used the
hand-maintained `LATEST_API_VERSION` constant, which can be ahead of the currently
used default version (e.g. latest 4.7, default 4.6).

A 4.7 binary then got the stale 4.6 interface, missing functions like
`classdb_construct_object3`, resulting in a not very helpful `no field ...` error message.
@GodotRust

Copy link
Copy Markdown

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

@Bromeon
Bromeon added this pull request to the merge queue Jun 28, 2026
Merged via the queue into master with commit 770cf1a Jun 28, 2026
17 checks passed
@Bromeon
Bromeon deleted the bugfix/api-custom-unresolved-symbols branch June 28, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug c: tooling CI, automation, tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compiling 0.5.4 with api-custom feature over godot 4.7 reports an error

2 participants