Skip to content
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

imported shared memory but unshared required #1103

Closed
mathiasplans opened this issue Apr 30, 2023 · 4 comments · Fixed by #1247
Closed

imported shared memory but unshared required #1103

mathiasplans opened this issue Apr 30, 2023 · 4 comments · Fixed by #1247
Labels
documentation platform:web topic:gdextension This relates to the new Godot 4 extension implementation

Comments

@mathiasplans
Copy link

mathiasplans commented Apr 30, 2023

I get an error when trying the "GDExtension C++ example" from docs on HTML5 platform. The example works as expected on Windows platform.

The console output on Firefox:

imported shared memory but unshared required
    displayFailureNotice http://localhost:8000/web0/web0.html:212
    (Async: promise callback)
    <anonymous> http://localhost:8000/web0/web0.html:239
    <anonymous> http://localhost:8000/web0/web0.html:244

On Chrome:

WebAssembly.instantiate(): mismatch in shared state of memory, declared = 0, imported = 1
    displayFailureNotice http://localhost:8000/web0/web0.html:212
    (Async: promise callback)
    <anonymous> http://localhost:8000/web0/web0.html:239
    <anonymous> http://localhost:8000/web0/web0.html:244

Important to note that I changed the tools/javascript.py because of the problem in the issue #1081. I'm using emscripten (3.1.5~dfsg-3ubuntu1) on WSL.

@Calinou
Copy link
Member

Calinou commented Apr 30, 2023

To my knowledge, GDExtension isn't supported on HTML5 yet.

@paddy-exe
Copy link
Contributor

@Calinou is right. GDExtensions for Web don't work since there is still a dependancy issue with Emscripten for web export.

Related: #554

@Calinou Calinou added topic:gdextension This relates to the new Godot 4 extension implementation documentation labels Apr 30, 2023
@mathiasplans
Copy link
Author

I tried a newer version (3.1.37) as well as the version that the engine's CI uses (2.0.27). Both still have the same problem. I guess there are no easy work-arounds.

@Esption
Copy link

Esption commented Jul 22, 2023

@mathiasplans Not that I think support is working, but this is a different issue. How did you compile the example exactly? You'll need to pass -sSIDE_MODULE=2 -sSHARED_MEMORY=1 (and possibly pthread, atomics, mutable-globals flags) to emscripten. That error is basically just complaining that not every module has the same state for shared_memory, and the godot side of things is compiled with it on, so you need to compile your gdextension with it on too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation platform:web topic:gdextension This relates to the new Godot 4 extension implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants