-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add yanix crate and replace nix with yanix in wasi-common #649
Conversation
2b4551b
to
3b67b36
Compare
cc @marmistrz |
In terms of style and how to organize this, my personal preference is to do what the standard library does. There's a crate that has a cross-platform API, and then internally it's got a I don't get the feeling this PR is quite like that, but I don't think that's necessarily a bad thing. It's a reflection of reality as it is today and I think that's fine, incremental improvement is always good! In that sense I mostly just want to comment about how I don't think this is the best organization we can have long-term, but I also don't want to block this in any way! |
Thanks for the feedback! Yep, personally, I'm also a fan of the |
👍 definitely sounds good to me! |
3b67b36
to
a3157cf
Compare
In the end, I've decided to the reorg in this PR since there were some other outstanding things to sort out. This, however, meant that it was easier to do the reorg by pulling in #650 into this PR which is less than ideal, but hopefully not a complete deal breaker. |
a3157cf
to
4a3419c
Compare
4a3419c
to
453f4c3
Compare
This commit adds `yanix` crate as a Unix dependency for `wasi-common`. `yanix` stands for Yet Another Nix crate and is exactly what the name suggests: a crate in the spirit of the `nix` crate featuring certain adjusments and additions tailored specfically to its main application area which are implementation of WASI syscalls.
Having introduced `yanix` crate as an in-house replacement for the `nix` crate, this commit makes the necessary changes to `wasi-common` to depend _only_ on `yanix` crate.
* make `fd_dup` unsafe * rename `get_fd` to `get_fd_flags`, etc. * reuse `io::Error::last_os_error()` to get the last errno value
* make all `fcntl` fns unsafe * adjust `wasi-common` impl appropriately
a5b100a
to
9147a28
Compare
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.
Thanks for all your work putting this together!
This PR adds
yanix
crate as a Unix dependency forwasi-common
.yanix
stands for Yet Another Nix crate and is exactly what the name suggests: a crate in the spirit of thenix
crate featuring certain adjusments and additions tailored specfically to its main application area which are implementation of WASI syscalls.This PR also makes the necessary changes to
wasi-common
to depend only onyanix
crate.I apologise for the largeness of the PR! I've kept it as two orthogonal commits for easier reviewing, so I hope that helps somewhat.
This PR is a successor and hopefully an improvement of #640 and is the first of addressing #520.