From d1be2887a2388f12dede59682c7560b4dc020185 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Thu, 17 Feb 2022 16:30:02 -0800 Subject: [PATCH] Update to 0.5.0 Signed-off-by: Michel Alexandre Salim --- .gitignore | 2 + below-fix-metadata.diff | 20 ++--- below-patched-crates.patch | 169 ------------------------------------- rust-below.spec | 8 +- sources | 4 +- update-vendor-tarball.sh | 10 +-- 6 files changed, 19 insertions(+), 194 deletions(-) delete mode 100644 below-patched-crates.patch diff --git a/.gitignore b/.gitignore index 29c7322..7055dfd 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ /below-0.4.0-vendor.tar.gz /below-0.4.1.crate /below-0.4.1-vendor.tar.gz +/below-0.5.0.crate +/below-0.5.0-vendor.tar.gz diff --git a/below-fix-metadata.diff b/below-fix-metadata.diff index 1701fa0..4948087 100644 --- a/below-fix-metadata.diff +++ b/below-fix-metadata.diff @@ -1,15 +1,7 @@ ---- 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 ", "Facebook"] -@@ -108,3 +108,17 @@ +diff '--color=auto' -ruN below-0.5.0/Cargo.toml below-0.5.0-fix-metadata/Cargo.toml +--- below-0.5.0/Cargo.toml 1969-12-31 16:00:01.000000000 -0800 ++++ below-0.5.0-fix-metadata/Cargo.toml 2022-02-17 22:51:13.480645198 -0800 +@@ -112,3 +112,17 @@ [features] enable_backtrace = [] @@ -18,12 +10,12 @@ +cgroupfs = { path = "patched-crates/cgroupfs" } +common = { path = "patched-crates/below-common", package = "below-common" } +config = { path = "patched-crates/below-config", package = "below-config" } ++derive = { path = "patched-crates/below_derive", package = "below_derive" } +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" } ++render = { path = "patched-crates/below-render", package = "below-render" } +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 deleted file mode 100644 index 4ea6721..0000000 --- a/below-patched-crates.patch +++ /dev/null @@ -1,169 +0,0 @@ -diff -Naur a/patched-crates/below-common/Cargo.toml b/patched-crates/below-common/Cargo.toml ---- 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. - - [package] --edition = "2021" -+edition = "2018" - name = "below-common" - version = "0.4.1" - authors = ["Daniel Xu ", "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-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(); - 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-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. - - [package] --edition = "2021" -+edition = "2018" - name = "below-config" - version = "0.4.1" - authors = ["Daniel Xu ", "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-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. - - [package] --edition = "2021" -+edition = "2018" - name = "below_derive" - version = "0.4.1" - authors = ["Daniel Xu ", "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-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. - - [package] --edition = "2021" -+edition = "2018" - name = "below-dump" - version = "0.4.1" - authors = ["Daniel Xu ", "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-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. - - [package] --edition = "2021" -+edition = "2018" - name = "below-model" - version = "0.4.1" - authors = ["Daniel Xu ", "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-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. - - [package] --edition = "2021" -+edition = "2018" - name = "below-render" - version = "0.4.1" - authors = ["Daniel Xu ", "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-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. - - [package] --edition = "2021" -+edition = "2018" - name = "below-store" - version = "0.4.1" - authors = ["Daniel Xu ", "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-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. - - [package] --edition = "2021" -+edition = "2018" - name = "below-view" - version = "0.4.1" - authors = ["Daniel Xu ", "Facebook"] -diff -Naur a/patched-crates/cgroupfs/Cargo.toml b/patched-crates/cgroupfs/Cargo.toml ---- 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. - - [package] --edition = "2021" -+edition = "2018" - name = "cgroupfs" - version = "0.4.1" - authors = ["Daniel Xu ", "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-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. - - [package] --edition = "2021" -+edition = "2018" - name = "fb_procfs" - version = "0.4.1" - authors = ["Daniel Xu ", "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-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-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-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-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-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 3d43383..cfa2e4c 100644 --- a/rust-below.spec +++ b/rust-below.spec @@ -1,6 +1,5 @@ -# Generated by rust2rpm 18 +# Generated by rust2rpm 20 %bcond_without check -%global __cargo_skip_build 0 %global crate below @@ -16,7 +15,7 @@ %global forgeurl https://github.com/facebookincubator/below Name: rust-%{crate} -Version: 0.4.1 +Version: 0.5.0 Release: %autorelease Summary: Interactive tool to view and record historical system data @@ -91,8 +90,9 @@ Recommends: logrotate %if 0%{?el8} %doc README-epel.md %endif -%attr(755, root, root) %{_bindir}/%{crate} +%{_bindir}/below %{_unitdir}/%{crate}.service +%dir %{_sysconfdir}/logrotate.d %config(noreplace) %{_sysconfdir}/logrotate.d/%{crate}.conf %dir %{_localstatedir}/log/%{crate} diff --git a/sources b/sources index 2727363..d7f78ea 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (below-0.4.1.crate) = 1e67ad09248c8ae457932857fbee21375d1ea71020ba8254e08f1d43473ef400ac31189771e4ae02b6e199cec1a12fed6d4cde0320224ff844a39c12668e0375 -SHA512 (below-0.4.1-vendor.tar.gz) = 7d93a19ec33feae4ae7649bfc8125a958a4b4cb0899d047f132f48e503bff6b9daac3ef298926d3e690431ef6a482d8d2c0bf2fa45904fbc18234a376e5043ce +SHA512 (below-0.5.0.crate) = 7fd12aae0b912756a5ac3cee289d1b8390349f046cbf18a32dc61b7b41ab0809154133eff63cd04637f0d2ae3cdb25b5c7e2016452ed840205f5b7db57403c61 +SHA512 (below-0.5.0-vendor.tar.gz) = 61d9bfcb0243c08f6fe4f16f4dcbebafb946b1e62857d4182aaa99325bf72e7ecc8209c6ddd05c0e120f0bcc3cff128fe60ad9fb33cd560a996cb424ad74a7ed diff --git a/update-vendor-tarball.sh b/update-vendor-tarball.sh index e573186..b86f03f 100755 --- a/update-vendor-tarball.sh +++ b/update-vendor-tarball.sh @@ -23,13 +23,12 @@ 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 +# 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 +# - below-fix-metadata.diff (which is applied in %prep) +# 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 @@ -54,7 +53,8 @@ if [ -n "$PREPARE" ]; then exit 1 else (cd "${workdir}/${nv}" && \ - patch -p1 < ${tardir}/below-patched-crates.patch && \ + ([ -f ${tardir}/below-patched-crates.patch ] && \ + patch -p1 < ${tardir}/below-patched-crates.patch); \ cargo vendor && \ tar cvzf "${tardir}/${vendor_tarball}" patched-crates/ vendor/) fi