From 6bb9c2f9563f93a2970da45b465922d18ffe8e4f Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Sun, 15 Oct 2023 00:06:30 +0200 Subject: [PATCH] Update to version 0.4.2; Fixes RHBZ#2241489 --- .gitignore | 2 ++ ...ix-compilation-of-doctests-on-32-bit.patch | 34 +++++++++++++++++++ regex-automata-fix-metadata.diff | 10 ------ rust-regex-automata.spec | 16 +++------ rust2rpm.toml | 3 ++ sources | 2 +- 6 files changed, 44 insertions(+), 23 deletions(-) create mode 100644 0001-regex-automata-fix-compilation-of-doctests-on-32-bit.patch delete mode 100644 regex-automata-fix-metadata.diff create mode 100644 rust2rpm.toml diff --git a/.gitignore b/.gitignore index b440248..fce5a11 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ /regex-automata-0.3.4.crate /regex-automata-0.3.7.crate /regex-automata-0.3.8.crate +/regex-automata-0.4.1.crate +/regex-automata-0.4.2.crate diff --git a/0001-regex-automata-fix-compilation-of-doctests-on-32-bit.patch b/0001-regex-automata-fix-compilation-of-doctests-on-32-bit.patch new file mode 100644 index 0000000..eb555fa --- /dev/null +++ b/0001-regex-automata-fix-compilation-of-doctests-on-32-bit.patch @@ -0,0 +1,34 @@ +From fe43117b051983b7869dae45658319becd971534 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Sun, 15 Oct 2023 00:59:37 +0200 +Subject: [PATCH] regex-automata: fix compilation of doctests on 32-bit + architectures + +--- + src/util/captures.rs | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/util/captures.rs b/src/util/captures.rs +index cd3a5f8..05db6a9 100644 +--- a/src/util/captures.rs ++++ b/src/util/captures.rs +@@ -433,7 +433,6 @@ impl Captures { + /// + /// ``` + /// # if cfg!(miri) { return Ok(()); } // miri takes too long +- /// # if !cfg!(target_pointer_width = "64") { return Ok(()); } // see #1039 + /// use regex_automata::{nfa::thompson::pikevm::PikeVM, Span, Match}; + /// + /// let re = PikeVM::new(r"^(?P\pL+)\s+(?P\pL+)$")?; +@@ -445,6 +444,8 @@ impl Captures { + /// assert_eq!(Some(Span::from(6..17)), caps.get_group(2)); + /// // Looking for a non-existent capturing group will return None: + /// assert_eq!(None, caps.get_group(3)); ++ /// # // literals are too big for 32-bit usize: #1039 ++ /// # #[cfg(target_pointer_width = "64")] + /// assert_eq!(None, caps.get_group(9944060567225171988)); + /// + /// # Ok::<(), Box>(()) +-- +2.41.0 + diff --git a/regex-automata-fix-metadata.diff b/regex-automata-fix-metadata.diff deleted file mode 100644 index 7426dc3..0000000 --- a/regex-automata-fix-metadata.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- regex-automata-0.3.8/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ regex-automata-0.3.8/Cargo.toml 2023-09-19T20:25:23.521202+00:00 -@@ -31,6 +31,7 @@ - categories = ["text-processing"] - license = "MIT OR Apache-2.0" - repository = "https://github.com/rust-lang/regex/tree/master/regex-automata" -+exclude = ["/test/"] - - [lib] - bench = false diff --git a/rust-regex-automata.spec b/rust-regex-automata.spec index 67f2ee1..ab1e99e 100644 --- a/rust-regex-automata.spec +++ b/rust-regex-automata.spec @@ -1,20 +1,18 @@ -# Generated by rust2rpm 24 +# Generated by rust2rpm 25 %bcond_without check %global debug_package %{nil} %global crate regex-automata Name: rust-regex-automata -Version: 0.3.8 +Version: 0.4.2 Release: %autorelease Summary: Automata construction and matching using regular expressions License: MIT OR Apache-2.0 URL: https://crates.io/crates/regex-automata Source: %{crates_source} -# Manually created patch for downstream crate metadata changes -# * prevent test data from being installed -Patch: regex-automata-fix-metadata.diff +Patch: 0001-regex-automata-fix-compilation-of-doctests-on-32-bit.patch BuildRequires: cargo-rpm-macros >= 24 @@ -411,7 +409,7 @@ use the "unicode-word-boundary" 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 @@ -427,14 +425,8 @@ use the "unicode-word-boundary" 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/1039 -%cargo_test -- --doc -- --skip dfa::dense::Config::determinize_size_limit --skip util::captures::Captures::get_group -%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 eeba362..524acbf 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (regex-automata-0.3.8.crate) = 47ad01be2c51fd510576e14f399b7f30d379a2cce2dbef3af4ee3e609859451082885132ae703c810e2b19bb3716976356e057a1a592ed507146aff9e7138dac +SHA512 (regex-automata-0.4.2.crate) = e8d9aa7ab3e86d02c3e72809500f6a1ceb2ce1f06a15af70b697ccd99d7be05a4d8f39f513e16f8f1d1983c805691e663135c0620f9cfd171868e2b0b803f2d0