Skip to content

[DependencyInjection] Defer check for circular references instead of skipping them #59810

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

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

biozshock
Copy link
Contributor

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
License MIT

Allow Dependency injection to check for circular references for lazy services, if they ever appear as "non-lazy" later during the compilation.
The issue happens when one of injected references happen to be in a service locator and injected into another service.

@carsonbot carsonbot added this to the 7.3 milestone Feb 19, 2025
@biozshock biozshock changed the base branch from 7.3 to 6.4 February 19, 2025 11:41
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

I'm sorry but the test passes without any changes to CheckCircularReferencesPass...

@nicolas-grekas nicolas-grekas modified the milestones: 7.3, 6.4 Feb 19, 2025
@symfony symfony deleted a comment from carsonbot Feb 19, 2025
@biozshock biozshock force-pushed the di-circular-lazy-service branch from 131c0fd to a555225 Compare February 19, 2025 18:11
@biozshock
Copy link
Contributor Author

@nicolas-grekas Yep. The service locator was not processed.

@OskarStark OskarStark changed the title [DependencyInjection] Defer check for circular references instead of skipping them. [DependencyInjection] Defer check for circular references instead of skipping them Feb 19, 2025
@nicolas-grekas nicolas-grekas force-pushed the di-circular-lazy-service branch from a555225 to 124087b Compare February 20, 2025 10:03
@nicolas-grekas
Copy link
Member

Good catch, thanks @biozshock.

@nicolas-grekas nicolas-grekas merged commit d6e0af4 into symfony:6.4 Feb 20, 2025
10 of 11 checks passed
This was referenced Feb 26, 2025
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.

3 participants