Giter Club home page Giter Club logo

Comments (5)

DmitriySalnikov avatar DmitriySalnikov commented on July 22, 2024 3

but instead with whichever version @DmitriySalnikov used for the 1.4.2 release

3.1.39 as mentioned here.

And I finally found what the problem was!
I even managed to launch the project in Firefox. (thanks to the emscripten update?)

image

image

LinkError: WebAssembly.instantiate(): Import #62 "env" "memory": mismatch in shared state of memory, declared = 1, imported = 0

The mismatch between shared and non-shared memory directly depends on threads support.

image

I can reproduce the issue with the MRP on Firefox with 4.3.beta3, with these errors:

Uncaught (in promise) LinkError: imported function 'env._ZNSt3__26chrono12steady_clock3nowEv' signature mismatch
still waiting on run dependencies: [tmp_js_export.js:46811:18](http://localhost:8060/tmp_js_export.js)

Yes, for some reason it is not possible to use std::chrono in my module and I had to switch to using Time::. I have not been able to solve this problem yet.
It seems that the standard libraries are not included in the SIDE_MODULE.

Here you can download .gdextension_libs with new libraries. And here Is an updated .gdextension.
These libraries should still be supported starting with godot 4.2.

from godot.

akien-mga avatar akien-mga commented on July 22, 2024

Which Emscripten version did you use to compile the GDExtension?

from godot.

cosformula avatar cosformula commented on July 22, 2024

Which Emscripten version did you use to compile the GDExtension?您使用哪个 Emscripten 版本来编译 GDExtension?

I use 3.1.62.

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.62-git
clang version 19.0.0git
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /opt/homebrew/Cellar/emscripten/3.1.62/libexec/llvm/bin

from godot.

akien-mga avatar akien-mga commented on July 22, 2024

I can reproduce the issue with the MRP on Firefox with 4.3.beta3, with these errors:

Uncaught (in promise) LinkError: imported function 'env._ZNSt3__26chrono12steady_clock3nowEv' signature mismatch
still waiting on run dependencies: [tmp_js_export.js:46811:18](http://localhost:8060/tmp_js_export.js)
dependency: loadDylibs [tmp_js_export.js:46811:18](http://localhost:8060/tmp_js_export.js)
(end of list) [tmp_js_export.js:46811:18](http://localhost:8060/tmp_js_export.js)
still waiting on run dependencies: [tmp_js_export.js:46811:18](http://localhost:8060/tmp_js_export.js)
dependency: loadDylibs [tmp_js_export.js:46811:18](http://localhost:8060/tmp_js_export.js)
(end of list) [tmp_js_export.js:46811:18](http://localhost:8060/tmp_js_export.js)
still waiting on run dependencies: [tmp_js_export.js:46811:18](http://localhost:8060/tmp_js_export.js)
dependency: loadDylibs [tmp_js_export.js:46811:18](http://localhost:8060/tmp_js_export.js)
(end of list) [tmp_js_export.js:46811:18](http://localhost:8060/tmp_js_export.js)
still waiting on run dependencies: [tmp_js_export.js:46811:18](http://localhost:8060/tmp_js_export.js)
dependency: loadDylibs [tmp_js_export.js:46811:18](http://localhost:8060/tmp_js_export.js)
(end of list)

Worth noting that the addons includes prebuilt binaries in the git repo. If you're using those instead of compiling your own, then they might not have been compiled with Emscripten 3.1.62, but instead with whichever version @DmitriySalnikov used for the 1.4.2 release. I tested updating to 1.4.3 and it still has the same issue.

One should test with a custom built extension using Emscripten 3.1.62 (like 4.3.beta3) or 3.1.63 (regression fix release, which we'll use for 4.3.rc1).

from godot.

cosformula avatar cosformula commented on July 22, 2024

Thanks to @DmitriySalnikov. On 4.3.beta3, I'm able to fixed this issue by building gdextensions using threads=no|yes and edit the .gdextension file like below:

...
web.wasm32.nothreads = "res://addons/xxx/bin/libxxx.web.template_debug.wasm32.nothreads.wasm"
web.wasm32 = "res://addons/xr/bin/libxxx.web.template_debug.wasm32.wasm"
...

Maybe we should add this sections to the gdextension tutorial?

from godot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.