-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Xdebug 3.0 leads to exception during DI container compile #39195
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
Comments
would you like giving this a try and sending a PR? |
the issue I see is that But the fact that we need to disable Xdebug for things to work seems to indicate that Xdebug is changing the behavior of PHP there. So I think this should better be fixed in Xdebug than trying to use a different workaround in Symfony (if there is one) |
Derick suggests contacting him via email for a potential workaround https://bugs.xdebug.org/view.php?id=1883#c5516 |
A manual workaround that I've found, for now, is to turn off xdebug for building the cache and then turn it back on. export XDEBUG_MODE=off
bin/console cache:clear
export XDEBUG_MODE=debug,develop // or whatever you use |
Version 4.4.16 affected too. |
@ishyevandro wrote:
I created the PR against Branch 4.4, so it will be fixed there and merged into 5.1 😉 @ericpoe wrote:
I tried to create a minimal reproducer but didn't succeed. I will try again when i get to it. (/cc @derickr) @stof wrote:
I completely agree, however i am certain that this fix will reach symfony users faster than the bugfix in xdebug (which is affected in version 2 and 3). |
There is a bug on symfony which is not compatible with the new xdebug version Refs: symfony/symfony#39195
An even easier way: XDEBUG_MODE=off bin/console cache:clear |
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- [DI] Fix Xdebug 3.0 detection | Q | A | ------------- | --- | Branch? | 4.4 (for bug fixes) | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #39195 | License | MIT | Doc PR | n/a Xdebug 3.0 removed the function `xdebug_is_enabled()`. To detect if Xdebug 3.0 is installed (it doesn't even need to be enabled to reproduce the bug) i added `function_exists('xdebug_info')`. AFAIS `xdebug_info()` is available in Xdebug >= 3.0 only. Commits ------- 38f8edd [DI] Fix Xdebug 3.0 detection
Symfony version(s) affected: 5.1.8
Description
Duplicates #30571 in a certain way (but that's closed)
Exception:
When the Exception AutowiringFailedException is constructed with a callback as message and xdebug is installed in version >= 3.0 the condition which resolves the message callback to the actual message string does not work.
Xdebug 3.0 does not provide the function
xdebug_is_enabled
anymore. See https://xdebug.org/docs/upgrade_guide#Changes-to-FunctionsHow to reproduce
You can use the reproducer from #30571. Please ensure your environment has Xdebug 3.0 installed.
Possible Solution
Replace
\function_exists('xdebug_is_enabled') && xdebug_is_enabled()
in AutowiringFailedException.php:26 with a condition which is true for xdebug 2.x and 3.x.Additional context
Exception call stack:
(Hint: The mentioned
class@anonymous::__toString()
is defined in symfony/dependency-injection/Exception/AutowiringFailedException.php:39 and following)The text was updated successfully, but these errors were encountered: