-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Pure-Rust implementation of WASI's open_parent #64434
Conversation
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
let path = PathBuf::from(OsString { inner: buf }); | ||
paths.push((path, WasiFd::from_raw(fd))); | ||
}, | ||
Ok(_) => (), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a new preopen-type is added, it will be skipped silently. That's probably the right thing to do though.
Thanks for the PR! I don't think though that this is ready at this time to move into Rust. The canonical definition in the upstream libc is usable by us and by using it we help reduce duplication of its definition. If it were a well-specified function that had a standard I think it'd be reasonable to reimplement in Rust, but currently the function itself is likely to be in flux as the wasi spec updates over time, so to reduce churn I'd prefer that we keep using the C version. |
Well, if you think that Note that in the previous PR I've already replaced arguments retrieval to a pure Rust variant, I haven't touched |
@newpavlov I think this also happens to fix WebAssembly/WASI#24 right? If I understand it correctly, paths are now initialized on the first call to |
@sorpaas |
Most of WASI is still in development, and basically nothing is stable other than wasm itself. There working group is moving slowly to start stabilizing APIs, but I would suspsect that the way in which preopened file descriptors are communicated to the wasm module is highly likely to change at least a little over time, the current scheme AFAIK was the first thing implemented after wasi inherited CloudABI mostly. I agree that fixing WebAssembly/WASI#24 is important, but that can also be done in wasi-libc too. |
We already use Core API extensively in |
We do, yes, but most of that seems relatively more stable than the funkiness with preopened file descriptors. Additionally it's not like the bits from libc are going away, so since they're already doing the work at startup no matter what it seems like we should use it rather than duplicate it. I'm not really sure what the motivation is here beyond "let's try to use less C" which I feel like isn't a great argument for the change? I understand there's some maybe perf or code size things going on here too but those also seem very inconsequential to the point that it's not really motivation for the change one way or another. |
ping from triage @newpavlov, any updates on this? |
The PR is ready, so I am not sure why the |
My opinion hasn't changed from before, I don't think the marginal benefits of this outweigh the instability brought on by avoiding an upstream API. |
Ping from triage. @newpavlov @alexcrichton I guess this PR won;'t be moving forward. So, I'll be closing it now. |
__wasilibc_find_relpath
is not needed for interoperability with C/C++, so we can replace it with a pure-Rust code. I am not sure if I understood everything correctly, so I hope @sunfishcode will review this PR. For example I think we can remove therights
argument, since error should happen later either way and there is no reason to check access rights inopen_parent
.r? @alexcrichton