New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Routing] Enhance error handling in StaticPrefixCollection for compatibility with libpcre2-10.43 #54080
Conversation
…th libpcre2-10.43 The error handling function in the StaticPrefixCollection class has been extended. A new check for 'Compilation failed: length of lookbehind assertion is not limited' message error was added to improve the error capture process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
The affected PCRE2 version has been released two weeks ago and it will probably take a while until our CI will pick it up.
I've installed PCRE2 10.43 locally and ran our Routing test suite. I can confirm that our tests trigger the warning you've described and that your change fixes that warning.
Good catch, thanks @Lustmored. |
@PhilETaylor Are you able to determine version of |
hmmm ignore me, this PR actually FIXES the problem I have, I checked src/Symfony/Component/Routing/Matcher/Dumper/StaticPrefixCollection.php and this PR had not been applied to it, and when I manually apply the change the error disappears - sorry for the noise, all good... |
Before this PR I get the error - with this PR applied (using 6.4.x-dev Sorry for the noise. |
I think, the PCRE2 10.43 update was merged today or yesterday into Homebrew. So if that's what you're using to manage PHP on that machine, that's probably the reason why the problem appeared for you today. But that also means that more people on Macs might be hitting this issue soon. And we're still about four weeks away from the next bugfix releases. 😓 |
Yeah I update everything daily - including brew and composer deps and deploy daily for me personally it’s not an issue as I can use the dev versions and also I use docker containers for production builds, but your comments on homebrew might help others coming and reading this. |
The error handling function in the StaticPrefixCollection class has been extended. A new check for 'Compilation failed: length of lookbehind assertion is not limited' message error was added to improve the error capture process.
Recent changes in libpcre2 have changed the error message we are trying to catch in StaticPrefixCollection. The change comes from this commit (please take a look at changes in
src/pcre2_error.c
):PCRE2Project/pcre2@1e78b77
This PR checks for both possible error messages for backwards-compatible way of handling errors.
I did not add any tests as current tests are throwing PHP warnings when run with newer libpcre2, which are gone after the proposed change and I'm unsure how to proceed with that fact.