Giter Site home page Giter Site logo

Comments (5)

kripken avatar kripken commented on August 22, 2024

To fix that error, the error message suggests this, which should work:

warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`

What you suggest about just running WebAssembly.instantiateStreaming would work for pure wasm, but not for the JS that works with it. In some cases you can get close to not having any JS, see here, but until wasm has access to JS objects it will depend on JS heavily for a lot of things.

from box2d.js.

mysterycommand avatar mysterycommand commented on August 22, 2024

Hey, thanks for getting back to me! I'll give that a try. I didn't initially because disable errors sounds a little like suppress errors and I was hoping there would be an obvious way to actually fix them?

Anyway, I'll give that a try and do a bit more reading about how importObject and JS/WASM interop works.

from box2d.js.

kripken avatar kripken commented on August 22, 2024

Yeah, fixing the errors would be better, if you or someone has time to look into them. (Maybe a file isn't linked in, for example?) But that option would get us to the same behavior emscripten had before, so it's not making things worse.

from box2d.js.

mysterycommand avatar mysterycommand commented on August 22, 2024

Okay, I forked this and created a branch that you can see in this comparison. I broke the LINK_OPTS out to multiple lines so they'd be a little easier to read and added the -s ERROR_ON_UNDEFINED_SYMBOLS=0 like you suggested.

Running $ /Users/matt/Sites/juj/emsdk/emscripten/1.38.16/emmake make VERSION=latest does generate a new build/Box2D_v2.3.1_min.wasm file, but that's it … the output ends with:

11 error(s), 5 warning(s)
ERROR:root:closure compiler failed (rc: 11)
make: *** [box2d.js] Error 1

There are several giant blocks of what looks like minified JavaScript with what look like more specific error messages in there … they look like this:

                                                                                                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/tmp/tmpma5o38/Box2D_v2.3.1_min.bc.o.js.pp.js.mem.js.jso.js.jso.js.jso.js:1: ERROR - variable _emscripten_bind_b2Vec3_b2Vec3_2 is undeclared

… but there's several thousand lines between them and my grep juju is failing me right now.

As far as actually fixing the errors I'd be happy to try and figure this out, but any pointers as to where they'd need to be linked in? This whole set up is new to me and between the Python and the C++ and the generated files and the IDLs and the make scripts … I'm kinda lost. I am fully willing to accept that I may be trying to bite off more than i can chew.

from box2d.js.

kripken avatar kripken commented on August 22, 2024

Closure compiler issues like that are tricky to debug in my experience. But you can build without closure and look for why that function isn't defined - it should be emitted from the webidl binder emitter, I think, so it's not a linking problem.

It's possible this isn't a bug here, but in the upstream webidl binder emitter - if you can get a standalone testcase showing the issue that could prove that.

However, another option is to set -s IGNORE_CLOSURE_COMPILER_ERRORS=1 to ignore those.

from box2d.js.

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.