wasmtime icon indicating copy to clipboard operation
wasmtime copied to clipboard

Add WasiCtxBuilder::preopened_handle to allow more flexible VFS usage

Open joshuawarner32 opened this issue 4 years ago • 4 comments

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)

joshuawarner32 avatar Sep 30 '20 04:09 joshuawarner32

Subscribe to Label Action

cc @kubkon

This issue or pull request has been labeled: "wasi"

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.

Learn more.

github-actions[bot] avatar Sep 30 '20 04:09 github-actions[bot]

@sunfishcode I'm happy to apply the refactoring you suggested above, but I'm looking for some input on which direction to take things.

joshuawarner32 avatar Oct 02 '20 02:10 joshuawarner32

Considering it's been 2+ years, is this possible already without this PR?

cardoso avatar May 26 '23 09:05 cardoso

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.

pchickey avatar May 26 '23 15:05 pchickey

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.

alexcrichton avatar Mar 13 '24 02:03 alexcrichton