Skip to content

Be #1472

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Be #1472

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 10 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -38,15 +38,15 @@ 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 }

# Additional dependencies for Linux with the libc backend:
#
# 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.
Expand All @@ -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 = "." }
Copy link
Contributor

Choose a reason for hiding this comment

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

This will make it impossible to do a semver incompatible release of rustix as there is no tempfile version that has a semver compatible dependency on rustix yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't really see a good solution to this problem. I guess the real problem is that there is a cyclic dependency, but the two projects are both under separate ownership. The only clean solution I can see is to remove that dependency and trty to find an alternative crate. The change is outside the scope of my original PR really, I just wanted to try and get the CI working to ensure I didn't introduce any regressions. But it seems unfortunately that new releases of other crates change the result of the CI. Happy to take advice on how to proceed here.

Copy link
Contributor

Choose a reason for hiding this comment

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

One option would be to keep the big-endian CI disabled for now and only enable it once there is a new rustix release.

Copy link
Member

Choose a reason for hiding this comment

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

tempfile's use of rustix is not part of rustix's testsuite. We don't need to make tempfile's version of rustix match the version of rustix using tempfile for tests. They can differ and it's fine.


[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"
Expand Down
6 changes: 3 additions & 3 deletions src/backend/linux_raw/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These constants are used in the tests here and here. Not related to the purpose of my change, but trying to get the CI into life to check for any regressions.

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 _;
Expand Down
Loading