From 9bedbafa06a31f4732e3de566efaf73ef5719ab5 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sat, 14 Mar 2026 12:50:39 +0700 Subject: [PATCH] Update uutils to latest release --- recipes/core/uutils/recipe.toml | 3 +- recipes/core/uutils/redox.patch | 125 +++++++++++--------------------- 2 files changed, 45 insertions(+), 83 deletions(-) diff --git a/recipes/core/uutils/recipe.toml b/recipes/core/uutils/recipe.toml index 3080a4cca..0fa45ed91 100644 --- a/recipes/core/uutils/recipe.toml +++ b/recipes/core/uutils/recipe.toml @@ -1,9 +1,8 @@ # TODO Fix coreutils i18n/l10n behavior on Redox -# TODO waiting for rustix bump before removing patches # TODO Fix locale init bug on aarch64 before removing patches [source] git = "https://github.com/uutils/coreutils" -rev = "aa218a30aca43fd1805841357ff885afbd9090c3" +rev = "0.7.0" patches = [ "redox.patch" ] diff --git a/recipes/core/uutils/redox.patch b/recipes/core/uutils/redox.patch index 976e31d0f..b43077358 100644 --- a/recipes/core/uutils/redox.patch +++ b/recipes/core/uutils/redox.patch @@ -1,36 +1,8 @@ -diff --git a/Cargo.lock b/Cargo.lock -index 49bf30262..37b5a89ec 100644 ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -2476,9 +2476,9 @@ dependencies = [ - - [[package]] - name = "rustix" --version = "1.1.3" -+version = "1.1.2" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" -+checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" - dependencies = [ - "bitflags 2.10.0", - "errno", -@@ -2786,9 +2786,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - - [[package]] - name = "tempfile" --version = "3.24.0" -+version = "3.23.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" -+checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" - dependencies = [ - "fastrand", - "getrandom 0.3.4", diff --git a/Cargo.toml b/Cargo.toml -index 3c8fea771..b04ac85a3 100644 +index b0015fa6f..cfb2b1b30 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -265,6 +265,7 @@ feat_os_unix_redox = [ +@@ -326,6 +326,7 @@ feat_os_unix_redox = [ "feat_common_core", # "chmod", @@ -39,57 +11,48 @@ index 3c8fea771..b04ac85a3 100644 "uname", ] diff --git a/src/uucore/src/lib/features/fs.rs b/src/uucore/src/lib/features/fs.rs -index a783d04ea..33967f5de 100644 +index fd1f30303..c508f6b9b 100644 --- a/src/uucore/src/lib/features/fs.rs +++ b/src/uucore/src/lib/features/fs.rs -@@ -839,23 +839,39 @@ pub fn make_fifo(path: &Path) -> std::io::Result<()> { +@@ -13,7 +13,7 @@ use libc::{ + S_IRUSR, S_ISGID, S_ISUID, S_ISVTX, S_IWGRP, S_IWOTH, S_IWUSR, S_IXGRP, S_IXOTH, S_IXUSR, + mkfifo, mode_t, + }; +-#[cfg(all(unix, not(target_os = "redox")))] ++#[cfg(unix)] + pub use libc::{major, makedev, minor}; + use std::collections::HashSet; + use std::collections::VecDeque; +@@ -849,24 +849,6 @@ pub fn make_fifo(path: &Path) -> std::io::Result<()> { + } } - // Redox's libc appears not to include the following utilities -+// TODO: Waiting for rustix release that includes https://github.com/rust-lang/libc/commit/76e737e - +-// Redox's libc appears not to include the following utilities +- -#[cfg(target_os = "redox")] -+#[cfg(all(target_os = "redox", target_pointer_width = "64"))] - pub fn major(dev: libc::dev_t) -> libc::c_uint { - (((dev >> 8) & 0xFFF) | ((dev >> 32) & 0xFFFFF000)) as _ - } - +-pub fn major(dev: libc::dev_t) -> libc::c_uint { +- (((dev >> 8) & 0xFFF) | ((dev >> 32) & 0xFFFFF000)) as _ +-} +- -#[cfg(target_os = "redox")] -+#[cfg(all(target_os = "redox", target_pointer_width = "64"))] - pub fn minor(dev: libc::dev_t) -> libc::c_uint { - ((dev & 0xFF) | ((dev >> 12) & 0xFFFFF00)) as _ - } - +-pub fn minor(dev: libc::dev_t) -> libc::c_uint { +- ((dev & 0xFF) | ((dev >> 12) & 0xFFFFF00)) as _ +-} +- -#[cfg(target_os = "redox")] -+#[cfg(all(target_os = "redox", target_pointer_width = "64"))] - pub fn makedev(maj: libc::c_uint, min: libc::c_uint) -> libc::dev_t { - let [maj, min] = [maj as libc::dev_t, min as libc::dev_t]; - (min & 0xff) | ((maj & 0xfff) << 8) | ((min & !0xff) << 12) | ((maj & !0xfff) << 32) - } - -+#[cfg(all(target_os = "redox", target_pointer_width = "32"))] -+pub fn major(_: libc::dev_t) -> libc::c_uint { -+ 0 -+} -+ -+#[cfg(all(target_os = "redox", target_pointer_width = "32"))] -+pub fn minor(_: libc::dev_t) -> libc::c_uint { -+ 0 -+} -+ -+#[cfg(all(target_os = "redox", target_pointer_width = "32"))] -+pub fn makedev(_: libc::c_uint, _: libc::c_uint) -> libc::dev_t { -+ 0 -+} -+ +-pub fn makedev(maj: libc::c_uint, min: libc::c_uint) -> libc::dev_t { +- let [maj, min] = [maj as libc::dev_t, min as libc::dev_t]; +- (min & 0xff) | ((maj & 0xfff) << 8) | ((min & !0xff) << 12) | ((maj & !0xfff) << 32) +-} +- #[cfg(test)] mod tests { // Note this useful idiom: importing names from outer (for mod tests) scope. diff --git a/src/uucore/src/lib/mods/locale.rs b/src/uucore/src/lib/mods/locale.rs -index ec9a78b43..2faccec5c 100644 +index e7d05f4c7..d86e51e98 100644 --- a/src/uucore/src/lib/mods/locale.rs +++ b/src/uucore/src/lib/mods/locale.rs -@@ -195,10 +195,11 @@ fn init_localization( +@@ -212,10 +212,11 @@ fn init_localization( } }; @@ -103,18 +66,18 @@ index ec9a78b43..2faccec5c 100644 Ok(()) } -@@ -400,10 +401,12 @@ pub fn setup_localization(p: &str) -> Result<(), LocalizationError> { - let english_bundle = create_english_bundle_from_embedded(&default_locale, p)?; - let localizer = Localizer::new(english_bundle); +@@ -431,10 +432,12 @@ pub fn setup_localization(p: &str) -> Result<(), LocalizationError> { + let english_bundle = create_english_bundle_from_embedded(&default_locale, p)?; + let localizer = Localizer::new(english_bundle); -- LOCALIZER.with(|lock| { -+ // TODO: In aarch64 redox OS, this lock (once cell) is already initialized out of nothing -+ // TODO: When this code is used? Patching for keep sake -+ let _ = LOCALIZER.with(|lock| { - lock.set(localizer) - .map_err(|_| LocalizationError::Bundle("Localizer already initialized".into())) -- })?; -+ }); - Ok(()) - } +- LOCALIZER.with(|lock| { ++ // TODO: In aarch64 redox OS, this lock (once cell) is already initialized out of nothing ++ // TODO: When this code is used? Patching for keep sake ++ let _ = LOCALIZER.with(|lock| { + lock.set(localizer) + .map_err(|_| LocalizationError::Bundle("Localizer already initialized".into())) +- })?; ++ }); } + LOCALIZER_IS_SET.with(|f| f.set(true)); + Ok(())