wasmtime
wasmtime copied to clipboard
Add WasiCtxBuilder::preopened_handle to allow more flexible VFS usage
This will allow third-party libraries to implement their own VFS to expose to a wasi binary, such as (for example) VFS implemenations that record all reads/writes done from wasi, or purely user-space implementations of traditional filesystems.
Also modify the wasi-fs example to use this simplified & more powerful system.
(partial fix for #2232)
Subscribe to Label Action
cc @kubkon
Thus the following users have been cc'd because of the following labels:
- kubkon: wasi
To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json
configuration file.
@sunfishcode I'm happy to apply the refactoring you suggested above, but I'm looking for some input on which direction to take things.
Considering it's been 2+ years, is this possible already without this PR?
Yes this has been possible in wasi-common for a few years now.
Note that this functionality is going away in the preview 2 implementation, in favor of using component virtualization - a VFS can be implemented in WebAssembly now, instead of native code.
I'm going to close this as this is quite an old PR at this point and I believe the previous summary is still applicable.