-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Questions about WasiDir #5025
Comments
All the path arguments here can contain multiple path components. Symlinks are are always followed in all path components other than the last component.
One can set the times on the directory itself by calling |
@sunfishcode When are we expected to handle |
That said, wasi-filesystem itself doesn't document many of these details yet. I intend to add documentation, but haven't gotten to it yet. For now, I can answer questions, and if anyone would like to help with the documentation I can mentor. |
We plan to submit a documentation PR. That limitation makes sense. However, it should be noted that there is a difference between Consider the situation where we pass in two file descriptors to the wasi instance:
Additionally, let's presume that What happens in the following scenarios from the perspective of the wasm application?
If my expectations are correct, then cases 2, 3 and 4 differ in surprising ways from all existing operating systems. |
That should be an error as opening |
@bjorn3 |
Right, I thought you were referring to the syscall level. |
This matches unix systems. By having a pre-opened fd pointing to |
@bjorn3 It doesn't match unix systems. Passing a file descriptor, under the current implementation with Under wasi-libc if you did |
All of those expectations are currently met by wasi-libc's preopen system. There is some design tension between the goals of compatibility, the goals of leveraging WebAssembly's unique strengths, especially in light of the finite development resources for wasi-libc. wasi-libc's underlying observation here is that even outside of WASI, applications generally can't assume that they know the relative positions in the filesystem namespace of the various paths you provide to them. Even if two paths have the same prefix, it's not safe for applications to notice this and switch to using If you have specific use cases which need to do this kind of hopping between different resources using |
To be clear, I well understand that absolute compatibility with POSIX is not a design goal. I am, however, trying to understand where the surprises happen and why. We do have the need to synthesize a wide variety of filesystem-like things. Keep in mind that our implementation cannot trust the host and therefore merely forwarding requests to the host isn't exactly an option. This means we have to implement things like filesystem encryption as a vfs. We're trying to design that VFS layer now. And once we have something to show, I'd like to find ways to contribute all or parts of it to wasmtime since I think it is generally useful. More details to come. I think our first step is gathering all this information and documenting the |
There are a number of aspects to
WasiDir
that are unclear to me. For completeness, I'll paste the full definition here and put questions in comments.The text was updated successfully, but these errors were encountered: