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
How to use wasi-vfs
with Python?
#5
Comments
I haven't tried it yet but it works well in theory. As shown in the section (https://github.com/kateinoigakukun/wasi-vfs#build-and-run-wasi-application), it would work by just linking |
I was able to successfully build WASI Python with the VFS. I cloned tiran's cpython fork (https://github.com/tiran/cpython.git) and added a couple of hacks, as shown in this diff (obviously, update the paths for your own environment): Then, from the repo's root, I did the following:
Hope this helps! |
Would that still work without |
I was able to compile with
|
It doesn't work without |
Would it be catastrophic to have |
I forgot a step above. I also had to hack a few lines into wasi-vfs as well. Then, I used this custom binary on the compile and pack steps. See this diff: Maybe this will get you further. |
Still not working, same issue with your Wasi-VFS fork. |
Do you get an error like this when omitting
|
Yes, that's the error I get as well. |
Thank you for your detailed report! The problems here were:
I've also fixed some minor issues that trigger some warnings here: #6 |
@kateinoigakukun I still get the error #5 (comment), even with the latest |
@rjzak Hmm, it looks like you didn't enable wasmparser or wasmtime's bulk memory feature in your application. Please review configuration of wasmtime in your loader code. The compiled binary is too large to upload to GitHub issue ... 😅 (because I packed the whole installation directory) |
@kateinoigakukun The application is |
@rjzak Ah sorry, I got it. I think you are using newer version of wasi-sdk, which requires bulk-memory feature and I'm using wasi-sdk 14.0. The root issue is wizer, which is a pre-initialization tool for wasm and this project depends on it, doesn't support the feature for now, so it disables it here: https://github.com/bytecodealliance/wizer/blob/76602d16828648e82720762b83f2ff6f9489ca84/src/lib.rs#L511 We have to add support for the feature to wizer, but could you try with older wasi-sdk for now? |
I did finally get it to work, thank you @kateinoigakukun and @pvetere. |
I'd like to use
wasi-vfs
with Python-Wasi, as I've done with Ruby, but it seems something has to be done with the .wasm file beforewasi-vfs
can add the files. How can I get started? Thank you.CC: @nickvidal @bstrie
The text was updated successfully, but these errors were encountered: