-
Notifications
You must be signed in to change notification settings - Fork 47
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
Linking fails with Emscripten #86
Comments
Dug more into this, that unknown type name was due to the Zig library not having the correct headers - the Lua library did have the right ones but the Zig library was including some of Lua's C files directly and calling into them which makes sense. The next issue I found though is harder to work around:
In POSIX mode it can't seem to find It's possible to work around this by modifying ziglua's build.zig file to turn off Lua error handling, but that does not seem to be ideal. Turning off the error handling can be done by adding the following to the Lua build flags:
|
I pushed a 0.3.0 release to ziglua earlier today and then I was thinking about this issue. Thanks for digging into it a bit more! Yeah I was thinking about how there are functions not available in wasm. We may need a new build option to enable/disable things :) |
Thinking about this more, maybe what is needed is a way to modify the Lua build flags by the upstream builder pulling in the ziglua dependency. The sokol-zig project does something like this when linking against emscripten, there's an |
Is this the only thing you needed to get it working with emscripten? Interrupt@3d7532e |
Yes, but that is a super hacky solution! It turns off all of the debug printing amongst other stuff. |
@Interrupt In case it's useful: I got one of the examples running in a browser w/ Luau by lifting a bunch of build code from sokol-zig and switching both compilation (unlike sokol-zig) and linking (like sokol-zig) to invoke edit: Lua 5.x seems to work too now |
When making a web build for Emscripten, and linking ziglua with the Emscripten system headers, linking fails with an error like:
This might be because
-DLUA_USE_POSIX
is passed in build.zig for all unknown targets, and the WASM case isn't handled.The text was updated successfully, but these errors were encountered: