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

WASMFS and WASI support #88

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft

Conversation

petersalomonsen
Copy link
Owner

@petersalomonsen petersalomonsen commented Dec 16, 2023

Work in progress. Here's a screenshot of a Wasi build, displaying the available commands of lg2.wasm running with wasmtime:

image

And here's an initial test with WASMFS:

844fa31

es6 for emscripten build
initial memory increase for wasi
@kesavkolla
Copy link

@petersalomonsen Any update on this? Is there any effort pending for this to get merged?

@petersalomonsen
Copy link
Owner Author

@petersalomonsen Any update on this? Is there any effort pending for this to get merged?

@kesavkolla I will not merge this, but rather split it up into separate parts for what's in here:

  • WASMFS/OPFS: From what I learned [here])(WasmFS: Current directory ignores custom backend emscripten-core/emscripten#18112) either threads or JSPI is needed, which are currently not supported without enabling special flags in chrome. For wasm-git it should be a special build for those who are interested in it, and it also makes sense to have it in a separate PR.
  • WASI: I got quickly into limitations with WASI 1, especially when it comes to network requests for pull/push. I have done some experimenting on the component model (WASI 2), and so I will rather revisit that when it becomes more official. Also in a separate PR then.
  • ES6 build is probably the lowest hanging fruit here, so that will come soon
  • Devcontainer setup is also straightforward, so I will separate that out

Which of these are you most interested in?

@kesavkolla
Copy link

@petersalomonsen Any update on this? Is there any effort pending for this to get merged?

@kesavkolla I will not merge this, but rather split it up into separate parts for what's in here:

  • WASMFS/OPFS: From what I learned [here])(WasmFS: Current directory ignores custom backend emscripten-core/emscripten#18112) either threads or JSPI is needed, which are currently not supported without enabling special flags in chrome. For wasm-git it should be a special build for those who are interested in it, and it also makes sense to have it in a separate PR.
  • WASI: I got quickly into limitations with WASI 1, especially when it comes to network requests for pull/push. I have done some experimenting on the component model (WASI 2), and so I will rather revisit that when it becomes more official. Also in a separate PR then.
  • ES6 build is probably the lowest hanging fruit here, so that will come soon
  • Devcontainer setup is also straightforward, so I will separate that out

Which of these are you most interested in?

I don't know what is the best behavior either WASI or WASMFS/OPFS. Ideally the requirement is to run the git commands right from the browser's filesystem. I was hoping OPFS is the right choice as I can then use the filesystem API to access the files and then once changes are made use git command to push the changes.

@petersalomonsen
Copy link
Owner Author

@petersalomonsen Any update on this? Is there any effort pending for this to get merged?

@kesavkolla I will not merge this, but rather split it up into separate parts for what's in here:

  • WASMFS/OPFS: From what I learned [here])(WasmFS: Current directory ignores custom backend emscripten-core/emscripten#18112) either threads or JSPI is needed, which are currently not supported without enabling special flags in chrome. For wasm-git it should be a special build for those who are interested in it, and it also makes sense to have it in a separate PR.
  • WASI: I got quickly into limitations with WASI 1, especially when it comes to network requests for pull/push. I have done some experimenting on the component model (WASI 2), and so I will rather revisit that when it becomes more official. Also in a separate PR then.
  • ES6 build is probably the lowest hanging fruit here, so that will come soon
  • Devcontainer setup is also straightforward, so I will separate that out

Which of these are you most interested in?

I don't know what is the best behavior either WASI or WASMFS/OPFS. Ideally the requirement is to run the git commands right from the browser's filesystem. I was hoping OPFS is the right choice as I can then use the filesystem API to access the files and then once changes are made use git command to push the changes.

All right, yes I think that also OPFS should be possible to implement now that WasmFS seems to have come quite far, and the only requirement will then be that JSPI is enabled. Soon it may also be enabled by default in the browsers. Will create a separate PR for OPFS/WasmFS soon.

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

Successfully merging this pull request may close these issues.

2 participants