-
-
Notifications
You must be signed in to change notification settings - Fork 224
RFC: Rust considering switching to using WebAssembly exception handling #1119
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
Comments
Hello, Something that would make a larger difference would be full support for |
You can try it out now with
I didn't think that workaround was good enough since code gen for the
As far as I am aware, |
Thanks. This compiles, but gives me the following error on run: Chromium:
Firefox:
The error still occurs even if I add Do you have any ideas on this? Flags used were as follows [target.wasm32-unknown-emscripten]
rustflags = [
"-C", "link-args=-sSIDE_MODULE=2",
"-Zlink-native-libraries=no",
"-Zemscripten-wasm-eh"
# "-Cllvm-args=-enable-emscripten-cxx-exceptions=0", # uncommenting doesn't help
]
The workaround very much worked for our purposes. The problem is that upstream Godot switched to Wasm exceptions, so our code compiled with old / js exceptions wouldn't even run because it would expect functions named By using your workaround, the compiled code would successfully run alongside Godot, as it wouldn't generate those calls to That is, solving unwinding panic was only secondary compared to making the code run in the first place, haha.
I just tested it and it's still aborting regardless, but I'm not using |
Well I built it successfully with:
|
Do you have a Godot project ready? The instructions are here (particularly "Godot editor setup" to run it): https://godot-rust.github.io/book/toolchain/export-web.html (this assumes you have a project: https://godot-rust.github.io/book/intro/index.html) Let me know if you need help. If needed, I can try to upload my own project soon. You can also try to start with this (now outdated) base project: https://github.com/PgBiel/hello-gdext-wasm |
From a project management PoV, is there something concrete and actionable for godot-rust in the near future? Otherwise I'd probably close this issue, to focus the task tracker on active problems to work on. The discussion can of course continue here, either way! 🙂 |
In principle I'd wait for feedback by @hoodmane before further decision. It'd be nice if we could get this to work, but let's see how their testing goes. |
I'm still planning to get back to this and test it. If someone could give me a known currently working hello world project to build that would be helpful. Because as I understand it the problem only occurs at load time. I think the problem is that the main Godot engine binary also needs to be built with wasm error handling and not legacy error handling. Wasm eh has smaller code, better performance, and fewer bugs so it would be helpful to everyone if we can get it working. |
Sounds good. While https://github.com/PgBiel/hello-gdext-wasm is a good reference project, it is currently not up-to-date with Godot (made with Godot 4.2, latest version is 4.4). I'm currently very busy with other tasks, but in the upcoming week I'll try to update it and let you know. |
Rust is considering switching to using WebAssembly exception handling. See this major change proposal. We will initially leave in nightly support for opting out. How would such a change affect this project?
The text was updated successfully, but these errors were encountered: