The package rpms/rust-rd-hashd.git has added or updated architecture specific content in
its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/rust-rd-hashd.git/commit/?id=ecfb....
Change:
+ExclusiveArch: %{rust_arches}
Thanks.
Full change:
============
commit b875a8b5e4c94070d6cccdedf86a3f33712fd627
Author: Davide Cavalca <dcavalca(a)fedoraproject.org>
Date: Fri Oct 22 10:25:44 2021 -0700
Build for epel8
diff --git a/.gitignore b/.gitignore
index 0e2dc3f..1c2a31c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/rd-hashd-2.1.2.crate
+/rd-hashd-2.1.2-vendor.tar.gz
diff --git a/rust-rd-hashd.spec b/rust-rd-hashd.spec
index b0420c5..6c5b68f 100644
--- a/rust-rd-hashd.spec
+++ b/rust-rd-hashd.spec
@@ -4,6 +4,13 @@
%global crate rd-hashd
+%if 0%{?el8}
+# el8 doesn't have these macros
+%global __crates_url
https://crates.io/api/v1/crates/
+%global crates_source
%{__crates_url}%{crate}/%{version}/download#/%{crate}-%{version}.crate
+%global version_no_tilde %{version}
+%endif
+
Name: rust-%{crate}
Version: 2.1.2
Release: %autorelease
@@ -13,12 +20,18 @@ Summary: Latency-sensitive pseudo workload for resctl-demo
License: ASL 2.0 and BSD and MIT
URL:
https://crates.io/crates/rd-hashd
Source: %{crates_source}
+# Vendored dependencies for EPEL, update with ./update-vendor-tarball.sh
+Source1: %{crate}-%{version}-vendor.tar.gz
# hashd: build fix for 32bit archs
Patch0:
https://github.com/facebookexperimental/resctl-demo/commit/dbe5735bdf005a...
ExclusiveArch: %{rust_arches}
+%if 0%{?el8}
+BuildRequires: rust-toolset
+%else
BuildRequires: rust-packaging
+%endif
%global _description %{expand:
Latency-sensitive pseudo workload for resctl-demo.}
@@ -37,10 +50,14 @@ Summary: %{summary}
%prep
%autosetup -n %{crate}-%{version_no_tilde} -p2
+%if 0%{?el8}
+%cargo_prep -V 1
+%else
%cargo_prep
%generate_buildrequires
%cargo_generate_buildrequires
+%endif
%build
%cargo_build
diff --git a/sources b/sources
index 1ddc2df..cb31e9b 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
SHA512 (rd-hashd-2.1.2.crate) =
0e5b66efa2b2089f2c1efe7dc4e61982f9e2597daa103265d848e6b3a4e0c0089fb3c660e1ea6458f4def1c1e4f07baf7302d4bb79a509633749ac7a27cb5827
+SHA512 (rd-hashd-2.1.2-vendor.tar.gz) =
501237685f68889504556cc4be89584cd44c86636d5af0140de39d4688b6f3bc3d90bb4d01f2a901a8e93ea16f4f718f2a215b797725e92693a86bc5ae249911
diff --git a/update-vendor-tarball.sh b/update-vendor-tarball.sh
new file mode 100755
index 0000000..90ed3ef
--- /dev/null
+++ b/update-vendor-tarball.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+name='rd-hashd'
+specfile="rust-${name}.spec"
+version=$(rpm -q --qf '%{VERSION}\n' --specfile "$specfile" | head -1)
+nv="${name}-${version}"
+crate="${nv}.crate"
+vendor_tarball="${nv}-vendor.tar.gz"
+
+if [ -f "$vendor_tarball" ]; then
+ echo "${vendor_tarball} already exists, aborting"
+ exit 1
+fi
+
+[ -f "$crate" ] || spectool -g "$specfile"
+tardir="$PWD"
+workdir=$(mktemp -d)
+trap 'rm -rf "$workdir"' EXIT
+
+tar xvzf "$tardir/$crate" -C "$workdir"
+(cd "${workdir}/${nv}" && \
+ cargo vendor && \
+ tar cvzf "${tardir}/${vendor_tarball}" vendor/)
+
+exit 0
commit ecfb493f4c09a8135601d48df566c2f97f4d7b11
Author: Davide Cavalca <dcavalca(a)fedoraproject.org>
Date: Thu Oct 21 05:47:18 2021 -0700
Initial import; Fixes: RHBZ#1990927
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 <htejun(a)fb.com>
+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/dbe5735bdf005a...
+
+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