From 77e7b40224642d1c4960e465be524c4bd37f7dd7 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 27 Jan 2020 16:53:10 -0800 Subject: [PATCH] Bump to ahash 0.3.2 and rand 0.7.3 Prune unstable features --- 0001-Upgrade-to-ahash-0.3.2.patch | 25 ++++++++++ 0001-Upgrade-to-rand-0.7.3.patch | 35 +++++++++++++ hashbrown-fix-metadata.diff | 23 ++++++++- rust-hashbrown.spec | 81 +++---------------------------- 4 files changed, 89 insertions(+), 75 deletions(-) create mode 100644 0001-Upgrade-to-ahash-0.3.2.patch create mode 100644 0001-Upgrade-to-rand-0.7.3.patch diff --git a/0001-Upgrade-to-ahash-0.3.2.patch b/0001-Upgrade-to-ahash-0.3.2.patch new file mode 100644 index 0000000..ccd316e --- /dev/null +++ b/0001-Upgrade-to-ahash-0.3.2.patch @@ -0,0 +1,25 @@ +From c4945f2cde25f388654cbd4614fd1b236a128986 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Mon, 27 Jan 2020 16:24:00 -0800 +Subject: [PATCH] Upgrade to ahash 0.3.2 + +--- + src/map.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/map.rs b/src/map.rs +index 5bb4a9d358b9..54890bc40dbd 100644 +--- a/src/map.rs ++++ b/src/map.rs +@@ -10,7 +10,7 @@ use core::ops::Index; + + /// Default hasher for `HashMap`. + #[cfg(feature = "ahash")] +-pub type DefaultHashBuilder = ahash::ABuildHasher; ++pub type DefaultHashBuilder = ahash::RandomState; + + /// Dummy default hasher for `HashMap`. + #[cfg(not(feature = "ahash"))] +-- +2.24.1 + diff --git a/0001-Upgrade-to-rand-0.7.3.patch b/0001-Upgrade-to-rand-0.7.3.patch new file mode 100644 index 0000000..67e5bbd --- /dev/null +++ b/0001-Upgrade-to-rand-0.7.3.patch @@ -0,0 +1,35 @@ +From 704f030d74f2b5b649d8936977d4360154cfaf41 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Mon, 27 Jan 2020 16:29:48 -0800 +Subject: [PATCH] Upgrade to rand 0.7.3 + +--- + tests/set.rs | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/tests/set.rs b/tests/set.rs +index 332f3f6f0771..3fc0717053b4 100644 +--- a/tests/set.rs ++++ b/tests/set.rs +@@ -1,7 +1,7 @@ + #![cfg(not(miri))] // FIXME: takes too long + + use hashbrown::HashSet; +-use rand::{distributions::Alphanumeric, Rng, SeedableRng, XorShiftRng}; ++use rand::{distributions::Alphanumeric, rngs::SmallRng, Rng, SeedableRng}; + + #[test] + fn test_hashset_insert_remove() { +@@ -12,8 +12,7 @@ fn test_hashset_insert_remove() { + 130, 220, 246, 217, 111, 124, 221, 189, 190, 234, 121, 93, 67, 95, 100, 43, + ]; + +- let mut rng: XorShiftRng = SeedableRng::from_seed(seed); +- //let mut rng: XorShiftRng = XorShiftRng::new_unseeded(); ++ let rng = &mut SmallRng::from_seed(seed); + let tx: Vec> = (0..4096) + .map(|_| (rng.sample_iter(&Alphanumeric).take(32).collect())) + .collect(); +-- +2.24.1 + diff --git a/hashbrown-fix-metadata.diff b/hashbrown-fix-metadata.diff index fb66604..e8708f6 100644 --- a/hashbrown-fix-metadata.diff +++ b/hashbrown-fix-metadata.diff @@ -1,6 +1,25 @@ --- hashbrown-0.6.3/Cargo.toml 1970-01-01T00:00:00+00:00 -+++ hashbrown-0.6.3/Cargo.toml 2020-01-15T20:08:04.799761+00:00 -@@ -70,7 +70,7 @@ ++++ hashbrown-0.6.3/Cargo.toml 2020-01-28T00:45:55.982293+00:00 +@@ -26,7 +26,7 @@ + [package.metadata.docs.rs] + features = ["nightly", "rayon", "serde", "raw"] + [dependencies.ahash] +-version = "0.2.11" ++version = "0.3.2" + optional = true + default-features = false + +@@ -59,7 +59,8 @@ + version = "1.2" + + [dev-dependencies.rand] +-version = "0.5.1" ++version = "0.7.3" ++features = ["small_rng"] + + [dev-dependencies.rayon] + version = "1.0" +@@ -70,7 +71,7 @@ [dev-dependencies.serde_test] version = "1.0" [build-dependencies.autocfg] diff --git a/rust-hashbrown.spec b/rust-hashbrown.spec index 5638cda..9bfe455 100644 --- a/rust-hashbrown.spec +++ b/rust-hashbrown.spec @@ -6,7 +6,7 @@ Name: rust-%{crate} Version: 0.6.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Rust port of Google's SwissTable hash map # Upstream license specification: Apache-2.0/MIT @@ -15,7 +15,10 @@ URL: https://crates.io/crates/hashbrown Source: %{crates_source} # Initial patched metadata # * Bump to autocfg 1, https://github.com/rust-lang/hashbrown/pull/138 +# * Bump to ahash 0.3.2 and rand 0.7.3, https://github.com/rust-lang/hashbrown/pull/141 Patch0: hashbrown-fix-metadata.diff +Patch1: 0001-Upgrade-to-ahash-0.3.2.patch +Patch2: 0001-Upgrade-to-rand-0.7.3.patch ExclusiveArch: %{rust_arches} %if %{__cargo_skip_build} @@ -79,42 +82,6 @@ which use "ahash-compile-time-rng" feature of "%{crate}" crate. %files -n %{name}+ahash-compile-time-rng-devel %ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/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 "alloc" feature of "%{crate}" crate. - -%files -n %{name}+alloc-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml - -%package -n %{name}+compiler_builtins-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+compiler_builtins-devel %{_description} - -This package contains library source intended for building other packages -which use "compiler_builtins" feature of "%{crate}" crate. - -%files -n %{name}+compiler_builtins-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml - -%package -n %{name}+core-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+core-devel %{_description} - -This package contains library source intended for building other packages -which use "core" feature of "%{crate}" crate. - -%files -n %{name}+core-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml - %package -n %{name}+inline-more-devel Summary: %{summary} BuildArch: noarch @@ -127,18 +94,6 @@ which use "inline-more" feature of "%{crate}" crate. %files -n %{name}+inline-more-devel %ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml -%package -n %{name}+nightly-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+nightly-devel %{_description} - -This package contains library source intended for building other packages -which use "nightly" feature of "%{crate}" crate. - -%files -n %{name}+nightly-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml - %package -n %{name}+raw-devel Summary: %{summary} BuildArch: noarch @@ -163,30 +118,6 @@ which use "rayon" feature of "%{crate}" crate. %files -n %{name}+rayon-devel %ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml -%package -n %{name}+rustc-dep-of-std-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+rustc-dep-of-std-devel %{_description} - -This package contains library source intended for building other packages -which use "rustc-dep-of-std" feature of "%{crate}" crate. - -%files -n %{name}+rustc-dep-of-std-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml - -%package -n %{name}+rustc-internal-api-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+rustc-internal-api-devel %{_description} - -This package contains library source intended for building other packages -which use "rustc-internal-api" feature of "%{crate}" crate. - -%files -n %{name}+rustc-internal-api-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml - %package -n %{name}+serde-devel Summary: %{summary} BuildArch: noarch @@ -218,6 +149,10 @@ which use "serde" feature of "%{crate}" crate. %endif %changelog +* Mon Jan 27 2020 Josh Stone - 0.6.3-3 +- Bump to ahash 0.3.2 and rand 0.7.3 +- Prune unstable features + * Wed Jan 15 2020 Josh Stone - 0.6.3-2 - Bump to autocfg 1