diff --git a/coreutils-ctor-1_x.diff b/coreutils-ctor-1_x.diff new file mode 100644 index 0000000..bd0c110 --- /dev/null +++ b/coreutils-ctor-1_x.diff @@ -0,0 +1,33 @@ +--- a/tests/test_util_name.rs ++++ b/tests/test_util_name.rs +@@ -16,7 +16,7 @@ pub const TESTS_BINARY: &str = env!("CAR + // Set the environment variable for any tests + + // Use the ctor attribute to run this function before any tests +-#[ctor::ctor] ++#[ctor::ctor(unsafe)] + fn init() { + // No need for unsafe here + unsafe { +--- a/tests/test_uudoc.rs ++++ b/tests/test_uudoc.rs +@@ -23,7 +23,7 @@ pub const TESTS_BINARY: &str = env!("CAR + // Set the environment variable for any tests + + // Use the ctor attribute to run this function before any tests +-#[ctor::ctor] ++#[ctor::ctor(unsafe)] + fn init() { + // No need for unsafe here + unsafe { +--- a/tests/tests.rs ++++ b/tests/tests.rs +@@ -8,7 +8,7 @@ use std::env; + pub const TESTS_BINARY: &str = env!("CARGO_BIN_EXE_coreutils"); + + // Use the ctor attribute to run this function before any tests +-#[ctor::ctor] ++#[ctor::ctor(unsafe)] + fn init() { + unsafe { + // Necessary for uutests to be able to find the binary diff --git a/coreutils-fix-metadata.diff b/coreutils-fix-metadata.diff index 1d9e38c..870dba7 100644 --- a/coreutils-fix-metadata.diff +++ b/coreutils-fix-metadata.diff @@ -1,5 +1,5 @@ --- coreutils-0.7.0/Cargo.toml 2006-07-24T01:21:28+00:00 -+++ coreutils-0.7.0/Cargo.toml 2026-04-14T19:49:54.150000+00:00 ++++ coreutils-0.7.0/Cargo.toml 2026-08-06T11:26:04.426642+00:00 @@ -719,7 +719,7 @@ package = "uu_runcon" @@ -9,3 +9,12 @@ optional = true [dependencies.seq] +@@ -930,7 +930,7 @@ + version = "0.6.8" + + [dev-dependencies.ctor] +-version = "0.6.0" ++version = "1" + + [dev-dependencies.filetime] + version = "0.2.23" diff --git a/rust-coreutils.spec b/rust-coreutils.spec index b46a72d..5fa87a6 100644 --- a/rust-coreutils.spec +++ b/rust-coreutils.spec @@ -33,7 +33,10 @@ URL: https://crates.io/crates/coreutils Source: %{crates_source} # Manually created patch for downstream crate metadata changes # * loosen selinux version bound from =0.6.0 to 0.6.0 +# * bump ctor from 0.6 to 1 Patch: coreutils-fix-metadata.diff +# * compatibility fixes for ctor 1.x +Patch2: coreutils-ctor-1_x.diff # leaf package, SIGABRT on compile ExcludeArch: %{ix86} diff --git a/rust2rpm.toml b/rust2rpm.toml index 4e432a3..b15fbfa 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -4,6 +4,7 @@ description = "coreutils ~ GNU coreutils (updated); implemented as universal (cr cargo-toml-patch-comments = [ "loosen selinux version bound from =0.6.0 to 0.6.0", + "bump ctor from 0.6 to 1", ] bin-package-name = "uutils-coreutils" @@ -19,6 +20,11 @@ extra-files = [ [package.bin-renames] coreutils = "uutils-coreutils" +[[package.extra-patches]] +number = 2 +file = "uutests-ctor-1_x.diff" +comments = ["compatibility fixes for ctor 1.x"] + [features] enable = [ "feat_os_unix", diff --git a/series b/series new file mode 100644 index 0000000..27b8738 --- /dev/null +++ b/series @@ -0,0 +1,2 @@ +coreutils-fix-metadata.diff +coreutils-ctor-1_x.diff