Skip to content
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

Patch low-hanging fruit semver removals for libc and linux-raw-sys #1063

Merged
merged 2 commits into from
May 21, 2024

Conversation

notgull
Copy link
Contributor

@notgull notgull commented May 21, 2024

libc and linux-raw-sys are exposed in the public API, which makes it problematic for us to change their versions. As linux-raw-sys has released a new breaking change and libc is planning on releasing one soon, this will cause a major issue for us if this is not patched in v1.0

This PR takes care of some of the low hanging fruit. Mostly bitflag types are taken care of by making sure they export types from the crate::ffi module instead of the crate::c module. I also add a tcflag_t type alias for the types in the termios module.

Remaining exposed types from linux-raw-sys:

    pub type rustix::fs::FsWord = linux_raw_sys::general::__fsword_t
    pub type rustix::fs::RawMode = linux_raw_sys::general::__kernel_mode_t
    pub type rustix::fs::Stat = linux_raw_sys::general::stat
    pub type rustix::fs::StatFs = linux_raw_sys::general::statfs64
    pub type rustix::fs::Statx = linux_raw_sys::general::statx
    pub type rustix::fs::StatxTimestamp = linux_raw_sys::general::statx_timestamp
    pub rustix::io_uring::io_uring_cqe::big_cqe: linux_raw_sys::io_uring::__IncompleteArrayField<u64>
    pub rustix::io_uring::io_uring_probe::ops: linux_raw_sys::io_uring::__IncompleteArrayField<rustix::io_uring::io_uring_probe_op>
    pub type rustix::io_uring::Statx = linux_raw_sys::general::statx
    pub type rustix::net::SocketAddrStorage = linux_raw_sys::net::sockaddr
    pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &linux_raw_sys::general::siginfo_t
    pub type rustix::system::Sysinfo = linux_raw_sys::system::sysinfo
    pub type rustix::termios::Winsize = linux_raw_sys::general::winsize

Remaining exposed types for libc, at least on x86_64 Linux-GNU:

pub type rustix::fs::Dev = libc::unix::linux_like::linux::dev_t
pub type rustix::fs::FsWord = libc::unix::linux_like::linux::gnu::b64::__fsword_t
pub type rustix::fs::RawMode = libc::unix::linux_like::linux::mode_t
pub type rustix::fs::Stat = libc::unix::linux_like::linux::gnu::b64::x86_64::stat64
pub type rustix::fs::StatFs = libc::unix::linux_like::linux::gnu::b64::x86_64::statfs64
pub type rustix::fs::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::fs::StatxTimestamp = libc::unix::linux_like::linux::gnu::statx
pub type rustix::io_uring::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::net::SocketAddrStorage = libc::unix::linux_like::sockaddr_storage
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &libc::unix::linux_like::linux::gnu::b64::x86_64::siginfo_t
pub type rustix::system::Sysinfo = libc::unix::linux_like::linux::gnu::b64::sysinfo
pub type rustix::termios::Winsize = libc::unix::winsize

notgull added 2 commits May 20, 2024 19:24
linux-raw-sys is exposed as a public dependency. This commit removes many of the
instances where it is publicly exposed. There are a few places that are more
difficult and require greater discussion. I've left these in for now.

This is checked using this command:

$ cargo public-api --features all-apis | grep -i linux_raw_sys

The remaining APIs that expose linux_raw_sys are as follows:

pub type rustix::fs::FsWord = linux_raw_sys::general::__fsword_t
pub type rustix::fs::RawMode = linux_raw_sys::general::__kernel_mode_t
pub type rustix::fs::Stat = linux_raw_sys::general::stat
pub type rustix::fs::StatFs = linux_raw_sys::general::statfs64
pub type rustix::fs::Statx = linux_raw_sys::general::statx
pub type rustix::fs::StatxTimestamp = linux_raw_sys::general::statx_timestamp
pub rustix::io_uring::io_uring_cqe::big_cqe: linux_raw_sys::io_uring::__IncompleteArrayField<u64>
pub rustix::io_uring::io_uring_probe::ops: linux_raw_sys::io_uring::__IncompleteArrayField<rustix::io_uring::io_uring_probe_op>
pub type rustix::io_uring::Statx = linux_raw_sys::general::statx
pub type rustix::net::SocketAddrStorage = linux_raw_sys::net::sockaddr
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &linux_raw_sys::general::siginfo_t
pub type rustix::system::Sysinfo = linux_raw_sys::system::sysinfo
pub type rustix::termios::Winsize = linux_raw_sys::general::winsize

Signed-off-by: John Nunley <dev@notgull.net>
Similarly to the last commit, this one removes libc types from the public API.
Again there are libc types that are harder to remove so I've skipped them for
now.

This can be checked with:

$ cargo public-api --features all-apis,use-libc | grep -i libc

The remaining API's are:

pub type rustix::fs::Dev = libc::unix::linux_like::linux::dev_t
pub type rustix::fs::FsWord = libc::unix::linux_like::linux::gnu::b64::__fsword_t
pub type rustix::fs::RawMode = libc::unix::linux_like::linux::mode_t
pub type rustix::fs::Stat = libc::unix::linux_like::linux::gnu::b64::x86_64::stat64
pub type rustix::fs::StatFs = libc::unix::linux_like::linux::gnu::b64::x86_64::statfs64
pub type rustix::fs::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::fs::StatxTimestamp = libc::unix::linux_like::linux::gnu::statx
pub type rustix::io_uring::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::net::SocketAddrStorage = libc::unix::linux_like::sockaddr_storage
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &libc::unix::linux_like::linux::gnu::b64::x86_64::siginfo_t
pub type rustix::system::Sysinfo = libc::unix::linux_like::linux::gnu::b64::sysinfo
pub type rustix::termios::Winsize = libc::unix::winsize

Signed-off-by: John Nunley <dev@notgull.net>
@notgull
Copy link
Contributor Author

notgull commented May 21, 2024

Extant CI errors are due to #1062

Copy link
Member

@sunfishcode sunfishcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@sunfishcode sunfishcode merged commit b610483 into bytecodealliance:1.0-staging May 21, 2024
8 of 44 checks passed
@notgull notgull deleted the no-lrs branch May 22, 2024 01:40
sunfishcode pushed a commit that referenced this pull request Aug 15, 2024
…1063)

* break: Remove low-hanging fruit for linux-raw-sys exposure

linux-raw-sys is exposed as a public dependency. This commit removes many of the
instances where it is publicly exposed. There are a few places that are more
difficult and require greater discussion. I've left these in for now.

This is checked using this command:

$ cargo public-api --features all-apis | grep -i linux_raw_sys

The remaining APIs that expose linux_raw_sys are as follows:

pub type rustix::fs::FsWord = linux_raw_sys::general::__fsword_t
pub type rustix::fs::RawMode = linux_raw_sys::general::__kernel_mode_t
pub type rustix::fs::Stat = linux_raw_sys::general::stat
pub type rustix::fs::StatFs = linux_raw_sys::general::statfs64
pub type rustix::fs::Statx = linux_raw_sys::general::statx
pub type rustix::fs::StatxTimestamp = linux_raw_sys::general::statx_timestamp
pub rustix::io_uring::io_uring_cqe::big_cqe: linux_raw_sys::io_uring::__IncompleteArrayField<u64>
pub rustix::io_uring::io_uring_probe::ops: linux_raw_sys::io_uring::__IncompleteArrayField<rustix::io_uring::io_uring_probe_op>
pub type rustix::io_uring::Statx = linux_raw_sys::general::statx
pub type rustix::net::SocketAddrStorage = linux_raw_sys::net::sockaddr
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &linux_raw_sys::general::siginfo_t
pub type rustix::system::Sysinfo = linux_raw_sys::system::sysinfo
pub type rustix::termios::Winsize = linux_raw_sys::general::winsize

Signed-off-by: John Nunley <dev@notgull.net>

* break: Low-hanging fruit for removing libc from public API

Similarly to the last commit, this one removes libc types from the public API.
Again there are libc types that are harder to remove so I've skipped them for
now.

This can be checked with:

$ cargo public-api --features all-apis,use-libc | grep -i libc

The remaining API's are:

pub type rustix::fs::Dev = libc::unix::linux_like::linux::dev_t
pub type rustix::fs::FsWord = libc::unix::linux_like::linux::gnu::b64::__fsword_t
pub type rustix::fs::RawMode = libc::unix::linux_like::linux::mode_t
pub type rustix::fs::Stat = libc::unix::linux_like::linux::gnu::b64::x86_64::stat64
pub type rustix::fs::StatFs = libc::unix::linux_like::linux::gnu::b64::x86_64::statfs64
pub type rustix::fs::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::fs::StatxTimestamp = libc::unix::linux_like::linux::gnu::statx
pub type rustix::io_uring::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::net::SocketAddrStorage = libc::unix::linux_like::sockaddr_storage
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &libc::unix::linux_like::linux::gnu::b64::x86_64::siginfo_t
pub type rustix::system::Sysinfo = libc::unix::linux_like::linux::gnu::b64::sysinfo
pub type rustix::termios::Winsize = libc::unix::winsize

Signed-off-by: John Nunley <dev@notgull.net>

---------

Signed-off-by: John Nunley <dev@notgull.net>
sunfishcode pushed a commit that referenced this pull request Aug 26, 2024
…1063)

* break: Remove low-hanging fruit for linux-raw-sys exposure

linux-raw-sys is exposed as a public dependency. This commit removes many of the
instances where it is publicly exposed. There are a few places that are more
difficult and require greater discussion. I've left these in for now.

This is checked using this command:

$ cargo public-api --features all-apis | grep -i linux_raw_sys

The remaining APIs that expose linux_raw_sys are as follows:

pub type rustix::fs::FsWord = linux_raw_sys::general::__fsword_t
pub type rustix::fs::RawMode = linux_raw_sys::general::__kernel_mode_t
pub type rustix::fs::Stat = linux_raw_sys::general::stat
pub type rustix::fs::StatFs = linux_raw_sys::general::statfs64
pub type rustix::fs::Statx = linux_raw_sys::general::statx
pub type rustix::fs::StatxTimestamp = linux_raw_sys::general::statx_timestamp
pub rustix::io_uring::io_uring_cqe::big_cqe: linux_raw_sys::io_uring::__IncompleteArrayField<u64>
pub rustix::io_uring::io_uring_probe::ops: linux_raw_sys::io_uring::__IncompleteArrayField<rustix::io_uring::io_uring_probe_op>
pub type rustix::io_uring::Statx = linux_raw_sys::general::statx
pub type rustix::net::SocketAddrStorage = linux_raw_sys::net::sockaddr
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &linux_raw_sys::general::siginfo_t
pub type rustix::system::Sysinfo = linux_raw_sys::system::sysinfo
pub type rustix::termios::Winsize = linux_raw_sys::general::winsize

Signed-off-by: John Nunley <dev@notgull.net>

* break: Low-hanging fruit for removing libc from public API

Similarly to the last commit, this one removes libc types from the public API.
Again there are libc types that are harder to remove so I've skipped them for
now.

This can be checked with:

$ cargo public-api --features all-apis,use-libc | grep -i libc

The remaining API's are:

pub type rustix::fs::Dev = libc::unix::linux_like::linux::dev_t
pub type rustix::fs::FsWord = libc::unix::linux_like::linux::gnu::b64::__fsword_t
pub type rustix::fs::RawMode = libc::unix::linux_like::linux::mode_t
pub type rustix::fs::Stat = libc::unix::linux_like::linux::gnu::b64::x86_64::stat64
pub type rustix::fs::StatFs = libc::unix::linux_like::linux::gnu::b64::x86_64::statfs64
pub type rustix::fs::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::fs::StatxTimestamp = libc::unix::linux_like::linux::gnu::statx
pub type rustix::io_uring::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::net::SocketAddrStorage = libc::unix::linux_like::sockaddr_storage
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &libc::unix::linux_like::linux::gnu::b64::x86_64::siginfo_t
pub type rustix::system::Sysinfo = libc::unix::linux_like::linux::gnu::b64::sysinfo
pub type rustix::termios::Winsize = libc::unix::winsize

Signed-off-by: John Nunley <dev@notgull.net>

---------

Signed-off-by: John Nunley <dev@notgull.net>
sunfishcode pushed a commit that referenced this pull request Sep 5, 2024
…1063)

* break: Remove low-hanging fruit for linux-raw-sys exposure

linux-raw-sys is exposed as a public dependency. This commit removes many of the
instances where it is publicly exposed. There are a few places that are more
difficult and require greater discussion. I've left these in for now.

This is checked using this command:

$ cargo public-api --features all-apis | grep -i linux_raw_sys

The remaining APIs that expose linux_raw_sys are as follows:

pub type rustix::fs::FsWord = linux_raw_sys::general::__fsword_t
pub type rustix::fs::RawMode = linux_raw_sys::general::__kernel_mode_t
pub type rustix::fs::Stat = linux_raw_sys::general::stat
pub type rustix::fs::StatFs = linux_raw_sys::general::statfs64
pub type rustix::fs::Statx = linux_raw_sys::general::statx
pub type rustix::fs::StatxTimestamp = linux_raw_sys::general::statx_timestamp
pub rustix::io_uring::io_uring_cqe::big_cqe: linux_raw_sys::io_uring::__IncompleteArrayField<u64>
pub rustix::io_uring::io_uring_probe::ops: linux_raw_sys::io_uring::__IncompleteArrayField<rustix::io_uring::io_uring_probe_op>
pub type rustix::io_uring::Statx = linux_raw_sys::general::statx
pub type rustix::net::SocketAddrStorage = linux_raw_sys::net::sockaddr
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &linux_raw_sys::general::siginfo_t
pub type rustix::system::Sysinfo = linux_raw_sys::system::sysinfo
pub type rustix::termios::Winsize = linux_raw_sys::general::winsize

Signed-off-by: John Nunley <dev@notgull.net>

* break: Low-hanging fruit for removing libc from public API

Similarly to the last commit, this one removes libc types from the public API.
Again there are libc types that are harder to remove so I've skipped them for
now.

This can be checked with:

$ cargo public-api --features all-apis,use-libc | grep -i libc

The remaining API's are:

pub type rustix::fs::Dev = libc::unix::linux_like::linux::dev_t
pub type rustix::fs::FsWord = libc::unix::linux_like::linux::gnu::b64::__fsword_t
pub type rustix::fs::RawMode = libc::unix::linux_like::linux::mode_t
pub type rustix::fs::Stat = libc::unix::linux_like::linux::gnu::b64::x86_64::stat64
pub type rustix::fs::StatFs = libc::unix::linux_like::linux::gnu::b64::x86_64::statfs64
pub type rustix::fs::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::fs::StatxTimestamp = libc::unix::linux_like::linux::gnu::statx
pub type rustix::io_uring::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::net::SocketAddrStorage = libc::unix::linux_like::sockaddr_storage
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &libc::unix::linux_like::linux::gnu::b64::x86_64::siginfo_t
pub type rustix::system::Sysinfo = libc::unix::linux_like::linux::gnu::b64::sysinfo
pub type rustix::termios::Winsize = libc::unix::winsize

Signed-off-by: John Nunley <dev@notgull.net>

---------

Signed-off-by: John Nunley <dev@notgull.net>
sunfishcode pushed a commit that referenced this pull request Sep 5, 2024
…1063)

* break: Remove low-hanging fruit for linux-raw-sys exposure

linux-raw-sys is exposed as a public dependency. This commit removes many of the
instances where it is publicly exposed. There are a few places that are more
difficult and require greater discussion. I've left these in for now.

This is checked using this command:

$ cargo public-api --features all-apis | grep -i linux_raw_sys

The remaining APIs that expose linux_raw_sys are as follows:

pub type rustix::fs::FsWord = linux_raw_sys::general::__fsword_t
pub type rustix::fs::RawMode = linux_raw_sys::general::__kernel_mode_t
pub type rustix::fs::Stat = linux_raw_sys::general::stat
pub type rustix::fs::StatFs = linux_raw_sys::general::statfs64
pub type rustix::fs::Statx = linux_raw_sys::general::statx
pub type rustix::fs::StatxTimestamp = linux_raw_sys::general::statx_timestamp
pub rustix::io_uring::io_uring_cqe::big_cqe: linux_raw_sys::io_uring::__IncompleteArrayField<u64>
pub rustix::io_uring::io_uring_probe::ops: linux_raw_sys::io_uring::__IncompleteArrayField<rustix::io_uring::io_uring_probe_op>
pub type rustix::io_uring::Statx = linux_raw_sys::general::statx
pub type rustix::net::SocketAddrStorage = linux_raw_sys::net::sockaddr
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &linux_raw_sys::general::siginfo_t
pub type rustix::system::Sysinfo = linux_raw_sys::system::sysinfo
pub type rustix::termios::Winsize = linux_raw_sys::general::winsize

Signed-off-by: John Nunley <dev@notgull.net>

* break: Low-hanging fruit for removing libc from public API

Similarly to the last commit, this one removes libc types from the public API.
Again there are libc types that are harder to remove so I've skipped them for
now.

This can be checked with:

$ cargo public-api --features all-apis,use-libc | grep -i libc

The remaining API's are:

pub type rustix::fs::Dev = libc::unix::linux_like::linux::dev_t
pub type rustix::fs::FsWord = libc::unix::linux_like::linux::gnu::b64::__fsword_t
pub type rustix::fs::RawMode = libc::unix::linux_like::linux::mode_t
pub type rustix::fs::Stat = libc::unix::linux_like::linux::gnu::b64::x86_64::stat64
pub type rustix::fs::StatFs = libc::unix::linux_like::linux::gnu::b64::x86_64::statfs64
pub type rustix::fs::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::fs::StatxTimestamp = libc::unix::linux_like::linux::gnu::statx
pub type rustix::io_uring::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::net::SocketAddrStorage = libc::unix::linux_like::sockaddr_storage
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &libc::unix::linux_like::linux::gnu::b64::x86_64::siginfo_t
pub type rustix::system::Sysinfo = libc::unix::linux_like::linux::gnu::b64::sysinfo
pub type rustix::termios::Winsize = libc::unix::winsize

Signed-off-by: John Nunley <dev@notgull.net>

---------

Signed-off-by: John Nunley <dev@notgull.net>
notgull added a commit to forkgull/rustix that referenced this pull request Sep 27, 2024
…ytecodealliance#1063)

* break: Remove low-hanging fruit for linux-raw-sys exposure

linux-raw-sys is exposed as a public dependency. This commit removes many of the
instances where it is publicly exposed. There are a few places that are more
difficult and require greater discussion. I've left these in for now.

This is checked using this command:

$ cargo public-api --features all-apis | grep -i linux_raw_sys

The remaining APIs that expose linux_raw_sys are as follows:

pub type rustix::fs::FsWord = linux_raw_sys::general::__fsword_t
pub type rustix::fs::RawMode = linux_raw_sys::general::__kernel_mode_t
pub type rustix::fs::Stat = linux_raw_sys::general::stat
pub type rustix::fs::StatFs = linux_raw_sys::general::statfs64
pub type rustix::fs::Statx = linux_raw_sys::general::statx
pub type rustix::fs::StatxTimestamp = linux_raw_sys::general::statx_timestamp
pub rustix::io_uring::io_uring_cqe::big_cqe: linux_raw_sys::io_uring::__IncompleteArrayField<u64>
pub rustix::io_uring::io_uring_probe::ops: linux_raw_sys::io_uring::__IncompleteArrayField<rustix::io_uring::io_uring_probe_op>
pub type rustix::io_uring::Statx = linux_raw_sys::general::statx
pub type rustix::net::SocketAddrStorage = linux_raw_sys::net::sockaddr
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &linux_raw_sys::general::siginfo_t
pub type rustix::system::Sysinfo = linux_raw_sys::system::sysinfo
pub type rustix::termios::Winsize = linux_raw_sys::general::winsize

Signed-off-by: John Nunley <dev@notgull.net>

* break: Low-hanging fruit for removing libc from public API

Similarly to the last commit, this one removes libc types from the public API.
Again there are libc types that are harder to remove so I've skipped them for
now.

This can be checked with:

$ cargo public-api --features all-apis,use-libc | grep -i libc

The remaining API's are:

pub type rustix::fs::Dev = libc::unix::linux_like::linux::dev_t
pub type rustix::fs::FsWord = libc::unix::linux_like::linux::gnu::b64::__fsword_t
pub type rustix::fs::RawMode = libc::unix::linux_like::linux::mode_t
pub type rustix::fs::Stat = libc::unix::linux_like::linux::gnu::b64::x86_64::stat64
pub type rustix::fs::StatFs = libc::unix::linux_like::linux::gnu::b64::x86_64::statfs64
pub type rustix::fs::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::fs::StatxTimestamp = libc::unix::linux_like::linux::gnu::statx
pub type rustix::io_uring::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::net::SocketAddrStorage = libc::unix::linux_like::sockaddr_storage
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &libc::unix::linux_like::linux::gnu::b64::x86_64::siginfo_t
pub type rustix::system::Sysinfo = libc::unix::linux_like::linux::gnu::b64::sysinfo
pub type rustix::termios::Winsize = libc::unix::winsize

Signed-off-by: John Nunley <dev@notgull.net>

---------

Signed-off-by: John Nunley <dev@notgull.net>
sunfishcode pushed a commit that referenced this pull request Jan 22, 2025
…1063)

* break: Remove low-hanging fruit for linux-raw-sys exposure

linux-raw-sys is exposed as a public dependency. This commit removes many of the
instances where it is publicly exposed. There are a few places that are more
difficult and require greater discussion. I've left these in for now.

This is checked using this command:

$ cargo public-api --features all-apis | grep -i linux_raw_sys

The remaining APIs that expose linux_raw_sys are as follows:

pub type rustix::fs::FsWord = linux_raw_sys::general::__fsword_t
pub type rustix::fs::RawMode = linux_raw_sys::general::__kernel_mode_t
pub type rustix::fs::Stat = linux_raw_sys::general::stat
pub type rustix::fs::StatFs = linux_raw_sys::general::statfs64
pub type rustix::fs::Statx = linux_raw_sys::general::statx
pub type rustix::fs::StatxTimestamp = linux_raw_sys::general::statx_timestamp
pub rustix::io_uring::io_uring_cqe::big_cqe: linux_raw_sys::io_uring::__IncompleteArrayField<u64>
pub rustix::io_uring::io_uring_probe::ops: linux_raw_sys::io_uring::__IncompleteArrayField<rustix::io_uring::io_uring_probe_op>
pub type rustix::io_uring::Statx = linux_raw_sys::general::statx
pub type rustix::net::SocketAddrStorage = linux_raw_sys::net::sockaddr
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &linux_raw_sys::general::siginfo_t
pub type rustix::system::Sysinfo = linux_raw_sys::system::sysinfo
pub type rustix::termios::Winsize = linux_raw_sys::general::winsize

Signed-off-by: John Nunley <dev@notgull.net>

* break: Low-hanging fruit for removing libc from public API

Similarly to the last commit, this one removes libc types from the public API.
Again there are libc types that are harder to remove so I've skipped them for
now.

This can be checked with:

$ cargo public-api --features all-apis,use-libc | grep -i libc

The remaining API's are:

pub type rustix::fs::Dev = libc::unix::linux_like::linux::dev_t
pub type rustix::fs::FsWord = libc::unix::linux_like::linux::gnu::b64::__fsword_t
pub type rustix::fs::RawMode = libc::unix::linux_like::linux::mode_t
pub type rustix::fs::Stat = libc::unix::linux_like::linux::gnu::b64::x86_64::stat64
pub type rustix::fs::StatFs = libc::unix::linux_like::linux::gnu::b64::x86_64::statfs64
pub type rustix::fs::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::fs::StatxTimestamp = libc::unix::linux_like::linux::gnu::statx
pub type rustix::io_uring::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::net::SocketAddrStorage = libc::unix::linux_like::sockaddr_storage
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &libc::unix::linux_like::linux::gnu::b64::x86_64::siginfo_t
pub type rustix::system::Sysinfo = libc::unix::linux_like::linux::gnu::b64::sysinfo
pub type rustix::termios::Winsize = libc::unix::winsize

Signed-off-by: John Nunley <dev@notgull.net>

---------

Signed-off-by: John Nunley <dev@notgull.net>
sunfishcode added a commit that referenced this pull request Jan 22, 2025
* Remove linux-raw-sys and libc from public API (#956)

* Remove linux-raw-sys and libc from public API

This prevents libc and linux-raw-sys from affecting the semver status of
this crate.

Signed-off-by: John Nunley <dev@notgull.net>

---------

Signed-off-by: John Nunley <dev@notgull.net>

* Patch low-hanging fruit semver removals for libc and linux-raw-sys (#1063)

* break: Remove low-hanging fruit for linux-raw-sys exposure

linux-raw-sys is exposed as a public dependency. This commit removes many of the
instances where it is publicly exposed. There are a few places that are more
difficult and require greater discussion. I've left these in for now.

This is checked using this command:

$ cargo public-api --features all-apis | grep -i linux_raw_sys

The remaining APIs that expose linux_raw_sys are as follows:

pub type rustix::fs::FsWord = linux_raw_sys::general::__fsword_t
pub type rustix::fs::RawMode = linux_raw_sys::general::__kernel_mode_t
pub type rustix::fs::Stat = linux_raw_sys::general::stat
pub type rustix::fs::StatFs = linux_raw_sys::general::statfs64
pub type rustix::fs::Statx = linux_raw_sys::general::statx
pub type rustix::fs::StatxTimestamp = linux_raw_sys::general::statx_timestamp
pub rustix::io_uring::io_uring_cqe::big_cqe: linux_raw_sys::io_uring::__IncompleteArrayField<u64>
pub rustix::io_uring::io_uring_probe::ops: linux_raw_sys::io_uring::__IncompleteArrayField<rustix::io_uring::io_uring_probe_op>
pub type rustix::io_uring::Statx = linux_raw_sys::general::statx
pub type rustix::net::SocketAddrStorage = linux_raw_sys::net::sockaddr
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &linux_raw_sys::general::siginfo_t
pub type rustix::system::Sysinfo = linux_raw_sys::system::sysinfo
pub type rustix::termios::Winsize = linux_raw_sys::general::winsize

Signed-off-by: John Nunley <dev@notgull.net>

* break: Low-hanging fruit for removing libc from public API

Similarly to the last commit, this one removes libc types from the public API.
Again there are libc types that are harder to remove so I've skipped them for
now.

This can be checked with:

$ cargo public-api --features all-apis,use-libc | grep -i libc

The remaining API's are:

pub type rustix::fs::Dev = libc::unix::linux_like::linux::dev_t
pub type rustix::fs::FsWord = libc::unix::linux_like::linux::gnu::b64::__fsword_t
pub type rustix::fs::RawMode = libc::unix::linux_like::linux::mode_t
pub type rustix::fs::Stat = libc::unix::linux_like::linux::gnu::b64::x86_64::stat64
pub type rustix::fs::StatFs = libc::unix::linux_like::linux::gnu::b64::x86_64::statfs64
pub type rustix::fs::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::fs::StatxTimestamp = libc::unix::linux_like::linux::gnu::statx
pub type rustix::io_uring::Statx = libc::unix::linux_like::linux::gnu::statx
pub type rustix::net::SocketAddrStorage = libc::unix::linux_like::sockaddr_storage
pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &libc::unix::linux_like::linux::gnu::b64::x86_64::siginfo_t
pub type rustix::system::Sysinfo = libc::unix::linux_like::linux::gnu::b64::sysinfo
pub type rustix::termios::Winsize = libc::unix::winsize

Signed-off-by: John Nunley <dev@notgull.net>

---------

Signed-off-by: John Nunley <dev@notgull.net>

* Fix compile errors.

* Fix a warning.

* Fix a warning.

* Add `c_ulonglong`/`c_longlong` to the ffi module.

* Fix a warning.

* Add `ffi::c_void` on Windows.

* bugfix: Fix unused type in WASI (#1177)

Signed-off-by: John Nunley <dev@notgull.net>

* Use `as_ptr` and `.cast` to avoid `as` casts.

* Add some more libc type layout tests.

* Make `Secs` always be `i64`.

* Add casting helpers for timespec types.

---------

Signed-off-by: John Nunley <dev@notgull.net>
Co-authored-by: John Nunley <dev@notgull.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants