diff --git a/.gitignore b/.gitignore index 66c714a..372a90f 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ /rkyv-0.7.43.crate /rkyv-0.7.44.crate /rkyv-0.7.45.crate +/rkyv-0.8.8.crate diff --git a/0001-Fix-generic-SIMD-for-big-endian-targets.patch b/0001-Fix-generic-SIMD-for-big-endian-targets.patch new file mode 100644 index 0000000..9ac44e1 --- /dev/null +++ b/0001-Fix-generic-SIMD-for-big-endian-targets.patch @@ -0,0 +1,32 @@ +From 6d6a5461e42cac18707dfee42b9f41ee7d078866 Mon Sep 17 00:00:00 2001 +From: David Koloski +Date: Tue, 1 Oct 2024 11:54:40 -0400 +Subject: [PATCH] Fix generic SIMD for big-endian targets + +--- + src/simd/generic.rs | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/simd/generic.rs b/src/simd/generic.rs +index 6f6cc56..d3b1b94 100644 +--- a/src/simd/generic.rs ++++ b/src/simd/generic.rs +@@ -73,7 +73,14 @@ impl Group { + pub unsafe fn read(ptr: *const u8) -> Self { + // SAFETY: The caller has guaranteed that `ptr` is valid for reads and + // points to enough bytes for a `Word`. +- unsafe { Self(core::ptr::read_unaligned(ptr.cast())) } ++ #[cfg(target_endian = "little")] ++ unsafe { ++ Self(core::ptr::read_unaligned(ptr.cast())) ++ } ++ #[cfg(target_endian = "big")] ++ unsafe { ++ Self(core::ptr::read_unaligned(ptr.cast::()).swap_bytes()) ++ } + } + + #[inline] +-- +2.46.1 + diff --git a/rkyv-fix-metadata.diff b/rkyv-fix-metadata.diff index 8a5e1c1..589089c 100644 --- a/rkyv-fix-metadata.diff +++ b/rkyv-fix-metadata.diff @@ -1,81 +1,134 @@ ---- rkyv-0.7.45/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ rkyv-0.7.45/Cargo.toml 2024-08-30T19:01:30.121523+00:00 -@@ -47,29 +47,14 @@ - optional = true - default-features = false +--- rkyv-0.8.8/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ rkyv-0.8.8/Cargo.toml 2024-10-08T15:00:00.726373+00:00 +@@ -77,10 +77,6 @@ + name = "derive" + path = "tests/derive.rs" + +-[[test]] +-name = "ui" +-path = "tests/ui.rs" +- + [[bench]] + name = "log" + path = "benches/log.rs" +@@ -96,34 +92,16 @@ + path = "benches/minecraft_savedata.rs" + harness = false --[dependencies.bitvec] --version = "1.0" +-[dependencies.arrayvec-0_7] +-version = "0.7" -optional = true -default-features = false +-package = "arrayvec" - [dependencies.bytecheck] - version = "0.6.11" + version = "0.8" + features = ["simdutf8"] optional = true default-features = false --[dependencies.bytes] --version = "1.4.0" -+[dependencies.hashbrown] -+version = "0.14" - optional = true +-[dependencies.bytes-1] +-version = "1" +-optional = true -default-features = false +-package = "bytes" - --[dependencies.hashbrown] --version = "0.12" --optional = true + [dependencies.hashbrown] + version = "0.14" + optional = true + default-features = false - --[dependencies.indexmap] --version = "1.7" +-[dependencies.indexmap-2] +-version = "2" -optional = true -default-features = false +-package = "indexmap" - [dependencies.ptr_meta] - version = "~0.1.3" -@@ -86,31 +71,9 @@ - [dependencies.seahash] - version = "4.0" + [dependencies.munge] + version = "0.4" +@@ -145,48 +123,6 @@ + version = "=0.8.8" + default-features = false --[dependencies.smallvec] --version = "1.7" +-[dependencies.smallvec-1] +-version = "1" -optional = true -default-features = false +-package = "smallvec" - --[dependencies.smol_str] +-[dependencies.smol_str-0_2] -version = "0.2" -optional = true -default-features = false +-package = "smol_str" - --[dependencies.tinyvec] --version = "1.5" +-[dependencies.smol_str-0_3] +-version = "0.3" -optional = true -default-features = false +-package = "smol_str" - --[dependencies.uuid] --version = "1.3" +-[dependencies.thin-vec-0_2] +-version = "0.2.12" -optional = true -default-features = false +-package = "thin-vec" - - [features] +-[dependencies.tinyvec-1] +-version = "1" +-optional = true +-default-features = false +-package = "tinyvec" +- +-[dependencies.triomphe-0_1] +-version = "0.1" +-optional = true +-default-features = false +-package = "triomphe" +- +-[dependencies.uuid-1] +-version = "1" +-optional = true +-default-features = false +-package = "uuid" +- + [dev-dependencies.ahash] + version = "0.8" + +@@ -202,7 +138,6 @@ + aligned = [] alloc = [ - "hashbrown", -- "bitvec?/alloc", -- "tinyvec?/alloc", + "dep:hashbrown", +- "tinyvec-1?/alloc", + "rancor/alloc", ] - arbitrary_enum_discriminant = ["rkyv_derive/arbitrary_enum_discriminant"] - archive_be = [ -@@ -135,14 +98,8 @@ - "bytecheck?/std", - "ptr_meta/std", - "rend?/std", -- "uuid?/std", -- "bytes?/std", + big_endian = [] +@@ -215,28 +150,12 @@ + "std", + "bytecheck", ] - strict = ["rkyv_derive/strict"] --uuid = [ -- "dep:uuid", -- "bytecheck?/uuid", +-hashbrown-0_14 = ["dep:hashbrown"] +-indexmap-2 = [ +- "dep:indexmap-2", +- "alloc", -] - validation = [ + little_endian = [] + pointer_width_16 = [] + pointer_width_32 = [] + pointer_width_64 = [] + std = [ "alloc", - "bytecheck", +- "bytes-1?/std", +- "indexmap-2?/std", + "ptr_meta/std", +- "uuid-1?/std", +-] +-triomphe-0_1 = [ +- "dep:triomphe-0_1", +- "alloc", + ] + unaligned = [] +-uuid-1 = [ +- "dep:uuid-1", +- "bytecheck?/uuid-1", +-] diff --git a/rust-rkyv.spec b/rust-rkyv.spec index 01f4bf1..a970fab 100644 --- a/rust-rkyv.spec +++ b/rust-rkyv.spec @@ -5,7 +5,7 @@ %global crate rkyv Name: rust-rkyv -Version: 0.7.45 +Version: 0.8.8 Release: %autorelease Summary: Zero-copy deserialization framework for Rust @@ -13,11 +13,25 @@ License: MIT URL: https://crates.io/crates/rkyv Source: %{crates_source} # Manually created patch for downstream crate metadata changes -# * bump hashbrown dependency from 0.12 to 0.14 -# * drop unused support for various third-party crates +# * Where possible, patch out "support for common crates" features. Many of +# these have satisfiable dependencies and could be packaged if something +# specifically requires them. Upstream plans to remove these crate-integration +# features in 1.0: +# https://github.com/rkyv/rkyv/blob/89a1bc48229ca6ac5ee620964d778293270257d0/rkyv/Cargo.toml#L29-L32 +# * Patch out the ui test, which seems to require *all* integrations, even the +# patched-out ones Patch: rkyv-fix-metadata.diff +# * Fix generic SIMD for big-endian targets: +# https://github.com/rkyv/rkyv/commit/6d6a5461e42cac18707dfee42b9f41ee7d078866 +# * Fixes: “Some tests related to hash_map fail on big-endian platforms” +# https://github.com/rkyv/rkyv/issues/557 +# * Exported with "git format-patch --relative" so that the patch applies to the +# released crate. +Patch10: 0001-Fix-generic-SIMD-for-big-endian-targets.patch BuildRequires: cargo-rpm-macros >= 24 +BuildRequires: dos2unix +BuildRequires: tomcli %global _description %{expand: Zero-copy deserialization framework for Rust.} @@ -36,7 +50,6 @@ use the "%{crate}" crate. %files devel %license %{crate_instdir}/LICENSE %doc %{crate_instdir}/README.md -%doc %{crate_instdir}/crates-io.md %{crate_instdir}/ %package -n %{name}+default-devel @@ -51,64 +64,40 @@ use the "default" feature of the "%{crate}" crate. %files -n %{name}+default-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+alloc-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+alloc-devel %{_description} - -This package contains library source intended for building other packages which -use the "alloc" feature of the "%{crate}" crate. - -%files -n %{name}+alloc-devel -%ghost %{crate_instdir}/Cargo.toml - -%package -n %{name}+arbitrary_enum_discriminant-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+arbitrary_enum_discriminant-devel %{_description} - -This package contains library source intended for building other packages which -use the "arbitrary_enum_discriminant" feature of the "%{crate}" crate. - -%files -n %{name}+arbitrary_enum_discriminant-devel -%ghost %{crate_instdir}/Cargo.toml - -%package -n %{name}+archive_be-devel +%package -n %{name}+aligned-devel Summary: %{summary} BuildArch: noarch -%description -n %{name}+archive_be-devel %{_description} +%description -n %{name}+aligned-devel %{_description} This package contains library source intended for building other packages which -use the "archive_be" feature of the "%{crate}" crate. +use the "aligned" feature of the "%{crate}" crate. -%files -n %{name}+archive_be-devel +%files -n %{name}+aligned-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+archive_le-devel +%package -n %{name}+alloc-devel Summary: %{summary} BuildArch: noarch -%description -n %{name}+archive_le-devel %{_description} +%description -n %{name}+alloc-devel %{_description} This package contains library source intended for building other packages which -use the "archive_le" feature of the "%{crate}" crate. +use the "alloc" feature of the "%{crate}" crate. -%files -n %{name}+archive_le-devel +%files -n %{name}+alloc-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+arrayvec-devel +%package -n %{name}+big_endian-devel Summary: %{summary} BuildArch: noarch -%description -n %{name}+arrayvec-devel %{_description} +%description -n %{name}+big_endian-devel %{_description} This package contains library source intended for building other packages which -use the "arrayvec" feature of the "%{crate}" crate. +use the "big_endian" feature of the "%{crate}" crate. -%files -n %{name}+arrayvec-devel +%files -n %{name}+big_endian-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+bytecheck-devel @@ -123,88 +112,52 @@ use the "bytecheck" feature of the "%{crate}" crate. %files -n %{name}+bytecheck-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+copy-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+copy-devel %{_description} - -This package contains library source intended for building other packages which -use the "copy" feature of the "%{crate}" crate. - -%files -n %{name}+copy-devel -%ghost %{crate_instdir}/Cargo.toml - -%package -n %{name}+copy_unsafe-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+copy_unsafe-devel %{_description} - -This package contains library source intended for building other packages which -use the "copy_unsafe" feature of the "%{crate}" crate. - -%files -n %{name}+copy_unsafe-devel -%ghost %{crate_instdir}/Cargo.toml - -%package -n %{name}+hashbrown-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+hashbrown-devel %{_description} - -This package contains library source intended for building other packages which -use the "hashbrown" feature of the "%{crate}" crate. - -%files -n %{name}+hashbrown-devel -%ghost %{crate_instdir}/Cargo.toml - -%package -n %{name}+rend-devel +%package -n %{name}+little_endian-devel Summary: %{summary} BuildArch: noarch -%description -n %{name}+rend-devel %{_description} +%description -n %{name}+little_endian-devel %{_description} This package contains library source intended for building other packages which -use the "rend" feature of the "%{crate}" crate. +use the "little_endian" feature of the "%{crate}" crate. -%files -n %{name}+rend-devel +%files -n %{name}+little_endian-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+size_16-devel +%package -n %{name}+pointer_width_16-devel Summary: %{summary} BuildArch: noarch -%description -n %{name}+size_16-devel %{_description} +%description -n %{name}+pointer_width_16-devel %{_description} This package contains library source intended for building other packages which -use the "size_16" feature of the "%{crate}" crate. +use the "pointer_width_16" feature of the "%{crate}" crate. -%files -n %{name}+size_16-devel +%files -n %{name}+pointer_width_16-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+size_32-devel +%package -n %{name}+pointer_width_32-devel Summary: %{summary} BuildArch: noarch -%description -n %{name}+size_32-devel %{_description} +%description -n %{name}+pointer_width_32-devel %{_description} This package contains library source intended for building other packages which -use the "size_32" feature of the "%{crate}" crate. +use the "pointer_width_32" feature of the "%{crate}" crate. -%files -n %{name}+size_32-devel +%files -n %{name}+pointer_width_32-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+size_64-devel +%package -n %{name}+pointer_width_64-devel Summary: %{summary} BuildArch: noarch -%description -n %{name}+size_64-devel %{_description} +%description -n %{name}+pointer_width_64-devel %{_description} This package contains library source intended for building other packages which -use the "size_64" feature of the "%{crate}" crate. +use the "pointer_width_64" feature of the "%{crate}" crate. -%files -n %{name}+size_64-devel +%files -n %{name}+pointer_width_64-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+std-devel @@ -219,32 +172,26 @@ use the "std" feature of the "%{crate}" crate. %files -n %{name}+std-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+strict-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+strict-devel %{_description} - -This package contains library source intended for building other packages which -use the "strict" feature of the "%{crate}" crate. - -%files -n %{name}+strict-devel -%ghost %{crate_instdir}/Cargo.toml - -%package -n %{name}+validation-devel +%package -n %{name}+unaligned-devel Summary: %{summary} BuildArch: noarch -%description -n %{name}+validation-devel %{_description} +%description -n %{name}+unaligned-devel %{_description} This package contains library source intended for building other packages which -use the "validation" feature of the "%{crate}" crate. +use the "unaligned" feature of the "%{crate}" crate. -%files -n %{name}+validation-devel +%files -n %{name}+unaligned-devel %ghost %{crate_instdir}/Cargo.toml %prep %autosetup -n %{crate}-%{version} -p1 +# Do not depend on divan; it is needed only for benchmarks. +tomcli set Cargo.toml del dev-dependencies.divan +# The crate has a mixture of newline styles. +# Fixed upstream in: +# https://github.com/rkyv/rkyv/commit/6b7ab529d32166ec0fc81b7b8828ba71e2c65c38 +find . -type f | xargs -r -t dos2unix --keepdate %cargo_prep %generate_buildrequires diff --git a/rust2rpm.toml b/rust2rpm.toml index a3d3df9..2fd8216 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -1,6 +1,39 @@ [package] cargo-toml-patch-comments = [ - "bump hashbrown dependency from 0.12 to 0.14", - "drop unused support for various third-party crates", + """\ + Where possible, patch out \"support for common crates\" features. Many of \ + these have satisfiable dependencies and could be packaged if something \ + specifically requires them. Upstream plans to remove these \ + crate-integration features in 1.0: \ + https://github.com/rkyv/rkyv/blob/89a1bc48229ca6ac5ee620964d778293270257d0/rkyv/Cargo.toml#L29-L32\ + """, + """\ + Patch out the ui test, which seems to require *all* integrations, even the \ + patched-out ones\ + """, ] +[requires] +build = [ + "dos2unix", + "tomcli", +] + +[scripts.prep] +pre = [ + "# Do not depend on divan; it is needed only for benchmarks.", + "tomcli set Cargo.toml del dev-dependencies.divan", + "# The crate has a mixture of newline styles.", + "# Fixed upstream in:", + "# https://github.com/rkyv/rkyv/commit/6b7ab529d32166ec0fc81b7b8828ba71e2c65c38", + "find . -type f | xargs -r -t dos2unix --keepdate", +] + +[[package.extra-patches]] +number = 10 +file = "0001-Fix-generic-SIMD-for-big-endian-targets.patch" +comments = [ + "Fix generic SIMD for big-endian targets: https://github.com/rkyv/rkyv/commit/6d6a5461e42cac18707dfee42b9f41ee7d078866", + "Fixes: “Some tests related to hash_map fail on big-endian platforms” https://github.com/rkyv/rkyv/issues/557", + "Exported with \"git format-patch --relative\" so that the patch applies to the released crate." +] diff --git a/sources b/sources index ecfa2b5..c3d4a70 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rkyv-0.7.45.crate) = bac10c6e7e7f797e505cc8103c55ae2fd4b04a76631e085fcf1c8f2b05e52c064cb14145479dadc292995b7ca5bbab5235d54d8e651bf47623a0228f936f73c9 +SHA512 (rkyv-0.8.8.crate) = 3be2627c021a134182bd24085bb5914f84cc4805e4bc41540104c2cfca27403f1e7bdcf69f9a0ccdb967445123883bb264b2d918316932ffa686910cf3df0c96