-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
Exported game panics due to missing ResourceImporterOggVorbis
methods
#489
Comments
Which |
The latest, 8ec6a22. |
cc @Bromeon This seems to be a more serious issue than initially thought. I don't think anybody can export a project right now,
use godot::prelude::*;
struct MyExtension;
#[gdextension]
unsafe impl ExtensionLibrary for MyExtension {}
#[derive(GodotClass)]
#[class(init, base=Node)]
struct Player {
speed: f64,
angular_speed: f64,
#[base]
base: Base<Node>
} The game will export, but attempting to play the exported project will result in a panic. I am not using It's not an issue of the library missing, since if the library isn't found, it will report a missing library:
In fact, just merely registering the library seems to cause this issue, no actual Looking into the MethodBind *mb = ClassDB::get_method_with_compatibility(classname, methodname, p_hash, &exists);
|
Additionally: There is an issue that that code block calls out given here: godotengine/godot#81386 It references the In the "Steps to reproduce" of the issue it says:
Upon the issue being opened A dialogue occurred which is very above my understanding, from what I can tell it was about a hashing function error that prevented access to compatibility methods therefore breaking gdextension's ability to provide an integration point. (double check this though 😂) At least two fixes were discussed and gdextension held a meeting, picked the solution, and opened this pr. In that pr we find a portion of the broken code block. https://github.com/godotengine/godot/pull/81521/files#diff-75926029058e1a3a1999b3709fc144c7b1227af5a023f3dab87c0a07d1e07f26R1148-R1158 And we find @Bromeon commenting 😂. I didn't expect to find that when I started following threads. But maybe you know more about this issue. Is the fix broken? Are other gdextention consumers experiencing issues? |
@0awful I'm not sure if the issue is related. godotengine/godot#81386 is specifically about default parameters -- but @Lemiczek Thanks, interesting to see that this happens also without This can probably be reproduced with a Godot release build (i.e. without the editor). I have the suspicion that such builds exclude some symbols? That particular seems to be registered, so I wonder if it's a weird edge case of conditionally disabled code? Or maybe the function is registered, but under a different hash in release mode? Would need some debugging... As an anecdote, there were a few cases of missing methods in GDExtension before. If this is the case, all other bindings (godot-cpp etc) will break as well, but they defer the error to runtime, when calling this method. If so, it should be fixed upstream in Godot and not in godot-rust; see also my position on this matter. |
Yes, I've used Godot 4.2-stable and downloaded and used the export template for 4.2. I've done a sanity check by providing the debug |
Can confirm I encounter this same error while trying to run an exported project in either Windows or Ubuntu. I am not using the custom-godot feature. |
@Xylord and others: Can you try enabling the |
@PgBiel Nice brainwave, compiling with |
I can confirm, compiling with This is still something we should fix without explicitly calling the feature though, at least we have more of an understanding on what's going on. 👍 |
Yeah, while that "fixes" it it just moves errors to runtime. If you happen to use one of the functions that are not available, it will work fine on your development machine, and explode on the player's machine. Not recommended. |
Are the unavailable functions limited to |
It's likely that there are many others, yes. Will need to reproduce this at some point and see if there's a pattern. |
Seems like there is a problem only with Commented out the panic , on exporting and running the game got the following dump
Can replicate the problem with this repository example
|
I am not using custom Godot, just regular Godot 4.2.1, with the latest Godot rust commit. Prior to using After using For reference, here are the errors before using
|
I can't reproduce it on Windows 10. Can you guys try with the dodge-the-creeps example from the repo?
(with I tried running it both directly with the official 4.2.1 export templates, and exporting it from the official 4.2.1 stable editor. Everything seems to work as expected. |
@Bromeon can you try the steps listed above. |
I did as you said. Upon starting the game the output below pops up in the console. I had to modify the dodge the creeps project a bit to get it to run. First, in Cargo.toml, I changed the godot dependency to: Second, in the .gdextension file, I moved the .dll files to a bin folder in the godot directory, and pointed the .gdextension path there: The game seems to work properly in-editor.
It's probably worth noting that the library was compiled on WSL1 (Linux Ubuntu) using |
Thanks @coder137 and @Xylord, I overlooked that the default dependencies of Changed its [dependencies]
godot = { path = "../../../godot" }
rand = "0.8" And built with:
Then indeed, I can reproduce it! 👍 ERROR: Parameter "mb" is null.
at: gdextension_classdb_get_method_bind (core/extension/gdextension_interface.cpp:1347)
ERROR: Rust function panicked in file godot-ffi\src\toolbox.rs at line 249. Context: failed to initialize GDExtension level `Scene`
at: <function unset> (godot-core\src\lib.rs:159)
ERROR: Panic msg:
Failed to load class method ResourceImporterOggVorbis::load_from_buffer (hash 354904730).
Make sure gdext and Godot are compatible: https://godot-rust.github.io/book/gdext/advanced/compatibility.html
at: <function unset> (godot-core\src\lib.rs:105)
ERROR: Cannot get class 'Main'.
at: (core/object/class_db.cpp:358)
WARNING: Node Main of type Main cannot be created. A placeholder will be created instead.
at: instantiate (scene/resources/packed_scene.cpp:254)
ERROR: Cannot get class 'Player'.
... So that's a start 🙂 |
Confirmed with Godot developers and tracked as godotengine/godot#86206. I will implement a workaround in gdext, until there is an official way to know about methods that are unavailable in Release mode. |
(Enabling the Edit: As suggested on Discord, the errors disappear after enabling the diff --git a/examples/dodge-the-creeps/rust/Cargo.toml b/examples/dodge-the-creeps/rust/Cargo.toml
index c45f9d4..e709ba0 100644
--- a/examples/dodge-the-creeps/rust/Cargo.toml
+++ b/examples/dodge-the-creeps/rust/Cargo.toml
@@ -9,5 +9,5 @@ publish = false
crate-type = ["cdylib"]
[dependencies]
-godot = { path = "../../../godot", default-features = false, features = ["experimental-wasm"] }
+godot = { path = "../../../godot", default-features = false, features = ["custom-godot"] }
rand = "0.8" E 0:00:00:0392 gdextension_classdb_get_method_bind: Parameter "mb" is null.
<C++ Source> core/extension/gdextension_interface.cpp:1347 @ gdextension_classdb_get_method_bind()
E 0:00:00:0392 <function unset>: Rust function panicked in file godot-ffi/src/toolbox.rs at line 249. Context: failed to initialize GDExtension level `Scene`
<C++ Source> godot-core/src/lib.rs:159 @ <function unset>()
E 0:00:00:0392 <function unset>: Panic msg:
Failed to load class method AnimationPlayer::set_process_callback (hash 1663839457).
Make sure gdext and Godot are compatible: https://godot-rust.github.io/book/gdext/advanced/compatibility.html
<C++ Source> godot-core/src/lib.rs:105 @ <function unset>()
E 0:00:00:0434 instantiate: Cannot get class 'Main'.
<C++ Error> Parameter "ti" is null.
<C++ Source> core/object/class_db.cpp:358 @ instantiate()
E 0:00:00:0434 instantiate: Cannot get class 'Player'.
<C++ Error> Parameter "ti" is null.
<C++ Source> core/object/class_db.cpp:358 @ instantiate()
E 0:00:00:0434 connect: In Object of type 'Node': Attempt to connect nonexistent signal 'body_entered' to callable 'Node::on_player_body_entered'.
<C++ Error> Condition "!signal_is_valid" is true. Returning: ERR_INVALID_PARAMETER
<C++ Source> core/object/object.cpp:1344 @ connect()
E 0:00:00:0434 instantiate: Cannot get class 'Hud'.
<C++ Error> Parameter "ti" is null.
<C++ Source> core/object/class_db.cpp:358 @ instantiate() |
ResourceImporterOggVorbis
methods
I have been encountering the following panic when running exported games using the
custom-godot
feature:This same issue seems to happen when using the
custom-godot
feature with the example extension. Here are the steps that I have verified to reproduce the issue (I have only checked on Windows, I can check on Linux too if that would be helpful):editor
andtemplate_debug
targets for custom godot version (I am using ad72de508 , corresponding to 4.2 rc1).GODOT4_BIN
environment variable at the custom editor buildcustom-godot
feature inexamples/dodge-the-creeps/rust/Cargo.toml
and runcargo build
.template_debug
to export a Windows Desktop build of thedodge-the-creeps
example.The text was updated successfully, but these errors were encountered: