From df74f689beee730ae2360834a8c2eafcf35368d8 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Wed, 16 Sep 2026 21:11:01 +0100 Subject: [PATCH 1/3] build: work around blake3 failure on i586-unknown-redox Add a workaround for the `blake3` build failure on `i586-unknown-redox`: ```console error: failed to run custom build command for `blake3 v1.8.7` ``` --- .cargo/config.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.cargo/config.toml b/.cargo/config.toml index 93ff01ac4e8..7434b905168 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,6 +2,8 @@ # like e.g. out-of-tree builds ( https://github.com/rust-lang/cargo/issues/2930 ). # For this reason this file should be avoided as much as possible when there are alternatives. +[target.i586-unknown-redox] +linker = "i586-unknown-redox-gcc" [target.x86_64-unknown-redox] linker = "x86_64-unknown-redox-gcc" [target.aarch64-unknown-linux-gnu] From ec70972cdc7ba83a6a93bcd6fe9954101ff4cb16 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Wed, 16 Sep 2026 20:11:21 +0100 Subject: [PATCH 2/3] fix: address compilation errors on redox --- tests/by-util/test_test.rs | 7 +++---- tests/uutests/src/lib/util.rs | 10 +++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/tests/by-util/test_test.rs b/tests/by-util/test_test.rs index 08675961896..084cd711a2e 100644 --- a/tests/by-util/test_test.rs +++ b/tests/by-util/test_test.rs @@ -635,10 +635,9 @@ fn test_file_is_not_executable() { let metadata = std::fs::metadata(at.plus("regular_file")).unwrap(); let mut permissions = metadata.permissions(); - // The conversion is useless on some platforms and casts from u16 to - // u32 on others - #[allow(clippy::useless_conversion)] - permissions.set_mode(permissions.mode() & !u32::from(libc::S_IXUSR)); + // Cast is necessary on some platforms + #[allow(clippy::unnecessary_cast)] + permissions.set_mode(permissions.mode() & !(libc::S_IXUSR as u32)); std::fs::set_permissions(at.plus("regular_file"), permissions).unwrap(); } ucmd.args(&["!", "-x", "regular_file"]).succeeds(); diff --git a/tests/uutests/src/lib/util.rs b/tests/uutests/src/lib/util.rs index a8152cbba8a..cf1e72893f4 100644 --- a/tests/uutests/src/lib/util.rs +++ b/tests/uutests/src/lib/util.rs @@ -17,7 +17,7 @@ use core::str; #[cfg(unix)] use libc::mode_t; -#[cfg(unix)] +#[cfg(all(unix, not(target_os = "redox")))] use nix::pty::OpenptyResult; #[cfg(unix)] use nix::sys; @@ -1957,9 +1957,9 @@ impl UCommand { let mut captured_stdout = None; let mut captured_stderr = None; - #[cfg(unix)] + #[cfg(all(unix, not(target_os = "redox")))] let mut stdin_pty: Option = None; - #[cfg(not(unix))] + #[cfg(not(all(unix, not(target_os = "redox"))))] let stdin_pty: Option = None; if self.stderr_to_stdout { let mut output = CapturedOutput::default(); @@ -1994,7 +1994,7 @@ impl UCommand { .stderr(stderr); } - #[cfg(unix)] + #[cfg(all(unix, not(target_os = "redox")))] if let Some(simulated_terminal) = &self.terminal_simulation { let terminal_size = simulated_terminal.size.unwrap_or(libc::winsize { ws_col: 80, @@ -2995,7 +2995,7 @@ pub fn whoami() -> String { /// - path: The filesystem path to the PTY replica device /// - controller: The controller file /// - replica: The replica file -#[cfg(unix)] +#[cfg(all(unix, not(target_os = "redox")))] pub fn pty_path() -> (String, File, File) { use nix::pty::openpty; use nix::unistd::ttyname; From c6ab4f832342241b5cd4d8738fe761e1e5f2024c Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Wed, 16 Sep 2026 20:46:58 +0100 Subject: [PATCH 3/3] chore: fix clippy lints on redox --- src/uucore/src/lib/features/fsext/mod.rs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/uucore/src/lib/features/fsext/mod.rs b/src/uucore/src/lib/features/fsext/mod.rs index 5286089ad66..b52a490a612 100644 --- a/src/uucore/src/lib/features/fsext/mod.rs +++ b/src/uucore/src/lib/features/fsext/mod.rs @@ -538,7 +538,6 @@ impl FsMeta for StatFs { not(target_env = "musl"), not(target_os = "freebsd"), not(target_os = "netbsd"), - not(target_os = "redox"), not(target_os = "cygwin"), any( target_arch = "s390x", @@ -555,8 +554,8 @@ impl FsMeta for StatFs { target_os = "netbsd", target_os = "illumos", target_os = "solaris", - target_os = "redox", target_os = "cygwin", + all(target_os = "redox", target_pointer_width = "64") ))] return self.f_bsize.try_into().unwrap(); } @@ -648,7 +647,12 @@ impl FsMeta for StatFs { } /// The preferred transfer size, which on Linux is `f_bsize`. - #[cfg(any(target_os = "aix", target_os = "linux", target_os = "android"))] + #[cfg(any( + target_os = "aix", + target_os = "linux", + target_os = "android", + target_os = "redox" + ))] #[allow(clippy::unnecessary_cast)] fn io_size(&self) -> u64 { self.f_bsize as u64 @@ -668,7 +672,8 @@ impl FsMeta for StatFs { target_os = "freebsd", target_os = "linux", target_os = "android", - target_os = "netbsd" + target_os = "netbsd", + target_os = "redox" )))] fn io_size(&self) -> u64 { self.f_bsize as u64 @@ -718,7 +723,8 @@ impl FsMeta for StatFs { target_os = "aix", target_os = "freebsd", target_os = "netbsd", - target_os = "openbsd" + target_os = "openbsd", + target_os = "redox" ))] #[allow(clippy::unnecessary_cast)] fn namelen(&self) -> u64 { @@ -732,7 +738,8 @@ impl FsMeta for StatFs { target_os = "linux", target_os = "android", target_os = "netbsd", - target_os = "openbsd" + target_os = "openbsd", + target_os = "redox" )))] fn namelen(&self) -> u64 { self.f_namemax as u64 // spell-checker:disable-line