-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection][4.0] Private services are removed from compiled container #25242
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
@nicolas-grekas maybe this has the same root cause of #25240? |
Fixed in #25244 |
Umh no this is not my case @nicolas-grekas... I have this issue in the tests, where I re-set services as public for testing purpose. I understand that the inlining brings a lot of performance optimizations, but can I disable it in some way? Otherwise I would have to move this stuff before the container compilation, but I think it may change the outcome of my test, hiding possible service visibility issues. |
The linked patch is wrong: making a service public after compilation is a no-op/dead code basically. |
Ok, good to know. Maybe we should deprecate/throw an error there?
I'll try, thanks for the suggestion. |
…s from ContainerBuilder (nicolas-grekas) This PR was merged into the 3.4 branch. Discussion ---------- [DI] Add missing deprecation when fetching private services from ContainerBuilder | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #25242 | License | MIT | Doc PR | - Commits ------- 93c0b38 [DI] Add missing deprecation when fetching private services from ContainerBuilder
Please check #26499 |
The DI component is acting weird in 4.0.0. I'm currently working on facile-it/paraunit#112 to allow Symfony 4, and the build is broken only with Symfony 4, no deprecations on 3.4.
I've already fixed the private/public service deprecations, and I'm currently debugging the issue. I found the root cause in the
RemoveUnusedDefinitionsPass
: many private services are considered unused and so removed from the DI. Maybe it's because they are inlined? If that's true, I'm not able to make them public in tests afterward to retrieve and inspect them.The text was updated successfully, but these errors were encountered: