From 92fb446f002ac3e103dc2bf7a9b7e97cfdbde82c Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Wed, 28 Aug 2024 10:26:11 +0200 Subject: [PATCH] Drop additional dependencies for unused tracing-level log statements --- 0001-drop-deny-warnings-from-doctests.patch | 6 +- ...el-log-statements-that-depend-on-kv-.patch | 92 +++++++++++++++++++ async-std-fix-metadata-auto.diff | 2 +- async-std-fix-metadata.diff | 45 +++++++-- rust-async-std.spec | 21 ++--- rust2rpm.toml | 7 +- 6 files changed, 141 insertions(+), 32 deletions(-) create mode 100644 0002-Drop-tracing-level-log-statements-that-depend-on-kv-.patch diff --git a/0001-drop-deny-warnings-from-doctests.patch b/0001-drop-deny-warnings-from-doctests.patch index 9aaa7d1..9b0ae40 100644 --- a/0001-drop-deny-warnings-from-doctests.patch +++ b/0001-drop-deny-warnings-from-doctests.patch @@ -1,7 +1,7 @@ -From 2c0498c888d111ed23e19673d180ddab448e81b1 Mon Sep 17 00:00:00 2001 +From 464572d9eaafc802657529706ebf4872e33e83ad Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Tue, 21 May 2024 16:25:06 +0200 -Subject: [PATCH] drop deny(warnings) from doctests +Subject: [PATCH 1/2] drop deny(warnings) from doctests --- src/lib.rs | 2 +- @@ -21,5 +21,5 @@ index 86786e8..51d71ed 100644 #![doc(html_logo_url = "https://async.rs/images/logo--hero.svg")] -- -2.45.1 +2.46.0 diff --git a/0002-Drop-tracing-level-log-statements-that-depend-on-kv-.patch b/0002-Drop-tracing-level-log-statements-that-depend-on-kv-.patch new file mode 100644 index 0000000..361bfc2 --- /dev/null +++ b/0002-Drop-tracing-level-log-statements-that-depend-on-kv-.patch @@ -0,0 +1,92 @@ +From 8d9167b880dac3e4cafac486189e8b534f6b10d8 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Wed, 28 Aug 2024 10:18:33 +0200 +Subject: [PATCH 2/2] Drop tracing-level log statements that depend on + kv-log-macro + +--- + src/task/builder.rs | 40 ++++++++++++++++++++-------------------- + 1 file changed, 20 insertions(+), 20 deletions(-) + +diff --git a/src/task/builder.rs b/src/task/builder.rs +index aba0d61..40c31ab 100644 +--- a/src/task/builder.rs ++++ b/src/task/builder.rs +@@ -54,10 +54,10 @@ impl Builder { + { + let wrapped = self.build(future); + +- kv_log_macro::trace!("spawn", { +- task_id: wrapped.tag.id().0, +- parent_task_id: TaskLocalsWrapper::get_current(|t| t.id().0).unwrap_or(0), +- }); ++ //kv_log_macro::trace!("spawn", { ++ // task_id: wrapped.tag.id().0, ++ // parent_task_id: TaskLocalsWrapper::get_current(|t| t.id().0).unwrap_or(0), ++ //}); + + let task = wrapped.tag.task().clone(); + let handle = async_global_executor::spawn(wrapped); +@@ -74,10 +74,10 @@ impl Builder { + { + let wrapped = self.build(future); + +- kv_log_macro::trace!("spawn_local", { +- task_id: wrapped.tag.id().0, +- parent_task_id: TaskLocalsWrapper::get_current(|t| t.id().0).unwrap_or(0), +- }); ++ //kv_log_macro::trace!("spawn_local", { ++ // task_id: wrapped.tag.id().0, ++ // parent_task_id: TaskLocalsWrapper::get_current(|t| t.id().0).unwrap_or(0), ++ //}); + + let task = wrapped.tag.task().clone(); + let handle = async_global_executor::spawn_local(wrapped); +@@ -99,10 +99,10 @@ impl Builder { + let res = future.await; + let _ = sender.send(res); + }); +- kv_log_macro::trace!("spawn_local", { +- task_id: wrapped.tag.id().0, +- parent_task_id: TaskLocalsWrapper::get_current(|t| t.id().0).unwrap_or(0), +- }); ++ //kv_log_macro::trace!("spawn_local", { ++ // task_id: wrapped.tag.id().0, ++ // parent_task_id: TaskLocalsWrapper::get_current(|t| t.id().0).unwrap_or(0), ++ //}); + + let task = wrapped.tag.task().clone(); + wasm_bindgen_futures::spawn_local(wrapped); +@@ -125,10 +125,10 @@ impl Builder { + let _ = sender.send(res); + }); + +- kv_log_macro::trace!("spawn_local", { +- task_id: wrapped.tag.id().0, +- parent_task_id: TaskLocalsWrapper::get_current(|t| t.id().0).unwrap_or(0), +- }); ++ //kv_log_macro::trace!("spawn_local", { ++ // task_id: wrapped.tag.id().0, ++ // parent_task_id: TaskLocalsWrapper::get_current(|t| t.id().0).unwrap_or(0), ++ //}); + + let task = wrapped.tag.task().clone(); + wasm_bindgen_futures::spawn_local(wrapped); +@@ -147,10 +147,10 @@ impl Builder { + let wrapped = self.build(future); + + // Log this `block_on` operation. +- kv_log_macro::trace!("block_on", { +- task_id: wrapped.tag.id().0, +- parent_task_id: TaskLocalsWrapper::get_current(|t| t.id().0).unwrap_or(0), +- }); ++ //kv_log_macro::trace!("block_on", { ++ // task_id: wrapped.tag.id().0, ++ // parent_task_id: TaskLocalsWrapper::get_current(|t| t.id().0).unwrap_or(0), ++ //}); + + thread_local! { + /// Tracks the number of nested block_on calls. +-- +2.46.0 + diff --git a/async-std-fix-metadata-auto.diff b/async-std-fix-metadata-auto.diff index 8dcf9e2..d235192 100644 --- a/async-std-fix-metadata-auto.diff +++ b/async-std-fix-metadata-auto.diff @@ -1,5 +1,5 @@ --- async-std-1.12.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ async-std-1.12.0/Cargo.toml 2024-05-21T14:27:05.181583+00:00 ++++ async-std-1.12.0/Cargo.toml 2024-08-28T08:13:20.800376+00:00 @@ -142,7 +142,6 @@ "kv-log-macro", "log", diff --git a/async-std-fix-metadata.diff b/async-std-fix-metadata.diff index 0009af8..090dc5c 100644 --- a/async-std-fix-metadata.diff +++ b/async-std-fix-metadata.diff @@ -1,28 +1,53 @@ --- async-std-1.12.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ async-std-1.12.0/Cargo.toml 2024-05-21T14:27:24.443691+00:00 -@@ -46,10 +46,6 @@ - [[example]] ++++ async-std-1.12.0/Cargo.toml 2024-08-28T08:15:00.595989+00:00 +@@ -47,10 +47,6 @@ name = "tcp-ipv4-and-6-echo" required-features = ["unstable"] -- + -[[example]] -name = "surf-web" -required-features = ["surf"] - +- [[test]] name = "stream" -@@ -109,10 +105,6 @@ - version = "0.4.2" + required-features = ["unstable"] +@@ -80,13 +76,8 @@ + version = "0.3.4" + optional = true + +-[dependencies.kv-log-macro] +-version = "1.0.6" +-optional = true +- + [dependencies.log] + version = "0.4.8" +-features = ["kv_unstable"] optional = true + [dependencies.memchr] +@@ -108,13 +99,6 @@ + [dependencies.slab] + version = "0.4.2" + optional = true +- -[dependencies.surf] -version = "2.0.0" -optional = true - - [dev-dependencies.femme] - version = "2.1.1" +-[dev-dependencies.femme] +-version = "2.1.1" -@@ -160,8 +152,6 @@ + [dev-dependencies.futures] + version = "0.3.4" +@@ -139,7 +123,6 @@ + "async-global-executor", + "async-io", + "futures-lite", +- "kv-log-macro", + "log", + "pin-project-lite", + ] +@@ -160,8 +143,6 @@ "async-channel", "async-lock", ] diff --git a/rust-async-std.spec b/rust-async-std.spec index 2f0b1f8..6307b39 100644 --- a/rust-async-std.spec +++ b/rust-async-std.spec @@ -16,13 +16,14 @@ Source: %{crates_source} # Automatically generated patch to strip dependencies and normalize metadata Patch: async-std-fix-metadata-auto.diff # Manually created patch for downstream crate metadata changes -# * drop windows-specific dependencies and features -# * drop WASM-specific dependencies and features # * drop tokio v0.2 and v0.3 features # * drop optional surf dependency +# * drop additional dependencies for tracing-level log statements Patch: async-std-fix-metadata.diff # * fix building tests with Rust 1.78+ Patch: 0001-drop-deny-warnings-from-doctests.patch +# * drop tracing-level log statements that depend on kv-log-macro +Patch: 0002-Drop-tracing-level-log-statements-that-depend-on-kv-.patch BuildRequires: cargo-rpm-macros >= 24 @@ -216,18 +217,6 @@ use the "futures-lite" feature of the "%{crate}" crate. %files -n %{name}+futures-lite-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+kv-log-macro-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+kv-log-macro-devel %{_description} - -This package contains library source intended for building other packages which -use the "kv-log-macro" feature of the "%{crate}" crate. - -%files -n %{name}+kv-log-macro-devel -%ghost %{crate_instdir}/Cargo.toml - %package -n %{name}+log-devel Summary: %{summary} BuildArch: noarch @@ -339,7 +328,9 @@ use the "unstable" feature of the "%{crate}" crate. %prep %autosetup -n %{crate}-%{version} -p1 %cargo_prep -# remove example that depends on the optional surf dependency +# * remove example that depends on the removed femme dev-dependency +rm examples/logging.rs +# remove example that depends on the removed optional surf dependency rm examples/surf-web.rs %generate_buildrequires diff --git a/rust2rpm.toml b/rust2rpm.toml index fabab90..1043e23 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -1,14 +1,15 @@ [package] cargo-toml-patch-comments = [ - "drop windows-specific dependencies and features", - "drop WASM-specific dependencies and features", "drop tokio v0.2 and v0.3 features", "drop optional surf dependency", + "drop additional dependencies for tracing-level log statements", ] [scripts] prep.post = [ - "# remove example that depends on the optional surf dependency", + "# * remove example that depends on the removed femme dev-dependency", + "rm examples/logging.rs", + "# remove example that depends on the removed optional surf dependency", "rm examples/surf-web.rs", ]