Skip to content

[DependencyInjection][FrameworkBundle] Fix precedence of App\Kernel alias and ignore container.excluded tag on synthetic services #60392

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
May 9, 2025

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 7.3
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #60191
License MIT

Autoconfiguration cannot make a service abstract so I'm removing the related calls, they're confusing.

Then, I'm moving the definition of the App\Kernel alias after loading services.yaml, so that the alias overrides the discovered corresponding class.

And I make instance-of-conditionals ignore container.excluded tags on synthetic services. An alternative could be to check if the class implements KernelInterface like proposed in #60191 (comment) but I think the rule I'm proposing here is more generic.

@carsonbot carsonbot added this to the 7.3 milestone May 9, 2025
@OskarStark OskarStark changed the title [DependencyInjection][FrameworkBundle] Fix precedence of App\Kernel alias and ignore container.excluded tag on synthetic services [DependencyInjection][FrameworkBundle] Fix precedence of App\Kernel alias and ignore container.excluded tag on synthetic services May 9, 2025
…lias and ignore container.excluded tag on synthetic services
@nicolas-grekas nicolas-grekas merged commit 27edcc2 into symfony:7.3 May 9, 2025
10 of 11 checks passed
@fabpot fabpot mentioned this pull request May 10, 2025
@adpeyre
Copy link
Contributor

adpeyre commented May 12, 2025

Hello @nicolas-grekas ,
I feel like these additions introduce a bug ?
With doctrine-bundle v2.14.0

Doctrine\ORM\Mapping\Embeddable" has already been autoconfigured and merge() does not support merging autoconfiguration for the same attribute

@nicolas-grekas nicolas-grekas deleted the fix-kernel-service branch May 12, 2025 15:09
@nicolas-grekas
Copy link
Member Author

@adpeyre I don't know, please provide a reproducer in a new issue if you can (I installed doctrine-bundle with Symfony 7.3 successfully, which means I cannot reproduce).

@nicolas-grekas
Copy link
Member Author

Note that this error message is not found anywhere in Symfony 7.3 so I'm skeptical.

@adpeyre
Copy link
Contributor

adpeyre commented May 12, 2025

I think the person in my team hasn't updated their symfony properly to test 7.3.... This appears to be symfony 7.2 code... Sorry Nicolas.

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.

Symfony 7.3 cannot boot if the kernel implements CompilerPassInterface
6 participants