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

Build & run errors with latest wasm tools #69

Open
aardappel opened this issue Dec 21, 2017 · 7 comments
Open

Build & run errors with latest wasm tools #69

aardappel opened this issue Dec 21, 2017 · 7 comments

Comments

@aardappel
Copy link

I'm sure this has something to do with me using tools from https://wasm-stat.us/waterfall, but wanted to report it anyway just in case any of these problems are worth fixing:

First, I got:

ERROR:root:We cannot build the native system library in "/usr/local/google/home/wvo/.emscripten_ports/binaryen/binaryen-version_39" when under the influence of emmake/emconfigure. To avoid this, create system dirs beforehand, so they are not auto-built on demand. For example, for binaryen, do "python embuilder.py build binaryen" 

Thanks to the helpful error message that was quick to fix, but I wasn't expecting this when running make.

Second, I had to add -DEMSCRIPTEN=1 to the Makefile to make it build. Not sure where this normally comes from.

Then when running, it manages to init most of the engine, when it gets to:

Uncaught TypeError: BananaBread.setPlayerModelInfo is not a function
at Object.Module.setPlayerModels (http://localhost:6931/game/setup_low.js:4:15)
at eval (eval at _emscripten_run_script (http://localhost:6931/bb.js:13402:2), <anonymous>:1:26)
at _emscripten_run_script (http://localhost:6931/bb.js:13402:2)
at _ZL5main3Pv (wasm-function[3512]:487)
at dynCall_vi (wasm-function[4126]:5)
at Object.Module.dynCall_vi (http://localhost:6931/bb.js:15027:37)
at Object.func (http://localhost:6931/bb.js:8931:24)
at Browser_mainLoop_runner (http://localhost:6931/bb.js:4612:12)                                                                                               

There's also still quite a few warnings that may have popped up because of the recent clang, and some messages saying it can't find SDL_Image and similar, but that doesn't appear to prevent it from building.

@kripken
Copy link
Owner

kripken commented Dec 21, 2017

Thanks to the helpful error message that was quick to fix, but I wasn't expecting this when running make.

I blame that one on the Cube2 build system running ENet's configure step during make ;)

Second, I had to add -DEMSCRIPTEN=1 to the Makefile to make it build. Not sure where this normally comes from.

I think we used to define that, and still do for compatibility's sake in the asm.js backend. Anyhow, the we should use the proper __EMSCRIPTEN__ define instead. I fixed that now.

I do see a runtime failure though, so something seems to have broken here.

@aardappel
Copy link
Author

Hey, maybe @lsalzman could fix that then :P

@aardappel
Copy link
Author

You missed some, e.g. engine/main.cpp:604

@kripken
Copy link
Owner

kripken commented Dec 22, 2017

Thanks, fixed. Also fixed some options that needed updating after recent emscripten changes. It now works in -O2, but not -Os (which uses the new metadce stuff, which apparently has a bug).

@kripken
Copy link
Owner

kripken commented Dec 22, 2017

Ok, I figured out the JSDCE bug, fix is in emscripten-core/emscripten#5965 . That replaces the previous PR, which was not correct.

With the later PR in emscripten, everything looks ok, at least using the default asm2wasm path. Does it work with the wasm backend too?

@aardappel
Copy link
Author

With Emscripten and BananaBread from today, building now works fine, running still gives TypeError: Module.FS_createPath is not a function.

@kripken
Copy link
Owner

kripken commented Dec 29, 2017

Ah, that's a recent filesystem emulation change on emscripten. Fixed on master now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants