Use 'libc' directly instead of through rustix#26
Use 'libc' directly instead of through rustix#26sunfishcode merged 1 commit intosunfishcode:mainfrom
Conversation
ac258c2 to
01f8bb6
Compare
|
This PR removes Fortunately though, Rust 1.70 will be released in a week with the |
So as far as I could track it, using
Yeah! This is awesome! But I'd still love to be able to support older toolchains with fewer dependencies. |
|
@sunfishcode Checking in. |
|
Thanks. I agree we should do this. I'd like to figure out the no_std situation though. I expect it can be fixed using libc, as the libc crate is no_std. |
|
The #[cfg(target_os = "hermit")]
pub use std::os::hermit::io::{AsFd, BorrowedFd, OwnedFd};
#[cfg(unix)]
pub use std::os::unix::io::{AsFd, BorrowedFd, OwnedFd};
#[cfg(target_os = "wasi")]
pub use std::os::wasi::io::{AsFd, BorrowedFd, OwnedFd};
#[cfg(windows)]
pub use std::os::windows::io::{
AsHandle, AsSocket, BorrowedHandle, BorrowedSocket, HandleOrInvalid, InvalidHandleError,
NullHandleError, OwnedHandle, OwnedSocket,
};That would need to be addressed first. In all, I don't think this crate was ever really |
86f1044 to
7fb3baa
Compare
|
Ah, apparently the But, I still think the library actually uses
In any case, I'll push an up-to-date version that does what the crate was previously doing. |
7fb3baa to
b4d0621
Compare
|
This PR makes |
|
Still hoping we can get this through. |
|
Having read the above, I don't see any actual reason this shouldn't be merged. #31 does have reasons it shouldn't be however. Am I missing something? |
|
@SergioBenitez I now think this PR makes sense. Would you mind rebasing it to fix the merge conflict? |
|
Sure, will do. |
b4d0621 to
4d10091
Compare
|
Done. |
|
@sunfishcode Can we get this merged and released? |
|
This is now released in is-terminal 0.4.11. |
As the title suggests, this PR goes from using
rustixto check if a stream is a terminal on Unix to usinglibcdirectly. The benefit is a decrease in compile-times by ~50% in debug mode and ~35% in release mode, on my machine, as well a decrease in transitive dependencies from 5 to 2. The detriment is an added use ofunsafe, albeit a very well understood one.