-
Notifications
You must be signed in to change notification settings - Fork 52
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
Overlapping preopens #111
Comments
So I stumbled upon this issue recently. It doesn't have a resolution, but implies that the ordering of preopens might matter in the wasi-libc. It's also not clear to me (and I haven't been able to find any clarifying documentation) if this is something that is supposed to be handled by the WASI syscall provider vs. the wasi-libc. I had assumed that given a collection of preopens, wasi-libc would sort things out - otherwise, every WASI implementor needs to reimplement the same bug prone logic. When an application starts up, the preopens are surveyed via I'm sorry I don't know the definitive answer to this. It would be good to have some spec clarification on that. If it's something that uvwasi is required to implement, I could work on that. As a workaround for your immediate issue, would it be possible to preopen |
Yes, it looks like this would require a complete vfs implementation on uvwasi level. |
Adding @MarkMcCaskey to the thread, he worked on the WASI implementation for Wasmer and he might have some ideas on useful approaches for the uvwasi implementation :) |
Yeah we definitely ran into issues with order and nesting of pre-opens. I think we ended up just trying to simplify things as much as possible. Anyways here's an info-dump of what I remember:
Anyways, if the order of preopens matters in wasmer in general then that's a bug as far as I'm concerned. It's important to be aware that some implementations of WASI, such as AssemblyScript's are very much order dependent given their current implementation (Wasmer's virtual root usually makes this bug harder to see in practice). |
Thanks @MarkMcCaskey, I appreciate the detailed feedback. This seems like something that needs to be defined in the spec. Otherwise, there are multiple ways for runtimes to approach this, and there will be no consistency across the ecosystem (based on your comments, that seems to be the case already). |
While working on
VFS
support, I run into this problem.A temporary directory is created and I'd like to mount it to the root fs:
This conflicts with the first (root) entry, and I cannot access
_wasmer
.If I reorder preopens, I can access
_wasmer
, but not the root content.How should this be handled?
The text was updated successfully, but these errors were encountered: