diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0e2dc3f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/rd-hashd-2.1.2.crate diff --git a/dbe5735bdf005a24e54dd19559016a59f6f43536.patch b/dbe5735bdf005a24e54dd19559016a59f6f43536.patch new file mode 100644 index 0000000..5c519b4 --- /dev/null +++ b/dbe5735bdf005a24e54dd19559016a59f6f43536.patch @@ -0,0 +1,30 @@ +From dbe5735bdf005a24e54dd19559016a59f6f43536 Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Wed, 20 Oct 2021 11:10:07 -1000 +Subject: [PATCH] hashd: build fix for 32bit archs + +--- + rd-hashd/src/testfiles.rs | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/rd-hashd/src/testfiles.rs b/rd-hashd/src/testfiles.rs +index 28e046a..c3893b1 100644 +--- a/rd-hashd/src/testfiles.rs ++++ b/rd-hashd/src/testfiles.rs +@@ -4,6 +4,7 @@ use log::{debug, trace, warn}; + use num::Integer; + use rand::rngs::SmallRng; + use rand::SeedableRng; ++use std::convert::TryInto; + use std::ffi::OsStr; + use std::fs; + use std::io::{Read, Seek, SeekFrom, Write}; +@@ -177,7 +178,7 @@ impl TestFiles { + libc::posix_fadvise( + f.as_raw_fd(), + 0, +- self.unit_size as i64, ++ self.unit_size.try_into().unwrap(), + libc::POSIX_FADV_DONTNEED, + ) + }; diff --git a/rust-rd-hashd.spec b/rust-rd-hashd.spec new file mode 100644 index 0000000..b0420c5 --- /dev/null +++ b/rust-rd-hashd.spec @@ -0,0 +1,57 @@ +# Generated by rust2rpm 18 +%bcond_without check +%global __cargo_skip_build 0 + +%global crate rd-hashd + +Name: rust-%{crate} +Version: 2.1.2 +Release: %autorelease +Summary: Latency-sensitive pseudo workload for resctl-demo + +# Upstream license specification: Apache-2.0 +License: ASL 2.0 and BSD and MIT +URL: https://crates.io/crates/rd-hashd +Source: %{crates_source} +# hashd: build fix for 32bit archs +Patch0: https://github.com/facebookexperimental/resctl-demo/commit/dbe5735bdf005a24e54dd19559016a59f6f43536.patch + +ExclusiveArch: %{rust_arches} + +BuildRequires: rust-packaging + +%global _description %{expand: +Latency-sensitive pseudo workload for resctl-demo.} + +%description %{_description} + +%package -n %{crate} +Summary: %{summary} + +%description -n %{crate} %{_description} + +%files -n %{crate} +%license LICENSE +%doc README.md +%{_bindir}/rd-hashd + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p2 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..1ddc2df --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (rd-hashd-2.1.2.crate) = 0e5b66efa2b2089f2c1efe7dc4e61982f9e2597daa103265d848e6b3a4e0c0089fb3c660e1ea6458f4def1c1e4f07baf7302d4bb79a509633749ac7a27cb5827