Skip to content

Validate that api-custom is run for Godot Debug binary #1071

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

Merged
merged 1 commit into from
Mar 11, 2025

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented Mar 11, 2025

When compiling an api-custom with GODOT4_BIN pointing to a release version of Godot (e.g. export template), then

  • a UI popup (yes) appears during the build
  • the error is printed: Error: Couldn't load project data at path ".". Is the .pck file missing?

This unhelpful error appears because Godot doesn't know command-line arguments such as --dump-extension-api in Release mode, and simply ignores those -- interpreting the CLI invocation to be a call to run Godot itself.


This PR checks for Release builds and panics in that case, with a better error message and no popup.

For the future, I plan a feature api-custom-json. This would allow users to specify an environment variable such as GODOT4_GDEXTENSION_JSON pointing to a file, which is then used to generate code instead of the binary. Maybe in addition to a known C header. This could then also be a step towards #951.

Necessary because Release builds (export templates) don't provide
flags like `--dump-extension-api` and provide weird errors instead.
@Bromeon Bromeon added quality-of-life No new functionality, but improves ergonomics/internals c: tooling CI, automation, tools labels Mar 11, 2025
@Bromeon Bromeon enabled auto-merge March 11, 2025 22:04
@Bromeon Bromeon added this pull request to the merge queue Mar 11, 2025
Merged via the queue into master with commit 489b1f1 Mar 11, 2025
17 checks passed
@Bromeon Bromeon deleted the qol/check-godot-debug-binary branch March 11, 2025 22:14
@GodotRust
Copy link

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

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.

2 participants