The package rpms/rust-below.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-below.git/commit/?id=105ebad6c2....
Change: +%ifarch s390x
Thanks.
Full change: ============
commit cf9695d976d73928ea0458da34f4b70d24e8c92e Author: Davide Cavalca dcavalca@fedoraproject.org Date: Thu Nov 11 10:59:02 2021 -0800
Update to 0.4.0; Fixes: RHBZ#2022244
diff --git a/.gitignore b/.gitignore index 3d768e2..29c7322 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ /below-0.3.0-vendor.tar.gz /below-0.4.0.crate /below-0.4.0-vendor.tar.gz +/below-0.4.1.crate +/below-0.4.1-vendor.tar.gz diff --git a/below-patched-crates.patch b/below-patched-crates.patch index 8b0dfc3..4ea6721 100644 --- a/below-patched-crates.patch +++ b/below-patched-crates.patch @@ -1,6 +1,6 @@ diff -Naur a/patched-crates/below-common/Cargo.toml b/patched-crates/below-common/Cargo.toml ---- a/patched-crates/below-common/Cargo.toml 2021-10-27 13:13:54.321402732 -0700 -+++ b/patched-crates/below-common/Cargo.toml 2021-10-27 13:14:01.866441582 -0700 +--- a/patched-crates/below-common/Cargo.toml 2021-11-11 10:54:23.798601187 -0800 ++++ b/patched-crates/below-common/Cargo.toml 2021-11-11 10:55:02.722814393 -0800 @@ -10,7 +10,7 @@ # See Cargo.toml.orig for the original contents.
@@ -8,11 +8,11 @@ diff -Naur a/patched-crates/below-common/Cargo.toml b/patched-crates/below-commo -edition = "2021" +edition = "2018" name = "below-common" - version = "0.4.0" + version = "0.4.1" authors = ["Daniel Xu dlxu@fb.com", "Facebook"] diff -Naur a/patched-crates/below-common/src/dateutil.rs b/patched-crates/below-common/src/dateutil.rs ---- a/patched-crates/below-common/src/dateutil.rs 2021-10-27 12:58:23.000000000 -0700 -+++ b/patched-crates/below-common/src/dateutil.rs 2021-10-27 13:14:26.157566663 -0700 +--- a/patched-crates/below-common/src/dateutil.rs 2021-11-11 10:54:23.798601187 -0800 ++++ b/patched-crates/below-common/src/dateutil.rs 2021-11-11 10:55:02.723814398 -0800 @@ -302,7 +302,7 @@ let mut default_format = String::new(); let mut date_with_defaults = date.clone(); @@ -23,8 +23,8 @@ diff -Naur a/patched-crates/below-common/src/dateutil.rs b/patched-crates/below- .chars() .any(|ch| naive_format.contains(&format!("%{}", ch))) diff -Naur a/patched-crates/below-config/Cargo.toml b/patched-crates/below-config/Cargo.toml ---- a/patched-crates/below-config/Cargo.toml 2021-10-27 13:13:54.322402737 -0700 -+++ b/patched-crates/below-config/Cargo.toml 2021-10-27 13:14:01.867441588 -0700 +--- a/patched-crates/below-config/Cargo.toml 2021-11-11 10:54:23.798601187 -0800 ++++ b/patched-crates/below-config/Cargo.toml 2021-11-11 10:55:02.723814398 -0800 @@ -10,7 +10,7 @@ # See Cargo.toml.orig for the original contents.
@@ -32,11 +32,11 @@ diff -Naur a/patched-crates/below-config/Cargo.toml b/patched-crates/below-confi -edition = "2021" +edition = "2018" name = "below-config" - version = "0.4.0" + version = "0.4.1" authors = ["Daniel Xu dlxu@fb.com", "Facebook"] diff -Naur a/patched-crates/below_derive/Cargo.toml b/patched-crates/below_derive/Cargo.toml ---- a/patched-crates/below_derive/Cargo.toml 2021-10-27 13:13:54.322402737 -0700 -+++ b/patched-crates/below_derive/Cargo.toml 2021-10-27 13:14:01.868441593 -0700 +--- a/patched-crates/below_derive/Cargo.toml 2021-11-11 10:54:23.802601209 -0800 ++++ b/patched-crates/below_derive/Cargo.toml 2021-11-11 10:55:02.723814398 -0800 @@ -10,7 +10,7 @@ # See Cargo.toml.orig for the original contents.
@@ -44,11 +44,11 @@ diff -Naur a/patched-crates/below_derive/Cargo.toml b/patched-crates/below_deriv -edition = "2021" +edition = "2018" name = "below_derive" - version = "0.4.0" + version = "0.4.1" authors = ["Daniel Xu dlxu@fb.com", "Facebook"] diff -Naur a/patched-crates/below-dump/Cargo.toml b/patched-crates/below-dump/Cargo.toml ---- a/patched-crates/below-dump/Cargo.toml 2021-10-27 13:13:54.323402742 -0700 -+++ b/patched-crates/below-dump/Cargo.toml 2021-10-27 13:14:01.869441598 -0700 +--- a/patched-crates/below-dump/Cargo.toml 2021-11-11 10:54:23.798601187 -0800 ++++ b/patched-crates/below-dump/Cargo.toml 2021-11-11 10:55:02.723814398 -0800 @@ -10,7 +10,7 @@ # See Cargo.toml.orig for the original contents.
@@ -56,11 +56,11 @@ diff -Naur a/patched-crates/below-dump/Cargo.toml b/patched-crates/below-dump/Ca -edition = "2021" +edition = "2018" name = "below-dump" - version = "0.4.0" + version = "0.4.1" authors = ["Daniel Xu dlxu@fb.com", "Facebook"] diff -Naur a/patched-crates/below-model/Cargo.toml b/patched-crates/below-model/Cargo.toml ---- a/patched-crates/below-model/Cargo.toml 2021-10-27 13:13:54.324402747 -0700 -+++ b/patched-crates/below-model/Cargo.toml 2021-10-27 13:14:01.869441598 -0700 +--- a/patched-crates/below-model/Cargo.toml 2021-11-11 10:54:23.799601192 -0800 ++++ b/patched-crates/below-model/Cargo.toml 2021-11-11 10:55:02.724814404 -0800 @@ -10,7 +10,7 @@ # See Cargo.toml.orig for the original contents.
@@ -68,11 +68,11 @@ diff -Naur a/patched-crates/below-model/Cargo.toml b/patched-crates/below-model/ -edition = "2021" +edition = "2018" name = "below-model" - version = "0.4.0" + version = "0.4.1" authors = ["Daniel Xu dlxu@fb.com", "Facebook"] diff -Naur a/patched-crates/below-render/Cargo.toml b/patched-crates/below-render/Cargo.toml ---- a/patched-crates/below-render/Cargo.toml 2021-10-27 13:13:54.324402747 -0700 -+++ b/patched-crates/below-render/Cargo.toml 2021-10-27 13:14:01.869441598 -0700 +--- a/patched-crates/below-render/Cargo.toml 2021-11-11 10:54:23.800601198 -0800 ++++ b/patched-crates/below-render/Cargo.toml 2021-11-11 10:55:02.724814404 -0800 @@ -10,7 +10,7 @@ # See Cargo.toml.orig for the original contents.
@@ -80,11 +80,11 @@ diff -Naur a/patched-crates/below-render/Cargo.toml b/patched-crates/below-rende -edition = "2021" +edition = "2018" name = "below-render" - version = "0.4.0" + version = "0.4.1" authors = ["Daniel Xu dlxu@fb.com", "Facebook"] diff -Naur a/patched-crates/below-store/Cargo.toml b/patched-crates/below-store/Cargo.toml ---- a/patched-crates/below-store/Cargo.toml 2021-10-27 13:13:54.324402747 -0700 -+++ b/patched-crates/below-store/Cargo.toml 2021-10-27 13:14:01.869441598 -0700 +--- a/patched-crates/below-store/Cargo.toml 2021-11-11 10:54:23.800601198 -0800 ++++ b/patched-crates/below-store/Cargo.toml 2021-11-11 10:55:02.724814404 -0800 @@ -10,7 +10,7 @@ # See Cargo.toml.orig for the original contents.
@@ -92,11 +92,11 @@ diff -Naur a/patched-crates/below-store/Cargo.toml b/patched-crates/below-store/ -edition = "2021" +edition = "2018" name = "below-store" - version = "0.4.0" + version = "0.4.1" authors = ["Daniel Xu dlxu@fb.com", "Facebook"] diff -Naur a/patched-crates/below-view/Cargo.toml b/patched-crates/below-view/Cargo.toml ---- a/patched-crates/below-view/Cargo.toml 2021-10-27 13:13:54.324402747 -0700 -+++ b/patched-crates/below-view/Cargo.toml 2021-10-27 13:14:01.870441603 -0700 +--- a/patched-crates/below-view/Cargo.toml 2021-11-11 10:54:23.801601203 -0800 ++++ b/patched-crates/below-view/Cargo.toml 2021-11-11 10:55:02.724814404 -0800 @@ -10,7 +10,7 @@ # See Cargo.toml.orig for the original contents.
@@ -104,11 +104,11 @@ diff -Naur a/patched-crates/below-view/Cargo.toml b/patched-crates/below-view/Ca -edition = "2021" +edition = "2018" name = "below-view" - version = "0.4.0" + version = "0.4.1" authors = ["Daniel Xu dlxu@fb.com", "Facebook"] diff -Naur a/patched-crates/cgroupfs/Cargo.toml b/patched-crates/cgroupfs/Cargo.toml ---- a/patched-crates/cgroupfs/Cargo.toml 2021-10-27 13:13:54.324402747 -0700 -+++ b/patched-crates/cgroupfs/Cargo.toml 2021-10-27 13:14:01.870441603 -0700 +--- a/patched-crates/cgroupfs/Cargo.toml 2021-11-11 10:54:23.807601236 -0800 ++++ b/patched-crates/cgroupfs/Cargo.toml 2021-11-11 10:55:02.724814404 -0800 @@ -10,7 +10,7 @@ # See Cargo.toml.orig for the original contents.
@@ -116,11 +116,11 @@ diff -Naur a/patched-crates/cgroupfs/Cargo.toml b/patched-crates/cgroupfs/Cargo. -edition = "2021" +edition = "2018" name = "cgroupfs" - version = "0.4.0" + version = "0.4.1" authors = ["Daniel Xu dlxu@fb.com", "Facebook"] diff -Naur a/patched-crates/fb_procfs/Cargo.toml b/patched-crates/fb_procfs/Cargo.toml ---- a/patched-crates/fb_procfs/Cargo.toml 2021-10-27 13:13:54.325402752 -0700 -+++ b/patched-crates/fb_procfs/Cargo.toml 2021-10-27 13:14:01.870441603 -0700 +--- a/patched-crates/fb_procfs/Cargo.toml 2021-11-11 10:54:23.838601406 -0800 ++++ b/patched-crates/fb_procfs/Cargo.toml 2021-11-11 10:55:02.724814404 -0800 @@ -10,7 +10,7 @@ # See Cargo.toml.orig for the original contents.
@@ -128,40 +128,42 @@ diff -Naur a/patched-crates/fb_procfs/Cargo.toml b/patched-crates/fb_procfs/Carg -edition = "2021" +edition = "2018" name = "fb_procfs" - version = "0.4.0" + version = "0.4.1" authors = ["Daniel Xu dlxu@fb.com", "Facebook"] diff -Naur a/patched-crates/libbpf-cargo/Cargo.toml b/patched-crates/libbpf-cargo/Cargo.toml ---- a/patched-crates/libbpf-cargo/Cargo.toml 2021-10-27 13:13:54.325402752 -0700 -+++ b/patched-crates/libbpf-cargo/Cargo.toml 2021-10-27 13:14:01.870441603 -0700 +--- a/patched-crates/libbpf-cargo/Cargo.toml 2021-11-11 10:54:23.848601461 -0800 ++++ b/patched-crates/libbpf-cargo/Cargo.toml 2021-11-11 10:55:28.898957781 -0800 @@ -35,7 +35,7 @@ version = "0.12"
[dependencies.libbpf-sys] --version = "0.5.0-1" +-version = "0.5.0-2" +version = "0.4.0-2"
[dependencies.memmap2] version = "0.3" diff -Naur a/patched-crates/libbpf-rs/Cargo.toml b/patched-crates/libbpf-rs/Cargo.toml ---- a/patched-crates/libbpf-rs/Cargo.toml 2021-10-27 13:13:54.325402752 -0700 -+++ b/patched-crates/libbpf-rs/Cargo.toml 2021-10-27 13:14:01.870441603 -0700 +--- a/patched-crates/libbpf-rs/Cargo.toml 2021-11-11 10:54:23.856601505 -0800 ++++ b/patched-crates/libbpf-rs/Cargo.toml 2021-11-11 10:55:48.192063468 -0800 @@ -24,7 +24,7 @@ version = "1.3"
[dependencies.libbpf-sys] --version = "0.5.0-1" +-version = "0.5.0-2" +version = "0.4.0-2"
[dependencies.nix] version = "0.22" diff -Naur a/patched-crates/libbpf-rs/src/object.rs b/patched-crates/libbpf-rs/src/object.rs ---- a/patched-crates/libbpf-rs/src/object.rs 2021-10-27 12:58:23.000000000 -0700 -+++ b/patched-crates/libbpf-rs/src/object.rs 2021-10-27 13:19:44.254204545 -0700 -@@ -67,7 +67,6 @@ +--- a/patched-crates/libbpf-rs/src/object.rs 2021-11-11 10:54:23.857601510 -0800 ++++ b/patched-crates/libbpf-rs/src/object.rs 2021-11-11 10:56:05.745159628 -0800 +@@ -67,9 +67,6 @@ pin_root_path: ptr::null(), attach_prog_fd: 0, kconfig: ptr::null(), - btf_custom_path: ptr::null(), +- __bindgen_padding_0: <[u8; 6]>::default(), +- __bindgen_padding_1: <[u8; 4]>::default(), } }
diff --git a/rust-below.spec b/rust-below.spec index 92725f5..3d43383 100644 --- a/rust-below.spec +++ b/rust-below.spec @@ -16,7 +16,7 @@ %global forgeurl https://github.com/facebookincubator/below
Name: rust-%{crate} -Version: 0.4.0 +Version: 0.4.1 Release: %autorelease Summary: Interactive tool to view and record historical system data
diff --git a/sources b/sources index a8a238e..2727363 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (below-0.4.0.crate) = ce536583048c4866b890f1298e3ca45071594f10c84b313f566725b747ccccd4ec39ad2d1560a63cebcc4c574989c57d73e64ec9e619ba93bea3b399271ed540 -SHA512 (below-0.4.0-vendor.tar.gz) = 841822049b8d3a42135b108a77c9c90e09ce55a8c26390e0e1ea05bab3581be6b05e954ffc49a2e3ca7db3c98048466f51807403847a8e40e222f279a714435f +SHA512 (below-0.4.1.crate) = 1e67ad09248c8ae457932857fbee21375d1ea71020ba8254e08f1d43473ef400ac31189771e4ae02b6e199cec1a12fed6d4cde0320224ff844a39c12668e0375 +SHA512 (below-0.4.1-vendor.tar.gz) = 7d93a19ec33feae4ae7649bfc8125a958a4b4cb0899d047f132f48e503bff6b9daac3ef298926d3e690431ef6a482d8d2c0bf2fa45904fbc18234a376e5043ce diff --git a/update-vendor-tarball.sh b/update-vendor-tarball.sh index 9d10dcb..e573186 100755 --- a/update-vendor-tarball.sh +++ b/update-vendor-tarball.sh @@ -1,5 +1,9 @@ #!/bin/sh
+if [ "$1" == --prepare ]; then + PREPARE=1 +fi + name='below' specfile="rust-${name}.spec" version=$(rpm -q --qf '%{VERSION}\n' --specfile "$specfile" | head -1) @@ -15,7 +19,9 @@ fi [ -f "$crate" ] || spectool -g "$specfile" tardir="$PWD" workdir=$(mktemp -d) -trap 'rm -rf "$workdir"' EXIT +if [ ! -n "$PREPARE" ]; then + trap 'rm -rf "$workdir"' EXIT +fi
# All the below crates use edition 2021, which isn't supported by rust in el8; # moreover, libbpf-rs and libbpf-cargo transitively depend on libbpf 0.5.0, and @@ -42,10 +48,15 @@ for c in below_derive below-common below-config below-dump below-model below-ren mv "${workdir}/${nv}/vendor/${c}" "${workdir}/${nv}/patched-crates/" done rm -r "${workdir}/${nv}/vendor" -(cd "${workdir}/${nv}" && \ - patch -p1 < ${tardir}/below-fix-metadata.diff && \ - patch -p1 < ${tardir}/below-patched-crates.patch && \ - cargo vendor && \ - tar cvzf "${tardir}/${vendor_tarball}" patched-crates/ vendor/) +(cd "${workdir}/${nv}" && patch -p1 < ${tardir}/below-fix-metadata.diff) +if [ -n "$PREPARE" ]; then + echo "Go to ${workdir} and update the patch" + exit 1 +else + (cd "${workdir}/${nv}" && \ + patch -p1 < ${tardir}/below-patched-crates.patch && \ + cargo vendor && \ + tar cvzf "${tardir}/${vendor_tarball}" patched-crates/ vendor/) +fi
exit 0
commit 105ebad6c258fe2a62dda378da050c9a5f8363dd Author: Davide Cavalca dcavalca@fedoraproject.org Date: Wed Oct 27 13:32:28 2021 -0700
Update vendoring logic to fix the epel8 build; Fixes: RHBZ#1978414
diff --git a/below-fix-metadata.diff b/below-fix-metadata.diff new file mode 100644 index 0000000..1701fa0 --- /dev/null +++ b/below-fix-metadata.diff @@ -0,0 +1,29 @@ +--- below-0.4.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ below-0.4.0/Cargo.toml 2021-10-27T17:40:41.373826+00:00 +@@ -10,7 +10,7 @@ + # See Cargo.toml.orig for the original contents. + + [package] +-edition = "2021" ++edition = "2018" + name = "below" + version = "0.4.0" + authors = ["Daniel Xu dlxu@fb.com", "Facebook"] +@@ -108,3 +108,17 @@ + + [features] + enable_backtrace = [] ++ ++[patch.crates-io] ++cgroupfs = { path = "patched-crates/cgroupfs" } ++common = { path = "patched-crates/below-common", package = "below-common" } ++config = { path = "patched-crates/below-config", package = "below-config" } ++dump = { path = "patched-crates/below-dump", package = "below-dump" } ++libbpf-rs = { path = "patched-crates/libbpf-rs" } ++libbpf-cargo = { path = "patched-crates/libbpf-cargo" } ++model = { path = "patched-crates/below-model", package = "below-model" } ++procfs = { path = "patched-crates/fb_procfs", package = "fb_procfs" } ++store = { path = "patched-crates/below-store", package = "below-store" } ++view = { path = "patched-crates/below-view", package = "below-view" } ++derive = { path = "patched-crates/below_derive", package = "below_derive" } ++render = { path = "patched-crates/below-render", package = "below-render" } diff --git a/below-patched-crates.patch b/below-patched-crates.patch new file mode 100644 index 0000000..8b0dfc3 --- /dev/null +++ b/below-patched-crates.patch @@ -0,0 +1,167 @@ +diff -Naur a/patched-crates/below-common/Cargo.toml b/patched-crates/below-common/Cargo.toml +--- a/patched-crates/below-common/Cargo.toml 2021-10-27 13:13:54.321402732 -0700 ++++ b/patched-crates/below-common/Cargo.toml 2021-10-27 13:14:01.866441582 -0700 +@@ -10,7 +10,7 @@ + # See Cargo.toml.orig for the original contents. + + [package] +-edition = "2021" ++edition = "2018" + name = "below-common" + version = "0.4.0" + authors = ["Daniel Xu dlxu@fb.com", "Facebook"] +diff -Naur a/patched-crates/below-common/src/dateutil.rs b/patched-crates/below-common/src/dateutil.rs +--- a/patched-crates/below-common/src/dateutil.rs 2021-10-27 12:58:23.000000000 -0700 ++++ b/patched-crates/below-common/src/dateutil.rs 2021-10-27 13:14:26.157566663 -0700 +@@ -302,7 +302,7 @@ + let mut default_format = String::new(); + let mut date_with_defaults = date.clone(); + let mut use_now = false; +- for part in ["S", "M", "HI", "d", "mb", "Yy"] { ++ for part in ["S", "M", "HI", "d", "mb", "Yy"].iter() { + if part + .chars() + .any(|ch| naive_format.contains(&format!("%{}", ch))) +diff -Naur a/patched-crates/below-config/Cargo.toml b/patched-crates/below-config/Cargo.toml +--- a/patched-crates/below-config/Cargo.toml 2021-10-27 13:13:54.322402737 -0700 ++++ b/patched-crates/below-config/Cargo.toml 2021-10-27 13:14:01.867441588 -0700 +@@ -10,7 +10,7 @@ + # See Cargo.toml.orig for the original contents. + + [package] +-edition = "2021" ++edition = "2018" + name = "below-config" + version = "0.4.0" + authors = ["Daniel Xu dlxu@fb.com", "Facebook"] +diff -Naur a/patched-crates/below_derive/Cargo.toml b/patched-crates/below_derive/Cargo.toml +--- a/patched-crates/below_derive/Cargo.toml 2021-10-27 13:13:54.322402737 -0700 ++++ b/patched-crates/below_derive/Cargo.toml 2021-10-27 13:14:01.868441593 -0700 +@@ -10,7 +10,7 @@ + # See Cargo.toml.orig for the original contents. + + [package] +-edition = "2021" ++edition = "2018" + name = "below_derive" + version = "0.4.0" + authors = ["Daniel Xu dlxu@fb.com", "Facebook"] +diff -Naur a/patched-crates/below-dump/Cargo.toml b/patched-crates/below-dump/Cargo.toml +--- a/patched-crates/below-dump/Cargo.toml 2021-10-27 13:13:54.323402742 -0700 ++++ b/patched-crates/below-dump/Cargo.toml 2021-10-27 13:14:01.869441598 -0700 +@@ -10,7 +10,7 @@ + # See Cargo.toml.orig for the original contents. + + [package] +-edition = "2021" ++edition = "2018" + name = "below-dump" + version = "0.4.0" + authors = ["Daniel Xu dlxu@fb.com", "Facebook"] +diff -Naur a/patched-crates/below-model/Cargo.toml b/patched-crates/below-model/Cargo.toml +--- a/patched-crates/below-model/Cargo.toml 2021-10-27 13:13:54.324402747 -0700 ++++ b/patched-crates/below-model/Cargo.toml 2021-10-27 13:14:01.869441598 -0700 +@@ -10,7 +10,7 @@ + # See Cargo.toml.orig for the original contents. + + [package] +-edition = "2021" ++edition = "2018" + name = "below-model" + version = "0.4.0" + authors = ["Daniel Xu dlxu@fb.com", "Facebook"] +diff -Naur a/patched-crates/below-render/Cargo.toml b/patched-crates/below-render/Cargo.toml +--- a/patched-crates/below-render/Cargo.toml 2021-10-27 13:13:54.324402747 -0700 ++++ b/patched-crates/below-render/Cargo.toml 2021-10-27 13:14:01.869441598 -0700 +@@ -10,7 +10,7 @@ + # See Cargo.toml.orig for the original contents. + + [package] +-edition = "2021" ++edition = "2018" + name = "below-render" + version = "0.4.0" + authors = ["Daniel Xu dlxu@fb.com", "Facebook"] +diff -Naur a/patched-crates/below-store/Cargo.toml b/patched-crates/below-store/Cargo.toml +--- a/patched-crates/below-store/Cargo.toml 2021-10-27 13:13:54.324402747 -0700 ++++ b/patched-crates/below-store/Cargo.toml 2021-10-27 13:14:01.869441598 -0700 +@@ -10,7 +10,7 @@ + # See Cargo.toml.orig for the original contents. + + [package] +-edition = "2021" ++edition = "2018" + name = "below-store" + version = "0.4.0" + authors = ["Daniel Xu dlxu@fb.com", "Facebook"] +diff -Naur a/patched-crates/below-view/Cargo.toml b/patched-crates/below-view/Cargo.toml +--- a/patched-crates/below-view/Cargo.toml 2021-10-27 13:13:54.324402747 -0700 ++++ b/patched-crates/below-view/Cargo.toml 2021-10-27 13:14:01.870441603 -0700 +@@ -10,7 +10,7 @@ + # See Cargo.toml.orig for the original contents. + + [package] +-edition = "2021" ++edition = "2018" + name = "below-view" + version = "0.4.0" + authors = ["Daniel Xu dlxu@fb.com", "Facebook"] +diff -Naur a/patched-crates/cgroupfs/Cargo.toml b/patched-crates/cgroupfs/Cargo.toml +--- a/patched-crates/cgroupfs/Cargo.toml 2021-10-27 13:13:54.324402747 -0700 ++++ b/patched-crates/cgroupfs/Cargo.toml 2021-10-27 13:14:01.870441603 -0700 +@@ -10,7 +10,7 @@ + # See Cargo.toml.orig for the original contents. + + [package] +-edition = "2021" ++edition = "2018" + name = "cgroupfs" + version = "0.4.0" + authors = ["Daniel Xu dlxu@fb.com", "Facebook"] +diff -Naur a/patched-crates/fb_procfs/Cargo.toml b/patched-crates/fb_procfs/Cargo.toml +--- a/patched-crates/fb_procfs/Cargo.toml 2021-10-27 13:13:54.325402752 -0700 ++++ b/patched-crates/fb_procfs/Cargo.toml 2021-10-27 13:14:01.870441603 -0700 +@@ -10,7 +10,7 @@ + # See Cargo.toml.orig for the original contents. + + [package] +-edition = "2021" ++edition = "2018" + name = "fb_procfs" + version = "0.4.0" + authors = ["Daniel Xu dlxu@fb.com", "Facebook"] +diff -Naur a/patched-crates/libbpf-cargo/Cargo.toml b/patched-crates/libbpf-cargo/Cargo.toml +--- a/patched-crates/libbpf-cargo/Cargo.toml 2021-10-27 13:13:54.325402752 -0700 ++++ b/patched-crates/libbpf-cargo/Cargo.toml 2021-10-27 13:14:01.870441603 -0700 +@@ -35,7 +35,7 @@ + version = "0.12" + + [dependencies.libbpf-sys] +-version = "0.5.0-1" ++version = "0.4.0-2" + + [dependencies.memmap2] + version = "0.3" +diff -Naur a/patched-crates/libbpf-rs/Cargo.toml b/patched-crates/libbpf-rs/Cargo.toml +--- a/patched-crates/libbpf-rs/Cargo.toml 2021-10-27 13:13:54.325402752 -0700 ++++ b/patched-crates/libbpf-rs/Cargo.toml 2021-10-27 13:14:01.870441603 -0700 +@@ -24,7 +24,7 @@ + version = "1.3" + + [dependencies.libbpf-sys] +-version = "0.5.0-1" ++version = "0.4.0-2" + + [dependencies.nix] + version = "0.22" +diff -Naur a/patched-crates/libbpf-rs/src/object.rs b/patched-crates/libbpf-rs/src/object.rs +--- a/patched-crates/libbpf-rs/src/object.rs 2021-10-27 12:58:23.000000000 -0700 ++++ b/patched-crates/libbpf-rs/src/object.rs 2021-10-27 13:19:44.254204545 -0700 +@@ -67,7 +67,6 @@ + pin_root_path: ptr::null(), + attach_prog_fd: 0, + kconfig: ptr::null(), +- btf_custom_path: ptr::null(), + } + } + diff --git a/rust-below.spec b/rust-below.spec index 7078b37..92725f5 100644 --- a/rust-below.spec +++ b/rust-below.spec @@ -10,6 +10,7 @@ # 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
%global forgeurl https://github.com/facebookincubator/below @@ -23,12 +24,17 @@ Summary: Interactive tool to view and record historical system data License: ASL 2.0 URL: https://crates.io/crates/below Source: %{crates_source} +# Initial patched metadata +# Downgrade edition to 2018 and patch a number of crates to use the ones +# distributed in the vendor tarball; this is meant to to be applied only for +# EPEL builds +Patch0: below-fix-metadata.diff
# Get these from the repo as they aren't included in the crate Source1: %{forgeurl}/raw/v%{version}/etc/below.service Source2: %{forgeurl}/raw/v%{version}/etc/logrotate.conf Source3: %{forgeurl}/raw/v%{version}/README.md#/README-upstream.md -# vendored dependencies for EPEL +# patched crates and vendored dependencies for EPEL # update with ./update-vendor-tarball.sh after bumping the specfile version Source4: %{crate}-%{version}-vendor.tar.gz # EPEL specific doc @@ -38,6 +44,7 @@ ExclusiveArch: %{rust_arches}
%if 0%{?el8} BuildRequires: rust-toolset +BuildRequires: sed # for libbpf-sys BuildRequires: kernel-headers BuildRequires: elfutils-libelf-devel @@ -99,12 +106,16 @@ Recommends: logrotate %systemd_postun_with_restart %{crate}.service
%prep +%setup -q -n %{crate}-%{version_no_tilde} %if 0%{?el8} -%setup -q -n %{crate}-%{version} %cargo_prep -V 4 +%patch0 -p1 cp -p %{SOURCE5} README-epel.md +%ifarch s390x +# drop opt-level generation to fix s390x OOM problems +sed -i 's/opt-level=3/opt-level=1/' .cargo/config +%endif %else -%autosetup -n %{crate}-%{version_no_tilde} -p1 %cargo_prep %endif cp -p %{SOURCE3} README.md diff --git a/sources b/sources index 771749f..a8a238e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (below-0.4.0.crate) = ce536583048c4866b890f1298e3ca45071594f10c84b313f566725b747ccccd4ec39ad2d1560a63cebcc4c574989c57d73e64ec9e619ba93bea3b399271ed540 -SHA512 (below-0.4.0-vendor.tar.gz) = b32e92a7b97e4a6dc139779b0435acfd04bc64258152ccc45ebc5d4bdd155d5975a02662bce7ff5af849db5816fd8c3be53d796ba723100977cb0c76d09fc439 +SHA512 (below-0.4.0-vendor.tar.gz) = 841822049b8d3a42135b108a77c9c90e09ce55a8c26390e0e1ea05bab3581be6b05e954ffc49a2e3ca7db3c98048466f51807403847a8e40e222f279a714435f diff --git a/update-vendor-tarball.sh b/update-vendor-tarball.sh index ceaffd4..9d10dcb 100755 --- a/update-vendor-tarball.sh +++ b/update-vendor-tarball.sh @@ -17,9 +17,35 @@ tardir="$PWD" workdir=$(mktemp -d) trap 'rm -rf "$workdir"' EXIT
+# All the below crates use edition 2021, which isn't supported by rust in el8; +# moreover, libbpf-rs and libbpf-cargo transitively depend on libbpf 0.5.0, and +# el8 ships 0.4.0. +# +# So we cheat: +# - below-fix-metadata.diff (which is applied in %prep) downgrades the edition +# for below and sets up all the other crates to be replaced with patched +# versions under patched-crates/ +# - below-patched-crates.patch contains the actual modifications of the patched +# crates (mostly the edition downgrades, a few pins and a couple of build +# fixes) +# +# We then build the vendored tarball as follows: +# - unpack the below crate and vendor +# - foreach patched crate, move it from vendor/ to patched-crates/ +# - delete vendor/ as it's no longer needed, and so we can vendor again later +# - apply the two patches, to fix the below metadata and the patched crates +# - run vendor again, and then tar up *both* patched-crates/ and vendor/ tar xvzf "$tardir/$crate" -C "$workdir" +(cd "${workdir}/${nv}" && cargo vendor) +mkdir "${workdir}/${nv}/patched-crates" +for c in below_derive below-common below-config below-dump below-model below-render below-store below-view cgroupfs fb_procfs libbpf-cargo libbpf-rs; do + mv "${workdir}/${nv}/vendor/${c}" "${workdir}/${nv}/patched-crates/" +done +rm -r "${workdir}/${nv}/vendor" (cd "${workdir}/${nv}" && \ + patch -p1 < ${tardir}/below-fix-metadata.diff && \ + patch -p1 < ${tardir}/below-patched-crates.patch && \ cargo vendor && \ - tar cvzf "${tardir}/${vendor_tarball}" vendor/) + tar cvzf "${tardir}/${vendor_tarball}" patched-crates/ vendor/)
exit 0
arch-excludes@lists.fedoraproject.org