- Notifications
You must be signed in to change notification settings - Fork 41
WASMFS and WASI support #88
New issue
Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.
By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on ? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
e54b44b
to 6f8e666
Compare kesavkolla commented May 7, 2024
@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:
Which of these are you most interested in? |
kesavkolla commented May 7, 2024
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. |
antoniogagos commented Dec 31, 2024
I'm encountering an issue with mounting OPFS. console.log('Creating /test directory...');
FS.mkdir('/test');
console.log('Mounting OPFS at /test...');
FS.mount(OPFS, {}, '/test'); // Hangs here
console.log('Mounted OPFS successfully');
console.log(FS.readdir('/test')); I tried with:
I also tried excluding ASYNCIFY since it shouldn't be necessary with threads AFAIK. |
antoniogagos commented Jan 1, 2025
Compiling with a minimum pool size greater than 0 (-s PTHREAD_POOL_SIZE=1) fixed the issue. Without this setting, no worker threads were being created. I can now manipulate OPFS using FS, but the interaction with libgit2 seems to be broken. FS.mkdir('/opfs');
FS.mount(OPFS, {}, '/opfs');
FS.chdir('/opfs');
FS.readdir('.'); // works and prints existing content at OPFS
FS.chdir('/opfs/my-repo'); // location of an existing valid git repo
lg.callMain(['status']); // fails - can't not find a repository There appears to be a conflict with path resolution. Removing the leading slashes from paths added by |
Work in progress. Here's a screenshot of a Wasi build, displaying the available commands of lg2.wasm running with wasmtime:
And here's an initial test with WASMFS:
844fa31