From b1746f1a24906c6c323a92df09b427f39d76b26a Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Wed, 2 Aug 2023 16:47:06 -0500 Subject: [PATCH] Update to 0.7.1 Signed-off-by: Michel Alexandre Salim --- .gitignore | 1 + below-clap4.diff | 62 +++++++++++++++++++++++++++++++++++++++++ below-fix-metadata.diff | 30 ++++++++++++++------ rust-below.spec | 19 +++++++------ sources | 2 +- 5 files changed, 95 insertions(+), 19 deletions(-) create mode 100644 below-clap4.diff diff --git a/.gitignore b/.gitignore index 1dfba3c..348eaf4 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /below-0.5.0.crate /below-0.5.0-vendor.tar.gz /below-0.6.3.crate +/below-0.7.1.crate diff --git a/below-clap4.diff b/below-clap4.diff new file mode 100644 index 0000000..aec550f --- /dev/null +++ b/below-clap4.diff @@ -0,0 +1,62 @@ +From a1b257d91677637063c1eb359097d53078f7272a Mon Sep 17 00:00:00 2001 +From: Michel Salim +Date: Wed, 2 Aug 2023 12:19:57 -0700 +Subject: [PATCH] migrate to Clap 4 + +Summary: +Two `below` crates currently still use Clap 3; update to 4. + +This unblocks updating below in Fedora which has dropped clap 3 from its repos. + +Reviewed By: brianc118 + +Differential Revision: D48002223 + +fbshipit-source-id: 5f4d02fced4f182098b3ee7627b0af3179d9addb +--- + below/Cargo.toml | 4 ++-- + below/dump/Cargo.toml | 2 +- + below/dump/src/command.rs | 14 +++++++------- + below/src/main.rs | 8 ++++---- + 4 files changed, 14 insertions(+), 14 deletions(-) + +diff --git a/below/src/main.rs b/below/src/main.rs +index 0cf70e53..0a0aa57f 100644 +--- a/src/main.rs ++++ b/src/main.rs +@@ -77,7 +77,7 @@ static LIVE_REMOTE_MAX_LATENCY_SEC: u64 = 10; + + #[derive(Debug, Parser)] + struct Opt { +- #[clap(long, parse(from_os_str), default_value = config::BELOW_DEFAULT_CONF)] ++ #[clap(long, value_parser, default_value = config::BELOW_DEFAULT_CONF)] + config: PathBuf, + #[clap(short, long)] + debug: bool, +@@ -104,7 +104,7 @@ struct CompressOpts { + /// + /// With --dict-compress-chunk-size 16, you can expect around + /// 20-30x smaller data files. +- #[clap(long, requires("compress"), parse(try_from_str = parse_chunk_size))] ++ #[clap(long, requires("compress"), value_parser = parse_chunk_size)] + dict_compress_chunk_size: Option, + } + +@@ -267,7 +267,7 @@ enum Command { + duration: Option, + /// Output file path. + /// Randomized name in current directory if unspecified. +- #[clap(short, long, parse(from_os_str))] ++ #[clap(short, long, value_parser)] + output: Option, + /// Supply hostname to take snapshot from remote + #[clap(short = 's', long)] +@@ -283,7 +283,7 @@ enum Command { + #[clap(short, long, default_value = "bash")] + shell: Shell, + /// Output file, stdout if not present +- #[clap(short, long, parse(from_os_str))] ++ #[clap(short, long, value_parser)] + output: Option, + }, + } diff --git a/below-fix-metadata.diff b/below-fix-metadata.diff index 79450c2..7d184fd 100644 --- a/below-fix-metadata.diff +++ b/below-fix-metadata.diff @@ -1,11 +1,23 @@ ---- below-0.6.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ below-0.6.3/Cargo.toml 2023-01-26T19:04:17.646384+00:00 -@@ -51,7 +51,7 @@ - package = "below-config" +--- below-0.7.1/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ below-0.7.1/Cargo.toml 2023-08-02T21:21:06.579765+00:00 +@@ -37,17 +37,17 @@ + version = "0.7.1" - [dependencies.cursive] --version = "0.19.0" -+version = "0.20.0" - features = ["crossterm-backend"] - default-features = false + [dependencies.clap] +-version = "3.2.25" ++version = "4" + features = [ + "derive", + "env", +- "regex", ++ "string", + "unicode", + "wrap_help", + ] + [dependencies.clap_complete] +-version = "3.2.5" ++version = "4.3.1" + + [dependencies.common] + version = "0.7.1" diff --git a/rust-below.spec b/rust-below.spec index 57bfbb5..d5594e4 100644 --- a/rust-below.spec +++ b/rust-below.spec @@ -1,4 +1,4 @@ -# Generated by rust2rpm 23 +# Generated by rust2rpm 24 %bcond_without check %global crate below @@ -6,7 +6,7 @@ %global forgeurl https://github.com/facebookincubator/below Name: rust-below -Version: 0.6.3 +Version: 0.7.1 Release: %autorelease Summary: Interactive tool to view and record historical system data @@ -17,8 +17,12 @@ Source: %{crates_source} Source1: %{forgeurl}/raw/v%{version}/etc/below.service Source2: %{forgeurl}/raw/v%{version}/etc/logrotate.conf # Manually created patch for downstream crate metadata changes -# * bump cursive from 0.19.0 to 0.20.0 +# * bump clap from 3.2.5 to 4.3.5 +# * bump clap_complete from 3.2.5 to 4.3.1 Patch: below-fix-metadata.diff +# Migrate to clap 4 +# based on https://github.com/facebookincubator/below/commit/a1b257d91677637063c1eb359097d53078f7272a +Patch: below-clap4.diff # below-config and below-model are not available ExcludeArch: %{arm32} %{ix86} @@ -48,7 +52,7 @@ atop's design and style decisions.} %package -n %{crate} Summary: %{summary} -License: Apache-2.0 AND (Apache-2.0 OR MIT) AND Unicode-DFS-2016 AND (Apache-2.0 OR BSL-1.0) AND BSD-2-Clause AND (Apache-2.0 OR BSD-3-Clause OR MIT) AND (BSD-2-Clause OR LGPL-2.1) AND MIT AND (MPL-2.0 OR MIT OR Apache-2.0) AND (Unlicense OR MIT) +License: Apache-2.0 AND (Apache-2.0 OR MIT) AND Unicode-DFS-2016 AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND (Apache-2.0 OR BSD-3-Clause OR MIT) AND (BSD-2-Clause OR LGPL-2.1) AND MIT AND (MPL-2.0 OR MIT OR Apache-2.0) AND (Unlicense OR MIT) # LICENSE.dependencies contains a full license breakdown Recommends: logrotate @@ -57,9 +61,7 @@ Recommends: logrotate %files -n %{crate} %license LICENSE -%if 0%{?fedora} %license LICENSE.dependencies -%endif %doc README.md %{_bindir}/below %{_unitdir}/%{crate}.service @@ -85,9 +87,7 @@ Recommends: logrotate %build %cargo_build -%if 0%{?fedora} %{cargo_license} > LICENSE.dependencies -%endif %install %cargo_install @@ -98,7 +98,8 @@ install -d -m1777 %{buildroot}%{_localstatedir}/log/%{crate} %if %{with check} %check -%cargo_test +# thread 'test::record_replay_integration' panicked at 'missing memory.pressure', src/test.rs:58:10 +%cargo_test -- -- --skip test::record_replay_integration %endif %changelog diff --git a/sources b/sources index 27f0e8c..a02605c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (below-0.6.3.crate) = 4326bb87ba7d2f378fb8e7ecd68332574ef03f6d9f2fdd7994c8813817aeddf649fc5935b46328bc7a4c08ed3f292a881455b8de88fab424c613adb305a75a5e +SHA512 (below-0.7.1.crate) = cbbb2f9d908311469dbce99748cf709dd00a97d31c28ac299a8d8a53272772062c9c09ad4eb9dcb69a8b0d15bcdda48e8e3f72e787bb896fc616b1bd538f6065