You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS/device including version:
Arch Linux (rolling release) on Linux Kernel 5.9.10 (please let me know if you need more information as I'm unsure what to include here).
Issue description:
I wanted to try out the new GDNative support for HTML5 builds (https://godotengine.org/article/godot-web-export-progress-report-4, #44076) for my game, which is using Rust via the godot-rust bindings (https://github.com/godot-rust/godot-rust). I managed to compile a .wasm library using emscripten, but after trying to load the game on the browser I just got a blank page with the spinner wheel and the following errors on the console:
On Firefox 83:
Assertion failed: need the dylink section to be first tmp_js_export.js:9:16304
Uncaught (in promise) Error: undefined tmp_js_export.js:9:16407
Uncaught (in promise) Error: undefined tmp_js_export.js:9:16407
On Chromium 87:
Uncaught (in promise) RuntimeError: abort(Assertion failed: need the dylink section to be first). Build with -s ASSERTIONS=1 for more info.
at abort (http://localhost:8060/tmp_js_export.js:9:16407)
at assert (http://localhost:8060/tmp_js_export.js:9:6791)
at loadSideModule (http://localhost:8060/tmp_js_export.js:9:22451)
at http://localhost:8060/tmp_js_export.js:9:26930
at async Promise.all (index 1)
Assertion failed: need the dylink section to be first
Steps to reproduce:
Create a project with a minimal setup for GDNative compilation (a zip file is provided below).
Compile the native shared library as a wasm module via emscripten (steps provided for the Rust language and my linux distribution, ymmv)
After this, a .wasm file should be generated under rust/target/wasm32-unknown-emscripten/debug/rust_test.wasm
On the gdnlib resource, use the new HTML5 > wasm32 section and make it point to the wasm file generated on the previous step.
Open the Export panel (i.e. Project > Export). Download the export templates for the current version when prompted, if necessary. Finally set up a new HTML5 export and select GDNative on the Export Type dropdown.
Export the game and/or run it directly from the editor via the HTML5 run button. The aforementioned message will be dislpayed on the console.
The minimal reproduction project contains the following:
A simple scene, with a label and an initial text of "".
A RustTestScript node, with the native script attached.
This script exposes a get_test_message method, which simply returns a string.
A Control node, with a Main.gd script attached.
This script calls get_test_message on the native script, and sets the Label's text to it.
This has been tested to work with a regular desktop build under 64 bit Linux. Based on experience from my own project, it should work just as fine in other platforms as well (e.g. never had trouble building like this on windows, for instance).
Note that, due to file size, I could not upload the build files, just the compiled wasm module. If anyone is interested in those just let me know, but they can still be regenerated with the procedure described above.
About the issue
I'm not sure if this is a bug on the Godot side, it could just be that I'm not building the wasm module correctly. But I'm nontheless reporting this because it may be helpful to diagnose a potential issue, and help other people looking into this with the same kind of problem.
If anything, I think the expected procedure to compile wasm gdnative modules for the HTML5 exporter should be documented. It's totally understandable that it still isn't, this was just released in a beta after all! 😅 I was hoping rasing thiss issue would help towards that goal.
The text was updated successfully, but these errors were encountered:
Godot version:
3.2.4.beta4.official
OS/device including version:
Arch Linux (rolling release) on Linux Kernel 5.9.10 (please let me know if you need more information as I'm unsure what to include here).
Issue description:
I wanted to try out the new GDNative support for HTML5 builds (https://godotengine.org/article/godot-web-export-progress-report-4, #44076) for my game, which is using Rust via the godot-rust bindings (https://github.com/godot-rust/godot-rust). I managed to compile a .wasm library using emscripten, but after trying to load the game on the browser I just got a blank page with the spinner wheel and the following errors on the console:
On Firefox 83:
On Chromium 87:
Steps to reproduce:
emsdk install latest && emsdk activate latest
(may require root privileges).wasm
file should be generated underrust/target/wasm32-unknown-emscripten/debug/rust_test.wasm
HTML5 > wasm32
section and make it point to the wasm file generated on the previous step.GDNative
on theExport Type
dropdown.Minimal reproduction project:
GDNative_Rust_Example.zip
The minimal reproduction project contains the following:
RustTestScript
node, with the native script attached.get_test_message
method, which simply returns a string.Control
node, with aMain.gd
script attached.get_test_message
on the native script, and sets the Label's text to it.This has been tested to work with a regular desktop build under 64 bit Linux. Based on experience from my own project, it should work just as fine in other platforms as well (e.g. never had trouble building like this on windows, for instance).
Note that, due to file size, I could not upload the build files, just the compiled wasm module. If anyone is interested in those just let me know, but they can still be regenerated with the procedure described above.
About the issue
I'm not sure if this is a bug on the Godot side, it could just be that I'm not building the wasm module correctly. But I'm nontheless reporting this because it may be helpful to diagnose a potential issue, and help other people looking into this with the same kind of problem.
If anything, I think the expected procedure to compile wasm gdnative modules for the HTML5 exporter should be documented. It's totally understandable that it still isn't, this was just released in a beta after all! 😅 I was hoping rasing thiss issue would help towards that goal.
The text was updated successfully, but these errors were encountered: