-
Notifications
You must be signed in to change notification settings - Fork 10
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
Quest: Gradually migrate the Rust ecosystem to I/O safety #38
Comments
It is unlikely that |
The same goes for socket2, feature flags aren't the way to do this. We could go with a build.rs file, e.g. like serde, but I rather just bump the MSRV in a new version. Also note that we have rust-lang/libc#2845 going at the same time, so a ecosystem wide bump of the MSRV seems to be on the horizon. |
Since it's not linked in the original post: new traits have been added to |
We should also aim to get |
The PR for that is rust-lang/rust#98368. |
Mio 1.0 with I/O safety traits is now out: https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md#10 |
I assume that's been resolved as well, the current
|
Thanks, it appears tokio is indeed updated. |
There was an issue with how the PR was implemented, someone will need to correct that for this item to move forward: async-rs/async-std#1036 (comment) Presently a blocker for async-rs/async-std#1081 |
I've now submitted async-rs/async-std#1084 to fix the errors in async-std. |
async-std 1.13 is now released with support for the traits. eminence/terminal-size#66 is now posted to update terminal_size. That will be the last checkbox left, other than the "TODO: add others here" boxes. Does anyone following this issue have any other crates in mind that we should update? |
terminal-size 0.4.0 is now released with an API that uses I don't have any other "others" to add here, and all the rest of the boxes here are checked, so I think it's time to close this issue! Thanks to everyone who had a hand in this! If you have a codebase which is not yet migrated to the I/O safety types and traits and would like help migrating it, feel free to ping me and I'll help if I'm able to. |
can somone help https://github.com/wez/wezterm/ to migrte? thanks |
I'm too busy to get to this soon, but I filed #75 to track porting wezterm. I'd be happy to give people pointers if anyone is interested in working on this before I get to it. |
As mentioned in the RFC, migration to I/O safety will be a gradual process. I'm laying out a roadmap here, with todo items, to help organize the process. If anyone is interested in helping with any of the items in this process, has ideas of things we should add, or has any questions about anything, please post in this issue! I'll add names to the todo items to track who's working on what.
The first steps are:
Once the feature reaches stable, the next step will be to contribute
AsFd
,From<OwnedFd>
andFrom<T> for OwnedFd
impls to popular types in the ecosystem. These changes are semver compatible, though they do have MSRV considerations.impls_*.rs
files in the src directory.AsRawFd
,FromRawFd
, and/orIntoRawFd
, it usually wantsAsFd
,From<OwnedFd>
, and/orFrom<T> for OwnedFd
, respectively. And similar for Windows withHandle
andSocket
in forFd
.To help crates that are already using io-lifetimes, such as rustix:
Once "enough" popular types have added the new impls, we can start migrating APIs to use the new traits, such as using
AsFd
in place ofAsRawFd
. When doing so, any functions that accept raw file-descriptor arguments should be changed to unsafe as well. These changes may require a semver bump. They may require a Minimum Supported Rust Version bump too, though another option is to use io-lifetimes once the change to have it re-export std's types and traits by default lands.The text was updated successfully, but these errors were encountered: