Closed notgull closed 5 months ago
@TimonPost What are your thoughts on this? If I submitted a PR, would it be accepted?
Im doubting a little, a pr is welcome, but i think in general we got pretty simple usecases and most of them havent changed for years now. It seems rustix might bring a couple of extra dependencies - which would be my biggest consern. So could be good to check that out, certainly removing unsafe is better, but unsafe isnt a big issue directly if used right.
It seems rustix might bring a couple of extra dependencies - which would be my biggest consern.
rustix
brings in two dependencies on Linux: bitflags
(which is already used in this crate) and linux-raw-sys
. On other platforms rustix
doesn't bring in the raw Linux bindings and instead brings in libc
and libc_errno
.
even bringing in bitflags could cause duplicated versions to be included. It creates a dependency between rustix and crossterm where they need to use the same versions. Tho bitflags probably is quite stable. But again feel free to open PR and check what impact it has on the Cagro.lock
rustix
is a system call wrapper that wraps raw system calls on Linux andlibc
on other platforms. It would allowcrossterm
to refactor out error handling and unsafe syscall handling code from its codebase. In terms of speed,rustix
bypasseslibc
for Linux system calls. In some cases, this can allow system calls to be directly inlined into their calling functions, lowering the instruction count.rustix
currently supports all of the system calls that this crate uses. The only problem would be that it would bump the MSRV to 1.63, but if that isn't an issue then I can write a PR for this.