Skip to content

Conversation

@orlitzky
Copy link
Contributor

@orlitzky orlitzky commented Nov 5, 2025

In the latest version of libpcre2, the offsets appearing in some "compilation failed" warnings have increased by one due to PCRE2Project/pcre2#756. This is causing spurious test failures, so in this commit we replace the hard-coded offsets by %d to match any integer.

An example failure:

---- EXPECTED OUTPUT
Warning: preg_grep(): Compilation failed: quantifier does not follow a repeatable item at offset 0 in %sgrep2.php on line %d
...
---- ACTUAL OUTPUT
Warning: preg_grep(): Compilation failed: quantifier does not follow a repeatable item at offset 1 in /var/tmp/portage/dev-lang/php-8.4.13/work/php-8.4.13/ext/pcre/tests/grep2.php on line 3

This was originally reported as https://bugs.gentoo.org/965018

@orlitzky
Copy link
Contributor Author

orlitzky commented Nov 5, 2025

(Sorry, I forgot to rebase on 8.3 before opening the PR and confused the hell out of the label/review bot.)

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming the change in libpcre2 is intentional.

?>
--EXPECTF--
Warning: preg_grep(): Compilation failed: quantifier does not follow a repeatable item at offset 0 in %sgrep2.php on line %d
Warning: preg_grep(): Compilation failed: quantifier does not follow a repeatable item at offset %d in %sgrep2.php on line %d
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use %r(0|1)%r instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I forgot about %r :)

Done!

@orlitzky
Copy link
Contributor Author

orlitzky commented Nov 5, 2025

It was intentional, I went digging: PCRE2Project/pcre2#756

@orlitzky orlitzky force-pushed the test-support-for-libpcre2-10.47 branch from cfd8972 to 245b796 Compare November 5, 2025 19:15
In the latest version of libpcre2, the offsets appearing in some
"compilation failed" warnings have increased by one, as a result of

  PCRE2Project/pcre2#756

This is causing spurious test failures, so in this commit we replace
the hard-coded offsets by a regex that matches both values.

Gentoo-bug: https://bugs.gentoo.org/965018
@orlitzky orlitzky force-pushed the test-support-for-libpcre2-10.47 branch from 245b796 to 5f61eeb Compare November 5, 2025 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants