diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 14230a6b8..2d873a82e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,6 +57,9 @@ jobs: cargo update --package=flate2 --precise=1.0.35 cargo update --package=textwrap --precise=0.16.1 cargo update --package=once_cell --precise=1.20.3 + cargo update --package=parking_lot --precise=0.12.3 + cargo update --package=parking_lot_core --precise=0.9.10 + cargo update --package=lock_api --precise=0.4.12 - run: > rustup target add @@ -215,6 +218,8 @@ jobs: # See the comments in the libc crate RUSTFLAGS: -A improper_ctypes_definitions --cfg criterion - run: rustup component add rust-src + - run: cargo check -Z build-std --target=armeb-unknown-linux-gnueabi --all-targets --features=all-apis + - run: cargo check -Z build-std --target=aarch64_be-unknown-linux-gnu --all-targets --features=all-apis - run: cargo check -Z build-std --target x86_64-unknown-openbsd --all-targets --features=all-apis - run: cargo check -Z build-std --target mips64-openwrt-linux-musl --all-targets --features=all-apis - run: cargo check -Z build-std --target x86_64-unknown-dragonfly --all-targets --features=all-apis @@ -537,6 +542,9 @@ jobs: cargo update --package=flate2 --precise=1.0.35 cargo update --package=textwrap --precise=0.16.1 cargo update --package=once_cell --precise=1.20.3 + cargo update --package=parking_lot --precise=0.12.3 + cargo update --package=parking_lot_core --precise=0.9.10 + cargo update --package=lock_api --precise=0.4.12 - run: | cargo test --verbose --features=all-apis --release --workspace -- --nocapture diff --git a/Cargo.toml b/Cargo.toml index a90bf738c..b1e2bc9bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ compiler_builtins = { version = '0.1.49', optional = true } # addition to the libc backend. The linux_raw backend is used by default. The # libc backend can be selected via adding `--cfg=rustix_use_libc` to # `RUSTFLAGS` or enabling the `use-libc` cargo feature. -[target.'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc")), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))'.dependencies] +[target.'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc", target_arch = "arm", target_arch = "aarch64" )), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))'.dependencies] linux-raw-sys = { version = "0.9.2", default-features = false, features = ["general", "errno", "ioctl", "no_std", "elf"] } libc_errno = { package = "errno", version = "0.3.10", default-features = false, optional = true } libc = { version = "0.2.171", default-features = false, optional = true } @@ -38,7 +38,7 @@ libc = { version = "0.2.171", default-features = false, optional = true } # # On all other Unix-family platforms, and under Miri, we always use the libc # backend, so enable its dependencies unconditionally. -[target.'cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc")), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies] +[target.'cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc", target_arch = "arm", target_arch = "aarch64")), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies] libc_errno = { package = "errno", version = "0.3.10", default-features = false } libc = { version = "0.2.171", default-features = false } @@ -46,7 +46,7 @@ libc = { version = "0.2.171", default-features = false } # # Some syscalls do not have libc wrappers, such as in `io_uring`. For these, # the libc backend uses the linux-raw-sys ABI and `libc::syscall`. -[target.'cfg(all(any(target_os = "android", target_os = "linux"), any(rustix_use_libc, miri, not(all(target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc")), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies] +[target.'cfg(all(any(target_os = "android", target_os = "linux"), any(rustix_use_libc, miri, not(all(target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc", target_arch = "arm", target_arch = "aarch64")), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies] linux-raw-sys = { version = "0.9.2", default-features = false, features = ["general", "ioctl", "no_std"] } # For the libc backend on Windows, use the Winsock API in windows-sys. @@ -64,8 +64,14 @@ version = "0.3.10" package = "errno" default-features = false +# Rustix uses tempfile for its tests, which in turn uses rustix! We want to use +# the same consistent version. We therefore need to use a version of tempfile +# for which its rustix dependency is a semver match for our current version. +[patch.crates-io] +rustix = { path = "." } + [dev-dependencies] -tempfile = "3.5.0" +tempfile = "3.20.0" libc = "0.2.171" libc_errno = { package = "errno", version = "0.3.10", default-features = false } serial_test = "2.0.0" diff --git a/src/backend/linux_raw/c.rs b/src/backend/linux_raw/c.rs index 4dc9c8cd7..8bc1ab4a2 100644 --- a/src/backend/linux_raw/c.rs +++ b/src/backend/linux_raw/c.rs @@ -286,11 +286,11 @@ pub(crate) const SIGSYS: c_int = linux_raw_sys::general::SIGSYS as _; ))] pub(crate) const SIGEMT: c_int = linux_raw_sys::general::SIGEMT as _; -#[cfg(feature = "stdio")] +#[cfg(any(test, feature = "stdio"))] pub(crate) const STDIN_FILENO: c_int = linux_raw_sys::general::STDIN_FILENO as _; -#[cfg(feature = "stdio")] +#[cfg(any(test, feature = "stdio"))] pub(crate) const STDOUT_FILENO: c_int = linux_raw_sys::general::STDOUT_FILENO as _; -#[cfg(feature = "stdio")] +#[cfg(any(test, feature = "stdio"))] pub(crate) const STDERR_FILENO: c_int = linux_raw_sys::general::STDERR_FILENO as _; pub(crate) const PIPE_BUF: usize = linux_raw_sys::general::PIPE_BUF as _;