From 0474aac424a2a58e4b5d01787cacf196139e46ce Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Tue, 10 Oct 2023 11:00:15 +0200 Subject: [PATCH] Update to version 0.1.2; Fixes RHBZ#2242956 --- .gitignore | 1 + ...ilation-failures-on-32-bit-architect.patch | 34 +++++++++++++++++++ rust-regex-lite.spec | 15 +++----- rust2rpm.toml | 3 ++ sources | 2 +- 5 files changed, 44 insertions(+), 11 deletions(-) create mode 100644 0001-Fix-doctest-compilation-failures-on-32-bit-architect.patch create mode 100644 rust2rpm.toml diff --git a/.gitignore b/.gitignore index 1b69349..57cc5c6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /regex-lite-0.1.0.crate +/regex-lite-0.1.2.crate diff --git a/0001-Fix-doctest-compilation-failures-on-32-bit-architect.patch b/0001-Fix-doctest-compilation-failures-on-32-bit-architect.patch new file mode 100644 index 0000000..a54a248 --- /dev/null +++ b/0001-Fix-doctest-compilation-failures-on-32-bit-architect.patch @@ -0,0 +1,34 @@ +From abe3ca24e1b5849372cf3638d13e3f5cf1763faa Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Tue, 10 Oct 2023 11:45:42 +0200 +Subject: [PATCH] Fix doctest compilation failures on 32-bit architectures + +--- + src/string.rs | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/string.rs b/src/string.rs +index af0a5b6..ad3e1ba 100644 +--- a/src/string.rs ++++ b/src/string.rs +@@ -2063,7 +2063,6 @@ impl<'h, 'n> core::ops::Index<&'n str> for Captures<'h> { + /// This example shows how to create and use `CaptureLocations` in a search. + /// + /// ``` +-/// # if !cfg!(target_pointer_width = "64") { return; } // see #1041 + /// use regex_lite::Regex; + /// + /// let re = Regex::new(r"(?\w+)\s+(?\w+)").unwrap(); +@@ -2076,7 +2075,9 @@ impl<'h, 'n> core::ops::Index<&'n str> for Captures<'h> { + /// + /// // Asking for an invalid capture group always returns None. + /// assert_eq!(None, locs.get(3)); ++/// # #[cfg(target_pointer_width = "64")] + /// assert_eq!(None, locs.get(34973498648)); ++/// # #[cfg(target_pointer_width = "64")] + /// assert_eq!(None, locs.get(9944060567225171988)); + /// ``` + #[derive(Clone, Debug)] +-- +2.41.0 + diff --git a/rust-regex-lite.spec b/rust-regex-lite.spec index e60c013..f310c40 100644 --- a/rust-regex-lite.spec +++ b/rust-regex-lite.spec @@ -1,19 +1,20 @@ -# Generated by rust2rpm 24 +# Generated by rust2rpm 25 %bcond_without check %global debug_package %{nil} %global crate regex-lite Name: rust-regex-lite -Version: 0.1.0 +Version: 0.1.2 Release: %autorelease Summary: Lightweight regex engine that optimizes for binary size and compilation time License: MIT OR Apache-2.0 URL: https://crates.io/crates/regex-lite Source: %{crates_source} +Patch: 0001-Fix-doctest-compilation-failures-on-32-bit-architect.patch -BuildRequires: rust-packaging >= 21 +BuildRequires: cargo-rpm-macros >= 24 %global _description %{expand: A lightweight regex engine that optimizes for binary size and @@ -73,7 +74,7 @@ use the "string" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep %generate_buildrequires @@ -89,14 +90,8 @@ use the "string" feature of the "%{crate}" crate. %check # * integration tests can only be run in-tree %cargo_test -- --lib -%ifarch %{ix86} -# * ignore harmless test failures on 32-bit architectures: -# https://github.com/rust-lang/regex/issues/1041 -%cargo_test -- --doc -- --skip string::CaptureLocations -%else %cargo_test -- --doc %endif -%endif %changelog %autochangelog diff --git a/rust2rpm.toml b/rust2rpm.toml new file mode 100644 index 0000000..e3be485 --- /dev/null +++ b/rust2rpm.toml @@ -0,0 +1,3 @@ +[tests] +run = ["lib", "doc"] +comments = ["integration tests can only be run in-tree"] diff --git a/sources b/sources index 2006015..c1078d7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (regex-lite-0.1.0.crate) = e0f85e5a191c9977426d2a12fdd2b52dd22eb9a6f808f207a85fe30365b951c912ab114c4df44fcb3960fb0e3574bf56f6ac06337e73b5b0aa89fde297f927ed +SHA512 (regex-lite-0.1.2.crate) = 6b7bf950234691c10975600bc82fc3ab423706db8a9ecbf750226bac94251ae71b8ad2020763b910a80ecaf5c6bcdb1ee6c019ee7b8ef638129488b9a3a8957e