aardappel / lobster

The Lobster Programming Language

Home Page:http://strlen.com/lobster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build fail for webassembly

neosaldina opened this issue · comments

Hi
I'm trying lobster on Debian, I just install the last emscript and when I try to build, I got this error:

make: *** No rule to make target '../compiled_lobster/src/compiled_lobster.o', needed by 'cpp'. Stop.

Did you follow The Wasm implementation does not support the JIT, so you should first compile your .lobster code to C++, as described in the section “Compiling Lobster code to C++” below. as it says in http://aardappel.github.io/lobster/implementation.html ?

Hi!
Yeap, my mistake... it works now, but, the sample "guitest.lobster" don't work on WASM

Well, with ImGUI, a error occurs too

~/lobster/dev/emscripten$ emrun --serve_root . --no_browser lobster.html --verbose
Web server root directory: /home/lobster/dev/emscripten
Starting web server: http://0.0.0.0:6931/
Now listening at http://0.0.0.0:6931/
Entering web server loop.
POST: "/stdio.html" (path: "/stdio.html", query: "")
POST: "/stdio.html" (path: "/stdio.html", query: "")
ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile vertex shader!
POST: "/stdio.html" (path: "/stdio.html", query: "")
POST: "/stdio.html" (path: "/stdio.html", query: "")
ERROR: 0:1: '150' : client/version number not supported
ERROR: 0:3: 'in' : storage qualifier supported in GLSL ES 3.00 and above only
POST: "/stdio.html" (path: "/stdio.html", query: "")
POST: "/stdio.html" (path: "/stdio.html", query: "")
ERROR: 0:4: 'in' : storage qualifier supported in GLSL ES 3.00 and above only
POST: "/stdio.html" (path: "/stdio.html", query: "")
POST: "/stdio.html" (path: "/stdio.html", query: "")
ERROR: 0:5: 'in' : storage qualifier supported in GLSL ES 3.00 and above only
ERROR: 0:6: 'out' : storage qualifier supported in GLSL ES 3.00 and above only
ERROR: 0:7: 'out' : storage qualifier supported in GLSL ES 3.00 and above only
POST: "/stdio.html" (path: "/stdio.html", query: "")

POST: "/stdio.html" (path: "/stdio.html", query: "")
ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile fragment shader!
POST: "/stdio.html" (path: "/stdio.html", query: "")
ERROR: 0:1: '150' : client/version number not supported
POST: "/stdio.html" (path: "/stdio.html", query: "")
ERROR: 0:3: 'in' : storage qualifier supported in GLSL ES 3.00 and above only
POST: "/stdio.html" (path: "/stdio.html", query: "")
POST: "/stdio.html" (path: "/stdio.html", query: "")
ERROR: 0:3: '' : No precision specified for (float)
POST: "/stdio.html" (path: "/stdio.html", query: "")
POST: "/stdio.html" (path: "/stdio.html", query: "")
POST: "/stdio.html" (path: "/stdio.html", query: "")
ERROR: 0:4: 'in' : storage qualifier supported in GLSL ES 3.00 and above only
ERROR: 0:4: '' : No precision specified for (float)
ERROR: 0:5: 'out' : storage qualifier supported in GLSL ES 3.00 and above only
ERROR: 0:5: '' : No precision specified for (float)
POST: "/stdio.html" (path: "/stdio.html", query: "")
POST: "/stdio.html" (path: "/stdio.html", query: "")
ERROR: 0:8: 'texture' : no matching overloaded function found
POST: "/stdio.html" (path: "/stdio.html", query: "")
POST: "/stdio.html" (path: "/stdio.html", query: "")
POST: "/stdio.html" (path: "/stdio.html", query: "")
POST: "/stdio.html" (path: "/stdio.html", query: "")

ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to link shader program! (with GLSL '#version 150
')
Must have a compiled vertex shader attached.
exception thrown: TypeError: cb is undefined,_glEnableVertexAttribArray@http://localhost:6931/lobster.js:1:232177
ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int)@http://localhost:6931/lobster.wasm:wasm-function[2320]:0x157484
AddIMGUI(lobster::NativeRegistry&)::$_4::__invoke(lobster::Value*&, lobster::VM&)@http://localhost:6931/lobster.wasm:wasm-function[4525]:0x26289f
compiled_entry_point@http://localhost:6931/lobster.wasm:wasm-function[2064]:0x11cb99
main@http://localhost:6931/lobster.wasm:wasm-function[2992]:0x19ac9e
instrumentWasmExports/</ret[x]@http://localhost:6931/lobster.js:1:250913
handleSleep/<@http://localhost:6931/lobster.js:1:252615
callUserCallback@http://localhost:6931/lobster.js:1:98855
safeSetTimeout/<@http://localhost:6931/lobster.js:1:109344

I would think the "Dear ImGUI" code has been tested with Wasm before, though maybe in this case it is doing things which expect desktop OpenGL 3. Would have to check if there is a WebGL 2 specific version we can link in instead.

Generally, the OpenGL code in Lobster treads a fine balance only doing things supported by desktop GL 3, GL ES 3, and WebGL 2, but occasionally that fails.

Just for testing, I would use one of the simpler graphical examples, such as pythtree.lobster or whatever.

What's the error/problem with guitest.lobster ?

The pythtree works well ( slow but works )

image

About the guitest.lobster, this is the error:

emrun --serve_root . --no_browser lobster.html --verbose
Web server root directory: /home/lobster/dev/emscripten
Starting web server: http://0.0.0.0:6931/
Now listening at http://0.0.0.0:6931/
Entering web server loop.
POST: "/stdio.html" (path: "/stdio.html", query: "")
POST: "/stdio.html" (path: "/stdio.html", query: "")
POST: "/stdio.html" (path: "/stdio.html", query: "")
exception thrown: RuntimeError: indirect call signature mismatch,compiled_entry_point@http://127.0.0.1:6931/lobster.wasm:wasm-function[2065]:0x11e8ea
main@http://127.0.0.1:6931/lobster.wasm:wasm-function[2993]:0x19d94a
instrumentWasmExports/</ret[x]@http://127.0.0.1:6931/lobster.js:1:250913
handleSleep/<@http://127.0.0.1:6931/lobster.js:1:252615
callUserCallback@http://127.0.0.1:6931/lobster.js:1:98855
safeSetTimeout/<@http://127.0.0.1:6931/lobster.js:1:109344

@neosaldina ok, fixed the issue with guitest.lobster here: adeec67

@neosaldina imguitest.lobster now also works with this fix: ec39891

Thanks for reporting!