Fix building tests with Rust 1.78+

epel10
Fabio Valentini 9 months ago
parent f0768f645c
commit ce353a5ae0
No known key found for this signature in database
GPG Key ID: 5AC5F572E5D410AF

@ -0,0 +1,25 @@
From 2c0498c888d111ed23e19673d180ddab448e81b1 Mon Sep 17 00:00:00 2001
From: Fabio Valentini <decathorpe@gmail.com>
Date: Tue, 21 May 2024 16:25:06 +0200
Subject: [PATCH] drop deny(warnings) from doctests
---
src/lib.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib.rs b/src/lib.rs
index 86786e8..51d71ed 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -280,7 +280,7 @@
#![cfg_attr(feature = "docs", feature(doc_cfg))]
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![allow(clippy::mutex_atomic, clippy::module_inception)]
-#![doc(test(attr(deny(rust_2018_idioms, warnings))))]
+#![doc(test(attr(deny(rust_2018_idioms))))]
#![doc(test(attr(allow(unused_extern_crates, unused_variables))))]
#![doc(html_logo_url = "https://async.rs/images/logo--hero.svg")]
--
2.45.1

@ -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 1970-01-01T00:00:01+00:00
+++ async-std-1.12.0/Cargo.toml 2023-08-06T13:00:23.061570+00:00 +++ async-std-1.12.0/Cargo.toml 2024-05-21T14:27:05.181583+00:00
@@ -142,7 +142,6 @@ @@ -142,7 +142,6 @@
"kv-log-macro", "kv-log-macro",
"log", "log",

@ -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 1970-01-01T00:00:01+00:00
+++ async-std-1.12.0/Cargo.toml 2023-08-06T13:01:27.146892+00:00 +++ async-std-1.12.0/Cargo.toml 2024-05-21T14:27:24.443691+00:00
@@ -46,10 +46,6 @@ @@ -46,10 +46,6 @@
[[example]] [[example]]
name = "tcp-ipv4-and-6-echo" name = "tcp-ipv4-and-6-echo"

@ -1,4 +1,4 @@
# Generated by rust2rpm 24 # Generated by rust2rpm 26
%bcond_without check %bcond_without check
%global debug_package %{nil} %global debug_package %{nil}
@ -13,7 +13,7 @@ Summary: Async version of the Rust standard library
License: Apache-2.0 OR MIT License: Apache-2.0 OR MIT
URL: https://crates.io/crates/async-std URL: https://crates.io/crates/async-std
Source: %{crates_source} Source: %{crates_source}
# Automatically generated patch to strip foreign dependencies # Automatically generated patch to strip dependencies and normalize metadata
Patch: async-std-fix-metadata-auto.diff Patch: async-std-fix-metadata-auto.diff
# Manually created patch for downstream crate metadata changes # Manually created patch for downstream crate metadata changes
# * drop windows-specific dependencies and features # * drop windows-specific dependencies and features
@ -21,8 +21,10 @@ Patch: async-std-fix-metadata-auto.diff
# * drop tokio v0.2 and v0.3 features # * drop tokio v0.2 and v0.3 features
# * drop optional surf dependency # * drop optional surf dependency
Patch: async-std-fix-metadata.diff Patch: async-std-fix-metadata.diff
# * fix building tests with Rust 1.78+
Patch: 0001-drop-deny-warnings-from-doctests.patch
BuildRequires: rust-packaging >= 21 BuildRequires: cargo-rpm-macros >= 24
%global _description %{expand: %global _description %{expand:
Async version of the Rust standard library.} Async version of the Rust standard library.}
@ -335,10 +337,10 @@ use the "unstable" feature of the "%{crate}" crate.
%ghost %{crate_instdir}/Cargo.toml %ghost %{crate_instdir}/Cargo.toml
%prep %prep
%autosetup -n %{crate}-%{version_no_tilde} -p1 %autosetup -n %{crate}-%{version} -p1
%cargo_prep
# remove example that depends on the optional surf dependency # remove example that depends on the optional surf dependency
rm examples/surf-web.rs rm examples/surf-web.rs
%cargo_prep
%generate_buildrequires %generate_buildrequires
%cargo_generate_buildrequires %cargo_generate_buildrequires
@ -351,7 +353,7 @@ rm examples/surf-web.rs
%if %{with check} %if %{with check}
%check %check
# skip one failing test (probably related to mock environment) # * skip one failing test (probably related to mock environment)
%cargo_test -- -- --skip io_timeout_timedout %cargo_test -- -- --skip io_timeout_timedout
%endif %endif

@ -0,0 +1,18 @@
[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",
]
[scripts]
prep.post = [
"# remove example that depends on the optional surf dependency",
"rm examples/surf-web.rs",
]
[tests]
skip = ["io_timeout_timedout"]
comments = ["skip one failing test (probably related to mock environment)"]
Loading…
Cancel
Save