-
Notifications
You must be signed in to change notification settings - Fork 68
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
add support for wasm32-wasi #245
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good apart from one minor change in a println.
Thanks for the PR! I have also been experimenting with adding support for wasi. I thought I managed at one point to get bindgen working, so I will do some testing with that before merging this. |
Really appreciate the work done here, do you know how we could make this work for the web ? I'm really curios about that. I' m currently working on a project where I'm in need of an isolated environment that is not an iframe or worker and QuickJS fits perfectly. |
@dejang the problem with compiling quickjs for web wasm is that there are currently some problems with packaging c libraries which require libc. The default wasm target used by rust is For more reference see rustwasm/team#291 |
Thank you @DelSkayn, that actually makes a lot of sense. |
This makes build.rs download wasi-sys if building for wasm32-wasi target. The logic is copied from https://github.com/bytecodealliance/javy/blob/main/crates/quickjs-wasm-sys/build.rs
I was unable to get the bindgen to work - it would not output functions (it would output types and constants correctly though). In the end I copied the bindgen file from i686-msvc. It works OK.