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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Godot version check + workaround for API generation bug #838
Conversation
4304344
to
b9ac0ac
Compare
Where I was unsure: the whole version logic is in a separate file, to prevent build.rs from growing too much. The problem is, there seems to be no agreed-upon best practice regarding build script separation. Current approach is this (in build.rs): #[cfg(feature = "custom-godot")]
mod godot_version {
include!("src/godot_version.rs");
} I also tried the following, but my build step got stuck in an endless loop: #[path = "src/godot_version.rs"]
mod godot_version; Ideas? Would also be nice if the tests in bors try |
tryBuild succeeded! And happy new year! 馃帀 |
Perhaps the logic can be put into |
b9ac0ac
to
a10f6d6
Compare
@chitoyuu Great idea, I moved it to I also set up a mass CI test for all 3.x versions: https://github.com/Bromeon/godot-rust/actions/runs/1646049051
Godot 4 is not available for download, but I tested it locally, also rejected. |
bors r+ |
838: Godot version check + workaround for API generation bug r=Bromeon a=Bromeon As mentioned in #833, Godot versions < 3.3.1 were subject to [a bug](godotengine/godot#48081) that caused non-deterministic crashes during the command: ``` godot --gdnative-generate-json-api api.json ``` For users working with affected Godot versions (e.g. 3.2), this makes the feature flag `custom-godot` annoying to use, since they can't rely on the API generation to succeed -- let alone use it for automation/CI. This PR works around that by retrying the command up to 10 times (magic number). I changed the minimum supported Godot version in our own CI again to 3.2, meaning that if it _doesn't_ work, we have to suffer, too 馃槵 Additionally, this PR parses the Godot version and emits a meaningful error message if an unsupported version is detected (3.1 or 4.0). Co-authored-by: Jan Haller <bromeon@gmail.com>
Build failed: |
Move logic from build.rs to bindings_generator
a10f6d6
to
8c7c84a
Compare
bors r+ |
Build succeeded: |
As mentioned in #833, Godot versions < 3.3.1 were subject to a bug that caused non-deterministic crashes during the command:
For users working with affected Godot versions (e.g. 3.2), this makes the feature flag
custom-godot
annoying to use, since they can't rely on the API generation to succeed -- let alone use it for automation/CI. This PR works around that by retrying the command up to 10 times (magic number). I changed the minimum supported Godot version in our own CI again to 3.2, meaning that if it doesn't work, we have to suffer, too 馃槵Additionally, this PR parses the Godot version and emits a meaningful error message if an unsupported version is detected (3.1 or 4.0).