-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] [BC] Building service locator with non-shared services fails #27360
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
Pinpointed issue down to https://github.com/symfony/symfony/blame/master/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TestServiceContainerWeakRefPass.php#L35 This explains why I'm only seeing it during tests. This compiler pass makes a copy of the service with IGNORE_ON_INVALID_REFERENCE, violating its own rules in the later Invalid Reference Behavior check. |
@nicolas-grekas how should we handle non-shared services for this test container ? |
See #27364 |
If anyone else also got his CI/CD pipelines stuck waiting for this to be fixed, just add a compiler pass temporarily with:
|
@curry684 that won't give you access to the private services though |
Wasn't using that feature yet anyway as it's a 4.1 exclusive 😉 |
@curry684 |
I had already upgraded my application to 4.1.0-beta2 to test it, but wasn't using the private service tester yet, as the tests kept crashing because of this bug before I could do so 😆 |
…shared services (nicolas-grekas) This PR was merged into the 3.4 branch. Discussion ---------- [DI] Fix bad exception on uninitialized references to non-shared services | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27360 | License | MIT | Doc PR | - This restriction is unneeded complexity that prevents legit use cases (see linked issue #27360). Commits ------- 8bba68f [DI] Fix bad exception on uninitialized references to non-shared services
Confirmed fixed @ https://travis-ci.org/omines/datatables-bundle/jobs/382768689 |
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected: 4.1.0-beta2
Description
See https://travis-ci.org/omines/datatables-bundle/builds/382768680, build is failing only on 'dev', which is Symfony master branch. Following error occurs only in this build config:
Same error also occurs when running tests in a real application with 4.1.0-beta2, but strangely not in its dev environment.
How to reproduce
The text was updated successfully, but these errors were encountered: